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


PHP Session\Store类代码示例

本文整理汇总了PHP中Illuminate\Session\Store的典型用法代码示例。如果您正苦于以下问题:PHP Store类的具体用法?PHP Store怎么用?PHP Store使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Store类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * @param AccountManager $manager
  * @param Store $session
  * @return \Illuminate\Contracts\View\View
  * @throws \Exception
  */
 public function index(AccountManager $manager, Store $session)
 {
     $account = $manager->account();
     $contact = $account->contactInformation->first();
     $success = $session->get('success');
     return $this->theme->render('contact.' . $this->theme->setting('contactLayout'), ['contact' => $contact, 'success' => $success]);
 }
开发者ID:jaffle-be,项目名称:framework,代码行数:13,代码来源:ContactController.php

示例2: testOldInputOrWithoutOldInput

 /**
  * Should give the fallback string when old input is not present.
  */
 public function testOldInputOrWithoutOldInput()
 {
     $fieldName = $this->generator()->anyString();
     $this->sessionStore->shouldReceive('getOldInput')->andReturn([$fieldName => []]);
     $fallbackValue = $this->generator()->anyString();
     $this->assertSame($fallbackValue, $this->replyComposer->oldInputOr($fieldName, $fallbackValue));
 }
开发者ID:hughgrigg,项目名称:ching-shop,代码行数:10,代码来源:ReplyComposerTest.php

示例3: handle

 /**
  * Handle the event.
  */
 public function handle(Store $session)
 {
     /* @var MessageBag $errors */
     if ($errors = $session->get($this->builder->getOption('prefix') . 'errors')) {
         $this->builder->setFormErrors($errors);
     }
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:10,代码来源:LoadFormErrors.php

示例4: __construct

 public function __construct($config = [], SessionStore $session)
 {
     if (is_array($config['ttwitter::config'])) {
         $this->tconfig = $config['ttwitter::config'];
     } else {
         if (is_array($config['ttwitter'])) {
             $this->tconfig = $config['ttwitter'];
         } else {
             throw new Exception('No config found');
         }
     }
     $this->debug = isset($this->tconfig['debug']) && $this->tconfig['debug'] ? true : false;
     $this->parent_config = [];
     $this->parent_config['consumer_key'] = $this->tconfig['CONSUMER_KEY'];
     $this->parent_config['consumer_secret'] = $this->tconfig['CONSUMER_SECRET'];
     $this->parent_config['token'] = $this->tconfig['ACCESS_TOKEN'];
     $this->parent_config['secret'] = $this->tconfig['ACCESS_TOKEN_SECRET'];
     if ($session->has('access_token')) {
         $access_token = $session->get('access_token');
         if (is_array($access_token) && isset($access_token['oauth_token']) && isset($access_token['oauth_token_secret']) && !empty($access_token['oauth_token']) && !empty($access_token['oauth_token_secret'])) {
             $this->parent_config['token'] = $access_token['oauth_token'];
             $this->parent_config['secret'] = $access_token['oauth_token_secret'];
         }
     }
     $this->parent_config['use_ssl'] = $this->tconfig['USE_SSL'];
     $this->parent_config['user_agent'] = 'LTTW ' . parent::VERSION;
     $config = array_merge($this->parent_config, $this->tconfig);
     parent::__construct($this->parent_config);
 }
开发者ID:nWidart,项目名称:twitter,代码行数:29,代码来源:Twitter.php

示例5: oldInput

 /**
  * @return MessageBag
  */
 private function oldInput()
 {
     if (!isset($this->oldInput)) {
         $this->oldInput = new MessageBag((array) $this->sessionStore->getOldInput());
     }
     return $this->oldInput;
 }
开发者ID:hughgrigg,项目名称:ching-shop,代码行数:10,代码来源:ReplyComposer.php

示例6: handle

 /**
  * Handle the event.
  *
  * @param Store $session
  */
 public function handle(Store $session)
 {
     /* @var FieldType $field */
     foreach ($this->builder->getFormFields() as $field) {
         $session->flash($field->getFieldName(), $field->getPostValue());
     }
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:12,代码来源:FlashFieldValues.php

示例7: flash

 /**
  * Store the messages in the current session.
  */
 public function flash()
 {
     if (static::$session) {
         static::$session->flash($this->getSessionKey(), $this);
     }
     return $this;
 }
开发者ID:iyoworks,项目名称:support,代码行数:10,代码来源:AlertBag.php

示例8: __construct

 public function __construct(Store $session, $messages = array())
 {
     $this->session = $session;
     if ($session->has($this->session_key)) {
         $messages = array_merge_recursive($session->get($this->session_key), $messages);
     }
     parent::__construct($messages);
 }
开发者ID:sharenjoy,项目名称:cmsharenjoy,代码行数:8,代码来源:FlashMessageBag.php

示例9: locale

 /**
  * @param Store $session
  * @param Request $request
  * @param AccountManager $accounts
  * @return \Illuminate\Http\RedirectResponse
  */
 public function locale(Store $session, Request $request, AccountManager $accounts)
 {
     $account = $accounts->account();
     if ($request->has('locale') && $this->is_account_locale($account, $request->get('locale'))) {
         $session->set('locale', $request->get('locale'));
         return redirect()->to('/' . $request->get('locale'));
     }
     return redirect()->to(store_route('store.home'));
 }
开发者ID:jaffle-be,项目名称:framework,代码行数:15,代码来源:SystemController.php

示例10: __construct

 /**
  * Class constructor.
  *
  * @param Illuminate\Html\FormBuilder $builder
  * @param Illuminate\Http\Request     $request
  * @param Illuminate\Session\Store    $session
  */
 public function __construct(Builder $builder, Request $request, Session $session)
 {
     $this->builder = $builder;
     $this->request = $request;
     $this->fields = new FieldCollection();
     $this->fields->setNamespace($this->namespace);
     $this->fields->setBuilder($this->builder);
     $this->fields->setErrorBag($session->has('errors') ? $session->get('errors')->getBag($this->namespace) : new MessageBag());
 }
开发者ID:ruysu,项目名称:laravel4-form,代码行数:16,代码来源:FormBuilder.php

示例11: makeResponse

 protected function makeResponse(Request $request)
 {
     $message = $this->translator->get('c::auth.login-required');
     if ($request->ajax() || $request->isJson() || $request->wantsJson()) {
         return Response::json(['error' => $message], 403);
     } else {
         $url = $this->url->action('anlutro\\Core\\Web\\AuthController@login');
         $intended = $request->getMethod() == 'GET' ? $request->fullUrl() : ($request->header('referer') ?: '/');
         $this->session->put('url.intended', $intended);
         return $this->redirect->to($url)->with('error', $message);
     }
 }
开发者ID:anlutro,项目名称:l4-core,代码行数:12,代码来源:AuthFilter.php

示例12: validate

 /**
  * Validate what is passed into the age gate
  *
  * @param array $data
  * @return $this|Validation|\Illuminate\Http\RedirectResponse
  */
 public function validate(array $data)
 {
     $this->validation = $this->validator->make($data, $this->getValidationRules(), $this->getValidationMessages());
     if ($this->validation->fails()) {
         $failed = $this->validation->failed();
         $validExceptTooYoung = array_get($failed, 'dob.Before');
         $canTryAgain = config('laravel-avp.can_try_again');
         $toRedirect = config('laravel-avp.redirect_on_error');
         $redirectURL = config('laravel-avp.redirect_url');
         if (substr($data['dob'], 0, 4) > date('Y')) {
             return redirect()->action('AVPController@agegate')->withErrors($this->validation->messages())->withInput();
         } else {
             if ($validExceptTooYoung && $toRedirect) {
                 return redirect($redirectURL);
             } else {
                 if ($validExceptTooYoung && !$canTryAgain) {
                     $this->session->put('laravel-avp.previous_too_young', true);
                 } else {
                     $this->session->keep('url.intended');
                 }
             }
         }
         return redirect()->action('AVPController@agegate')->withErrors($this->validation->messages())->withInput();
     }
     return $this->setCookie($data['remember']);
 }
开发者ID:fastwebmedia,项目名称:laravel-avp,代码行数:32,代码来源:Validation.php

示例13: handle

 /**
  * Handle the event.
  */
 public function handle()
 {
     if (!$this->config->get('app.debug') && !$this->session->get(__CLASS__ . 'warned') && $this->request->path() == 'admin/dashboard' && $this->modules->get('anomaly.module.installer')) {
         $this->session->set(__CLASS__ . 'warned', true);
         $this->messages->error('streams::message.delete_installer');
     }
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:10,代码来源:CheckIfInstallerExists.php

示例14: getUser

 public function getUser()
 {
     if ($this->user == false) {
         $this->user = $this->session->get("sharp_user");
     }
     return $this->user;
 }
开发者ID:dvlpp,项目名称:sharp,代码行数:7,代码来源:SharpAuth.php

示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->session->has('customer_id')) {
         return redirect()->to('admin');
     }
     return $next($request);
 }
开发者ID:jolupeza,项目名称:wactas,代码行数:15,代码来源:SelectCustomer.php


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