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

provider_collection.php

Zuletzt modifiziert: 09.10.2024, 12:51 - Dateigröße: 1.87 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\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      * @return object    Default auth provider selected in config if it
 42      *            does exist. Otherwise the standard db auth
 43      *            provider.
 44      * @throws \RuntimeException If neither the auth provider that
 45      *            is specified by the phpBB config nor the db
 46      *            auth provider exist. The db auth provider
 47      *            should always exist in a phpBB installation.
 48      */
 49      public function get_provider()
 50      {
 51          if ($this->offsetExists('auth.provider.' . basename(trim($this->config['auth_method']))))
 52          {
 53              return $this->offsetGet('auth.provider.' . basename(trim($this->config['auth_method'])));
 54          }
 55          // Revert to db auth provider if selected method does not exist
 56          else if ($this->offsetExists('auth.provider.db'))
 57          {
 58              return $this->offsetGet('auth.provider.db');
 59          }
 60          else
 61          {
 62              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']));
 63          }
 64      }
 65  }
 66