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

factory.php

Zuletzt modifiziert: 09.10.2024, 12:55 - Dateigröße: 1.35 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\helper\file_updater;
 15   
 16  use phpbb\di\service_collection;
 17  use phpbb\install\exception\file_updater_failure_exception;
 18   
 19  /**
 20   * File updater factory
 21   */
 22  class factory
 23  {
 24      /**
 25       * @var array
 26       */
 27      protected $file_updaters;
 28   
 29      /**
 30       * Constructor
 31       *
 32       * @param service_collection $collection    File updater service collection
 33       */
 34      public function __construct(service_collection $collection)
 35      {
 36          foreach ($collection as $service)
 37          {
 38              $this->register($service);
 39          }
 40      }
 41   
 42      /**
 43       * Register updater object
 44       *
 45       * @param file_updater_interface $updater    Updater object
 46       */
 47      public function register(file_updater_interface $updater)
 48      {
 49          $name = $updater->get_method_name();
 50          $this->file_updaters[$name] = $updater;
 51      }
 52   
 53      /**
 54       * Returns file updater object
 55       *
 56       * @param string $name    Name of the updater method
 57       *
 58       * @throws file_updater_failure_exception    When the specified file updater does not exist
 59       */
 60      public function get($name)
 61      {
 62          if (!isset($this->file_updaters[$name]))
 63          {
 64              throw new file_updater_failure_exception();
 65          }
 66   
 67          return $this->file_updaters[$name];
 68      }
 69  }
 70