each(function ($file) { Configure::load($file); }); TableRegistry::getTableLocator()->setConfig('Users', ['className' => Configure::read('Users.table')]); TableRegistry::getTableLocator()->setConfig('CakeDC/Users.Users', ['className' => Configure::read('Users.table')]); if (Configure::check('Users.auth')) { Configure::write('Auth.authenticate.all.userModel', Configure::read('Users.table')); } if (Configure::read('Users.Social.login') && php_sapi_name() != 'cli') { try { EventManager::instance()->on(\CakeDC\Users\Controller\Component\UsersAuthComponent::EVENT_FAILED_SOCIAL_LOGIN, [new \CakeDC\Users\Controller\UsersController(), 'failedSocialLoginListener']); } catch (MissingPluginException $e) { Log::error($e->getMessage()); } } $oauthPath = Configure::read('OAuth.path'); if (is_array($oauthPath)) { Router::scope('/auth', function ($routes) use ($oauthPath) { $routes->connect( '/:provider', $oauthPath, ['provider' => implode('|', array_keys(Configure::read('OAuth.providers')))] ); }); }