Back to Authentication class

Method __construct

public
__construct
(string $pluginType = 'authentication', \Joomla\Event\DispatcherInterface $dispatcher = null)
Constructor
Parameters
  • string $pluginType The plugin type to run authorisation and authentication on
  • \Joomla\Event\DispatcherInterface $dispatcher The event dispatcher we're going to use
Since
  • 1.7.0

Method __construct - Source code

/**
 * Constructor
 *
 * @param   string               $pluginType  The plugin type to run authorisation and authentication on
 * @param   DispatcherInterface  $dispatcher  The event dispatcher we're going to use
 *
 * @since   1.7.0
 */
public function __construct(string $pluginType = 'authentication', DispatcherInterface $dispatcher = null)
{
    // Set the dispatcher
    if (!\is_object($dispatcher)) {
        $dispatcher = Factory::getContainer()->get('dispatcher');
    }
    $this->setDispatcher($dispatcher);
    $this->pluginType = $pluginType;
    $isLoaded = PluginHelper::importPlugin($this->pluginType);
    if (!$isLoaded) {
        Log::add(Text::_('JLIB_USER_ERROR_AUTHENTICATION_LIBRARIES'), Log::WARNING, 'jerror');
    }
}