Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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

config.php

Zuletzt modifiziert: 09.10.2024, 12:54 - Dateigröße: 2.45 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\di\extension;
 15   
 16  use Symfony\Component\DependencyInjection\ContainerBuilder;
 17  use Symfony\Component\HttpKernel\DependencyInjection\Extension;
 18   
 19  /**
 20  * Container config extension
 21  */
 22  class config extends Extension
 23  {
 24      /** @var array */
 25      protected $config_php;
 26   
 27      public function __construct(\phpbb\config_php_file $config_php)
 28      {
 29          $this->config_php = $config_php;
 30      }
 31   
 32      /**
 33      * Loads a specific configuration.
 34      *
 35      * @param array            $config    An array of configuration values
 36      * @param ContainerBuilder $container A ContainerBuilder instance
 37      *
 38      * @throws \InvalidArgumentException When provided tag is not defined in this extension
 39      */
 40      public function load(array $config, ContainerBuilder $container)
 41      {
 42          $container->setParameter('core.adm_relative_path', ($this->config_php->get('phpbb_adm_relative_path') ? $this->config_php->get('phpbb_adm_relative_path') : 'adm/'));
 43          $container->setParameter('core.table_prefix', $this->config_php->get('table_prefix'));
 44          $container->setParameter('cache.driver.class', $this->convert_30_acm_type($this->config_php->get('acm_type')));
 45          $container->setParameter('dbal.driver.class', $this->config_php->convert_30_dbms_to_31($this->config_php->get('dbms')));
 46          $container->setParameter('dbal.dbhost', $this->config_php->get('dbhost'));
 47          $container->setParameter('dbal.dbuser', $this->config_php->get('dbuser'));
 48          $container->setParameter('dbal.dbpasswd', $this->config_php->get('dbpasswd'));
 49          $container->setParameter('dbal.dbname', $this->config_php->get('dbname'));
 50          $container->setParameter('dbal.dbport', $this->config_php->get('dbport'));
 51          $container->setParameter('dbal.new_link', defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK);
 52      }
 53   
 54      /**
 55      * Returns the recommended alias to use in XML.
 56      *
 57      * This alias is also the mandatory prefix to use when using YAML.
 58      *
 59      * @return string The alias
 60      */
 61      public function getAlias()
 62      {
 63          return 'config';
 64      }
 65   
 66      /**
 67      * Convert 3.0 ACM type to 3.1 cache driver class name
 68      *
 69      * @param string $acm_type ACM type
 70      * @return string cache driver class
 71      */
 72      protected function convert_30_acm_type($acm_type)
 73      {
 74          if (preg_match('#^[a-z]+$#', $acm_type))
 75          {
 76              return 'phpbb\\cache\\driver\\' . $acm_type;
 77          }
 78   
 79          return $acm_type;
 80      }
 81  }
 82