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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
provider_collection.php
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\auth;
15
16 use Symfony\Component\DependencyInjection\ContainerInterface;
17
18 /**
19 * Collection of auth providers to be configured at container compile time.
20 */
21 class provider_collection extends \phpbb\di\service_collection
22 {
23 /** @var \phpbb\config\config phpBB Config */
24 protected $config;
25
26 /**
27 * Constructor
28 *
29 * @param ContainerInterface $container Container object
30 * @param \phpbb\config\config $config phpBB config
31 */
32 public function __construct(ContainerInterface $container, \phpbb\config\config $config)
33 {
34 $this->container = $container;
35 $this->config = $config;
36 }
37
38 /**
39 * Get an auth provider.
40 *
41 * @param string $provider_name The name of the auth provider
42 * @return object Default auth provider selected in config if it
43 * does exist. Otherwise the standard db auth
44 * provider.
45 * @throws \RuntimeException If neither the auth provider that
46 * is specified by the phpBB config nor the db
47 * auth provider exist. The db auth provider
48 * should always exist in a phpBB installation.
49 */
50 public function get_provider($provider_name = '')
51 {
52 $provider_name = ($provider_name !== '') ? $provider_name : basename(trim($this->config['auth_method']));
53 if ($this->offsetExists('auth.provider.' . $provider_name))
54 {
55 return $this->offsetGet('auth.provider.' . $provider_name);
56 }
57 // Revert to db auth provider if selected method does not exist
58 else if ($this->offsetExists('auth.provider.db'))
59 {
60 return $this->offsetGet('auth.provider.db');
61 }
62 else
63 {
64 throw new \RuntimeException(sprintf('The authentication provider for the authentication method "%1$s" does not exist. It was not possible to recover from this by reverting to the database authentication provider.', $this->config['auth_method']));
65 }
66 }
67 }
68