[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/phpbb/console/command/db/ -> migration_command.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\db;
  14  
  15  abstract class migration_command extends \phpbb\console\command\command
  16  {
  17      /** @var \phpbb\db\migrator */
  18      protected $migrator;
  19  
  20      /** @var \phpbb\extension\manager */
  21      protected $extension_manager;
  22  
  23      /** @var \phpbb\config\config */
  24      protected $config;
  25  
  26      /** @var \phpbb\cache\service */
  27      protected $cache;
  28  
  29  	public function __construct(\phpbb\user $user, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache)
  30      {
  31          $this->migrator = $migrator;
  32          $this->extension_manager = $extension_manager;
  33          $this->config = $config;
  34          $this->cache = $cache;
  35          parent::__construct($user);
  36      }
  37  
  38  	protected function load_migrations()
  39      {
  40          $migrations = $this->extension_manager
  41              ->get_finder()
  42              ->core_path('phpbb/db/migration/data/')
  43              ->extension_directory('/migrations')
  44              ->get_classes();
  45  
  46          $this->migrator->set_migrations($migrations);
  47  
  48          return $this->migrator->get_migrations();
  49      }
  50  
  51  	protected function finalise_update()
  52      {
  53          $this->cache->purge();
  54          $this->config->increment('assets_version', 1);
  55      }
  56  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1