Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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

revert.php

Zuletzt modifiziert: 09.10.2024, 12:55 - Dateigröße: 1.97 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\InputArgument;
17  use Symfony\Component\Console\Input\InputInterface;
18  use Symfony\Component\Console\Output\OutputInterface;
19  use Symfony\Component\Console\Style\SymfonyStyle;
20   
21  class revert extends \phpbb\console\command\db\migrate
22  {
23      protected function configure()
24      {
25          $this
26              ->setName('db:revert')
27              ->setDescription($this->language->lang('CLI_DESCRIPTION_DB_REVERT'))
28              ->addArgument(
29                  'name',
30                  InputArgument::REQUIRED,
31                  $this->language->lang('CLI_MIGRATION_NAME')
32              )
33          ;
34      }
35   
36      protected function execute(InputInterface $input, OutputInterface $output)
37      {
38          $io = new SymfonyStyle($input, $output);
39   
40          $name = str_replace('/', '\\', $input->getArgument('name'));
41   
42          $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));
43   
44          $this->cache->purge();
45   
46          if (!in_array($name, $this->load_migrations()))
47          {
48              $io->error($this->language->lang('MIGRATION_NOT_VALID', $name));
49              return 1;
50          }
51          else if ($this->migrator->migration_state($name) === false)
52          {
53              $io->error($this->language->lang('MIGRATION_NOT_INSTALLED', $name));
54              return 1;
55          }
56   
57          try
58          {
59              while ($this->migrator->migration_state($name) !== false)
60              {
61                  $this->migrator->revert($name);
62              }
63          }
64          catch (\phpbb\db\migration\exception $e)
65          {
66              $io->error($e->getLocalisedMessage($this->user));
67              $this->finalise_update();
68              return 1;
69          }
70   
71          $this->finalise_update();
72          $io->success($this->language->lang('INLINE_UPDATE_SUCCESSFUL'));
73      }
74  }
75