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

populate_migrations.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 1.84 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   
14  namespace phpbb\install\module\install_finish\task;
15   
16  use phpbb\install\exception\resource_limit_reached_exception;
17  use phpbb\install\helper\config;
18  use phpbb\install\helper\container_factory;
19   
20  /**
21   * Populates migrations
22   */
23  class populate_migrations extends \phpbb\install\task_base
24  {
25      /**
26       * @var config
27       */
28      protected $config;
29   
30      /**
31       * @var \phpbb\extension\manager
32       */
33      protected $extension_manager;
34   
35      /**
36       * @var \phpbb\db\migrator
37       */
38      protected $migrator;
39   
40      /**
41       * Constructor
42       *
43       * @param config            $config        Installer's config
44       * @param container_factory    $container    phpBB's DI contianer
45       */
46      public function __construct(config $config, container_factory $container)
47      {
48          $this->config                = $config;
49          $this->extension_manager    = $container->get('ext.manager');
50          $this->migrator                = $container->get('migrator');
51   
52          parent::__construct(true);
53      }
54   
55      /**
56       * {@inheritdoc}
57       */
58      public function run()
59      {
60          if (!$this->config->get('populate_migration_refresh_before', false))
61          {
62              if ($this->config->get_time_remaining() < 1)
63              {
64                  $this->config->set('populate_migration_refresh_before', true);
65                  throw new resource_limit_reached_exception();
66              }
67          }
68   
69          $finder = $this->extension_manager->get_finder();
70   
71          $migrations = $finder
72              ->core_path('phpbb/db/migration/data/')
73              ->set_extensions(array())
74              ->get_classes();
75          $this->migrator->populate_migrations($migrations);
76      }
77   
78      /**
79       * {@inheritdoc}
80       */
81      static public function get_step_count()
82      {
83          return 1;
84      }
85   
86      /**
87       * {@inheritdoc}
88       */
89      public function get_task_lang_name()
90      {
91          return 'TASK_POPULATE_MIGRATIONS';
92      }
93  }
94