[ Index ]

PHP Cross Reference of phpBB-3.3.12-deutsch

title

Body

[close]

/phpbb/console/command/dev/ -> migration_tips.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  namespace phpbb\console\command\dev;
  14  
  15  use Symfony\Component\Console\Input\InputInterface;
  16  use Symfony\Component\Console\Output\OutputInterface;
  17  
  18  class migration_tips extends \phpbb\console\command\command
  19  {
  20      /** @var \phpbb\extension\manager */
  21      protected $extension_manager;
  22  
  23  	public function __construct(\phpbb\user $user, \phpbb\extension\manager $extension_manager)
  24      {
  25          $this->extension_manager = $extension_manager;
  26          parent::__construct($user);
  27      }
  28  
  29  	protected function configure()
  30      {
  31          $this
  32              ->setName('dev:migration-tips')
  33              ->setDescription($this->user->lang('CLI_DESCRIPTION_FIND_MIGRATIONS'))
  34          ;
  35      }
  36  
  37  	protected function execute(InputInterface $input, OutputInterface $output)
  38      {
  39          $migrations = $this->extension_manager->get_finder()
  40              ->set_extensions(array())
  41              ->core_path('phpbb/db/migration/data/')
  42              ->get_classes();
  43          $tips = $migrations;
  44  
  45          foreach ($migrations as $migration_class)
  46          {
  47              foreach ($migration_class::depends_on() as $dependency)
  48              {
  49                  $tips_key = array_search($dependency, $tips);
  50                  if ($tips_key !== false)
  51                  {
  52                      unset($tips[$tips_key]);
  53                  }
  54              }
  55          }
  56  
  57          $output->writeln("\t\t[");
  58          foreach ($tips as $migration)
  59          {
  60              $output->writeln("\t\t\t'{$migration}',");
  61          }
  62          $output->writeln("\t\t];");
  63      }
  64  }


Generated: Sun Jun 23 12:25:44 2024 Cross-referenced by PHPXref 0.7.1