本文整理汇总了PHP中Pimple\Container::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::redirect方法的具体用法?PHP Container::redirect怎么用?PHP Container::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimple\Container
的用法示例。
在下文中一共展示了Container::redirect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register
public function register(\Pimple\Container $app)
{
$app['steam_auth'] = function () use($app) {
$openid = new \LightOpenID($app['steam_auth.host']);
$openid->identity = 'http://steamcommunity.com/openid';
return $openid;
};
$app['security.authentication_listener.factory.steam_auth'] = $app->protect(function ($name, $options) use($app) {
$options = array_replace_recursive(array('check_path' => '/login/steamauthcheck'), $options);
if (!isset($app['security.authentication.success_handler.' . $name])) {
$app['security.authentication.success_handler.' . $name] = $app['security.authentication.success_handler._proto']($name, $options);
}
if (!isset($app['security.authentication.failure_handler.' . $name])) {
$app['security.authentication.failure_handler.' . $name] = $app['security.authentication.failure_handler._proto']($name, $options);
}
// define the authentication provider object
if (!isset($app['security.authentication_provider.' . $name . '.steam_auth'])) {
$app['security.authentication_provider.' . $name . '.steam_auth'] = function () use($app, $name) {
return new SteamAuthProvider($app['security.user_provider.' . $name]);
};
}
// define the authentication listener object
if (!isset($app['security.authentication_listener.' . $name . '.steam_auth'])) {
$app['security.authentication_listener.' . $name . '.steam_auth'] = function () use($app, $name, $options) {
return new SteamAuthListener($app['steam_auth'], $app['security.token_storage'], $app['security.authentication_manager'], isset($app['security.session_strategy.' . $name]) ? $app['security.session_strategy.' . $name] : $app['security.session_strategy'], $app['security.http_utils'], $name, $app['security.authentication.success_handler.' . $name], $app['security.authentication.failure_handler.' . $name], $options, $app['logger'], $app['dispatcher']);
};
}
$bindName = "steam_auth_{$name}_";
$app->match($options['check_path'], function () {
})->bind($bindName . 'check');
$app->match('/login', function () use($app, $bindName) {
return $app->redirect($app['url_generator']->generate($bindName . 'check'));
});
return array('security.authentication_provider.' . $name . '.steam_auth', 'security.authentication_listener.' . $name . '.steam_auth', null, 'pre_auth');
});
}