Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

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: 02.04.2025, 15:02 - Dateigröße: 2.08 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          $parameters = array(
43              'core.adm_relative_path'    => $this->config_php->get('phpbb_adm_relative_path') ? $this->config_php->get('phpbb_adm_relative_path') : 'adm/',
44              'core.table_prefix'            => $this->config_php->get('table_prefix'),
45              'cache.driver.class'        => $this->convert_30_acm_type($this->config_php->get('acm_type')),
46              'dbal.new_link'                => defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK,
47          );
48          $parameter_bag = $container->getParameterBag();
49   
50          foreach ($parameters as $parameter => $value)
51          {
52              $container->setParameter($parameter, $parameter_bag->escapeValue($value));
53          }
54      }
55   
56      /**
57      * Returns the recommended alias to use in XML.
58      *
59      * This alias is also the mandatory prefix to use when using YAML.
60      *
61      * @return string The alias
62      */
63      public function getAlias()
64      {
65          return 'config';
66      }
67   
68      /**
69      * Convert 3.0 ACM type to 3.1 cache driver class name
70      *
71      * @param string $acm_type ACM type
72      * @return string cache driver class
73      */
74      protected function convert_30_acm_type($acm_type)
75      {
76          if (preg_match('#^[a-z]+$#', $acm_type))
77          {
78              return 'phpbb\\cache\\driver\\' . $acm_type;
79          }
80   
81          return $acm_type;
82      }
83  }
84