Verzeichnisstruktur phpBB-3.3.16


Veröffentlicht
27.04.2026

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

migrate.php

Zuletzt modifiziert: 01.05.2026, 11:26 - Dateigröße: 2.69 KiB


 01  <?php
 02  /**
 03  *
 04  * This file is part of the phpBB Forum Software package.
 05  *
 06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 07  * @license GNU General Public License, version 2 (GPL-2.0)
 08  *
 09  * For full copyright and license information, please see
 10  * the docs/CREDITS.txt file.
 11  *
 12  */
 13  namespace phpbb\console\command\db;
 14   
 15  use phpbb\db\output_handler\log_wrapper_migrator_output_handler;
 16  use Symfony\Component\Console\Input\InputInterface;
 17  use Symfony\Component\Console\Output\OutputInterface;
 18  use Symfony\Component\Console\Style\SymfonyStyle;
 19   
 20  class migrate extends \phpbb\console\command\db\migration_command
 21  {
 22      /** @var \phpbb\log\log */
 23      protected $log;
 24   
 25      /** @var string phpBB root path */
 26      protected $phpbb_root_path;
 27   
 28      /** @var  \phpbb\filesystem\filesystem_interface */
 29      protected $filesystem;
 30   
 31      /** @var \phpbb\language\language */
 32      protected $language;
 33   
 34      public function __construct(\phpbb\user $user, \phpbb\language\language $language, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
 35      {
 36          $this->language = $language;
 37          $this->log = $log;
 38          $this->filesystem = $filesystem;
 39          $this->phpbb_root_path = $phpbb_root_path;
 40          parent::__construct($user, $migrator, $extension_manager, $config, $cache);
 41          $this->language->add_lang(array('common', 'install', 'migrator'));
 42      }
 43   
 44      protected function configure()
 45      {
 46          $this
 47              ->setName('db:migrate')
 48              ->setDescription($this->language->lang('CLI_DESCRIPTION_DB_MIGRATE'))
 49          ;
 50      }
 51   
 52      protected function execute(InputInterface $input, OutputInterface $output)
 53      {
 54          $io = new SymfonyStyle($input, $output);
 55   
 56          $this->migrator->set_output_handler(new log_wrapper_migrator_output_handler($this->language, new console_migrator_output_handler($this->user, $output), $this->phpbb_root_path . 'store/migrations_' . time() . '.log', $this->filesystem));
 57   
 58          $this->migrator->create_migrations_table();
 59   
 60          $this->cache->purge();
 61          if ($this->config instanceof \phpbb\config\db)
 62          {
 63              $this->config->initialise($this->cache->get_driver());
 64          }
 65   
 66          $this->load_migrations();
 67          $orig_version = $this->config['version'];
 68          while (!$this->migrator->finished())
 69          {
 70              try
 71              {
 72                  $this->migrator->update();
 73              }
 74              catch (\phpbb\db\migration\exception $e)
 75              {
 76                  $io->error($e->getLocalisedMessage($this->user));
 77                  $this->finalise_update();
 78                  return 1;
 79              }
 80          }
 81   
 82          if ($orig_version != $this->config['version'])
 83          {
 84              $this->log->add('admin', ANONYMOUS, '', 'LOG_UPDATE_DATABASE', time(), array($orig_version, $this->config['version']));
 85          }
 86   
 87          $this->finalise_update();
 88          $io->success($this->language->lang('INLINE_UPDATE_SUCCESSFUL'));
 89      }
 90  }
 91