* @package generis */ class AuthFactory { const CONFIG_KEY = 'auth'; public static function createAdapters() { $adapters = []; $config = common_ext_ExtensionsManager::singleton()->getExtensionById('generis')->getConfig('auth'); if (is_array($config)) { foreach ($config as $key => $adapterConf) { if (isset($adapterConf['driver'])) { $className = $adapterConf['driver']; unset($adapterConf['driver']); if (class_exists($className) && in_array(__NAMESPACE__ . '\LoginAdapter', class_implements($className))) { $adapter = new $className(); $adapter->setOptions($adapterConf); $adapters[] = $adapter; } else { \common_Logger::e($className . ' is not a valid LoginAdapter'); } } else { \common_Logger::e('No driver for auth adapter ' . $key); } } } return $adapters; } }