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.79 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\iohandler;
 15   
 16  use phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception;
 17   
 18  /**
 19   * Input-output handler factory
 20   */
 21  class factory
 22  {
 23      /**
 24       * @var \Symfony\Component\DependencyInjection\ContainerInterface
 25       */
 26      protected $container;
 27   
 28      /**
 29       * @var string
 30       */
 31      protected $environment;
 32   
 33      /**
 34       * Constructor
 35       *
 36       * @param \Symfony\Component\DependencyInjection\ContainerInterface $container Dependency injection container
 37       */
 38      public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container)
 39      {
 40          $this->container    = $container;
 41          $this->environment    = null;
 42      }
 43   
 44      /**
 45       * @param string    $environment    The name of the input-output handler to use
 46       */
 47      public function set_environment($environment)
 48      {
 49          $this->environment = $environment;
 50      }
 51   
 52      /**
 53       * Factory getter for iohandler
 54       *
 55       * @return \phpbb\install\helper\iohandler\iohandler_interface
 56       *
 57       * @throws \phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception
 58       *         When the specified iohandler_interface does not exists
 59       */
 60      public function get()
 61      {
 62          switch ($this->environment)
 63          {
 64              case 'ajax':
 65                  return $this->container->get('installer.helper.iohandler_ajax');
 66              break;
 67              case 'nojs':
 68                  // @todo replace this
 69                  return $this->container->get('installer.helper.iohandler_ajax');
 70              break;
 71              case 'cli':
 72                  return $this->container->get('installer.helper.iohandler_cli');
 73              break;
 74              default:
 75                  throw new iohandler_not_implemented_exception();
 76              break;
 77          }
 78      }
 79  }
 80