当前位置: 首页>>代码示例>>PHP>>正文


PHP Container::redirect方法代码示例

本文整理汇总了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');
     });
 }
开发者ID:rafalniewinski,项目名称:silex-steamauth,代码行数:36,代码来源:SteamAuthServiceProvider.php


注:本文中的Pimple\Container::redirect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。