本文整理汇总了PHP中Illuminate\Session\SessionManager类的典型用法代码示例。如果您正苦于以下问题:PHP SessionManager类的具体用法?PHP SessionManager怎么用?PHP SessionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SessionManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1:
/**
* @param Organization $organization
* @param User $user
* @param SessionManager $sessionManager
*/
function __construct(Organization $organization, User $user, SessionManager $sessionManager)
{
$this->organization = $organization;
$this->user = $user;
$this->sessionManager = $sessionManager;
$this->orgId = $this->sessionManager->get('org_id');
}
开发者ID:younginnovations,项目名称:aidstream,代码行数:12,代码来源:UserController.php
示例2: install
public function install(Request $request, PluginHandler $handler, PluginProvider $provider, ComposerFileWriter $writer, SessionManager $session)
{
$id = $request->get('pluginId');
$handler->getAllPlugins(true);
if ($handler->getPlugin($id) !== null) {
throw new HttpException(422, 'Plugin already installed.');
}
// 자료실에서 플러그인 정보 조회
$pluginData = $provider->find($id);
if ($pluginData === null) {
throw new HttpException(422, "Can not find the plugin(" . $id . ") that should be installed from the Market-place.");
}
$title = $pluginData->title;
$name = $pluginData->name;
$version = $pluginData->latest_release->version;
$operation = $handler->getOperation($writer);
if ($operation['status'] === ComposerFileWriter::STATUS_RUNNING) {
throw new HttpException(422, "이미 진행중인 요청이 있습니다.");
}
$timeLimit = config('xe.plugin.operation.time_limit');
$writer->reset()->cleanOperation();
$writer->install($name, $version, Carbon::now()->addSeconds($timeLimit)->toDateTimeString())->write();
$this->reserveOperation($writer, $timeLimit);
$session->flash('alert', ['type' => 'success', 'message' => '새로운 플러그인을 설치중입니다.']);
return XePresenter::makeApi(['type' => 'success', 'message' => '새로운 플러그인을 설치중입니다.']);
}
开发者ID:xpressengine,项目名称:xpressengine,代码行数:26,代码来源:PluginController.php
示例3: __construct
public function __construct()
{
$this->sessionManager = app(SessionManager::class);
if ($this->sessionManager->has('flash_messages')) {
$this->messages = $this->sessionManager->get('flash_messages');
}
}
开发者ID:marius321967,项目名称:laravel-messages,代码行数:7,代码来源:MessageHandler.php
示例4: __construct
public function __construct(SessionManager $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:NewwayLibs,项目名称:nw-core,代码行数:8,代码来源:FlashMessageBag.php
示例5: handleProviderCallback
public function handleProviderCallback(Guard $auth, Socialite $socialite, UsersService $userService, SessionManager $manager)
{
$user = $socialite->driver('facebook')->user();
$authUser = $userService->findOrCreateByFacebook($user);
$auth->login($authUser);
$manager->driver()->save();
return redirect('/');
}
开发者ID:rodnover55,项目名称:guess-rock,代码行数:8,代码来源:FacebookController.php
示例6: startSession
public function startSession()
{
$encrypter = $this->createEncrypter();
$manager = new SessionManager($this->laravel);
$session = $manager->driver();
$this->updateSessionId($encrypter, $session);
$session->start();
$this->bindNewSession($session);
}
开发者ID:GBPcoder,项目名称:tpanel,代码行数:9,代码来源:laravelManager.php
示例7: session
/**
* Get session.
*
* @param string|null $key
* @param mixed $default
*
* @return \Illuminate\Session\SessionManager|mixed
*/
public function session($key = null, $default = null)
{
if (!isset($this->session)) {
$this->session = app('session');
}
if (is_null($key)) {
return $this->session;
}
return $this->session->get($key, $default);
}
开发者ID:Hiroto-K,项目名称:HkApps,代码行数:18,代码来源:RequestTrait.php
示例8:
/**
* @param OrganizationManager $organizationManager
* @param SessionManager $sessionManager
* @param ActivityManager $activityManager
* @param UploadActivityManager $uploadActivityManager
* @param UploadActivity $uploadActivity
* @param SettingsManager $settingsManager
*/
function __construct(OrganizationManager $organizationManager, SessionManager $sessionManager, ActivityManager $activityManager, UploadActivityManager $uploadActivityManager, UploadActivity $uploadActivity, SettingsManager $settingsManager)
{
$this->middleware('auth');
$this->activityManager = $activityManager;
$this->uploadActivity = $uploadActivity;
$this->uploadActivityManager = $uploadActivityManager;
$this->sessionManager = $sessionManager;
$this->organizationId = $this->sessionManager->get('org_id');
$this->organizationManager = $organizationManager;
$this->settingsManager = $settingsManager;
}
开发者ID:younginnovations,项目名称:aidstream,代码行数:19,代码来源:ActivityUploadController.php
示例9:
/**
* @param Activity $activity
* @param IatiIdentifierManager $iatiIdentifierManager
* @param Identifier $identifier
* @param OrganizationManager $organizationManager
* @param SessionManager $sessionManager
* @param ActivityManager $activityManager
*/
function __construct(Activity $activity, IatiIdentifierManager $iatiIdentifierManager, Identifier $identifier, OrganizationManager $organizationManager, SessionManager $sessionManager, ActivityManager $activityManager)
{
$this->middleware('auth');
$this->activity = $activity;
$this->iatiIdentifierManager = $iatiIdentifierManager;
$this->identifier = $identifier;
$this->organizationManager = $organizationManager;
$this->sessionManager = $sessionManager;
$this->organization_id = $this->sessionManager->get('org_id');
$this->activityManager = $activityManager;
}
开发者ID:younginnovations,项目名称:aidstream,代码行数:19,代码来源:IatiIdentifierController.php
示例10: store
public function store(Request $request, WidgetBoxHandler $handler, SessionManager $session)
{
if (!$request->user()->isAdmin()) {
throw new AccessDeniedHttpException();
}
$this->validate($request, ['id' => 'required', 'title' => 'required']);
$inputs = $request->only(['id', 'title']);
$widgetbox = $handler->find($inputs['id']);
if ($widgetbox) {
throw new IDAlreadyExistsException();
}
$widgetbox = $handler->create($inputs);
$session->flash('alert', ['type' => 'success', 'message' => '위젯박스가 생성되었습니다.']);
return XePresenter::makeApi(['type' => 'success', 'message' => '생성했습니다.']);
}
开发者ID:xpressengine,项目名称:xpressengine,代码行数:15,代码来源:WidgetBoxController.php
示例11: register
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app['session'] = $this->app->share(function ($app) {
// First, we will create the session manager which is responsible for the
// creation of the various session drivers when they are needed by the
// application instance, and will resolve them on a lazy load basis.
$manager = new SessionManager($app);
$driver = $manager->driver();
$config = $app['config']['session'];
// Once we get an instance of the session driver, we need to set a few of
// the session options based on the application configuration, such as
// the session lifetime and the sweeper lottery configuration value.
$driver->setLifetime($config['lifetime']);
$driver->setSweepLottery($config['lottery']);
return $driver;
});
}
开发者ID:defra91,项目名称:levecchiecredenze.it,代码行数:22,代码来源:SessionServiceProvider.php
示例12: preSet
public function preSet(FormEvent $event)
{
$form = $event->getForm();
$rootName = $form->getRoot()->getName();
if (!$form->isRoot() && ($parent = $form->getParent())) {
$name = $this->getDottedName($form);
$fullName = $this->getFullName($rootName, $name);
// Add input from the previous submit
if ($form->getName() !== '_token' && $this->session->hasOldInput($fullName)) {
// Get old value
$value = $this->session->getOldInput($fullName);
// Transform back to good data
$value = $this->transformValue($event, $value);
// Store on the form
$event->setData($value);
}
if ($this->session->has('errors')) {
/** @var \Illuminate\Support\ViewErrorBag $errors */
$errors = $this->session->get('errors');
if ($errors->has($name)) {
$form->addError(new FormError(implode(' ', $errors->get($name))));
}
}
}
}
开发者ID:barryvdh,项目名称:laravel-form-bridge,代码行数:25,代码来源:SessionListener.php
示例13: handle
public function handle($request, \Closure $next)
{
$response = $next($request);
if (!empty($flashMessages = $this->messageManager->getFlash())) {
$this->sessionManager->flash('flash_messages', $flashMessages);
}
return $response;
}
开发者ID:marius321967,项目名称:laravel-messages,代码行数:8,代码来源:StoreFlashMessages.php
示例14: getValueForSection
public function getValueForSection($section, $key = null, $default = null)
{
$values = $this->sessionManager->get($section);
if (!$key) {
return $values;
}
return isset($values[$key]) ? $values[$key] : $default;
}
开发者ID:mesour,项目名称:laravel-bridges,代码行数:8,代码来源:Session.php
示例15: getuserfolder
function getuserfolder()
{
$session = new Session('demo');
if ($session->has('userfolder')) {
$value = $session->get('userfolder');
}
return $value;
}
开发者ID:thaigialai1987,项目名称:qlcv,代码行数:8,代码来源:myhelpers.php
示例16: add
/**
*
* Add a flash message to session.
*
* @param string $type Must be one of info, success, warning, error.
* @param string $message The flash message content.
* @param string $title The flash message title.
* @param array $options The custom options.
*
* @return void
*/
public function add($type, $message, $title = null, $options = [])
{
$types = ['error', 'info', 'success', 'warning'];
if (!in_array($type, $types)) {
throw new Exception("The {$type} remind message is not valid.");
}
$this->messages[] = ['type' => $type, 'title' => $title, 'message' => $message, 'options' => $options];
$this->session->flash('toastr::messages', $this->messages);
}
开发者ID:whossun,项目名称:laravel-toastr,代码行数:20,代码来源:Toastr.php
示例17: finishView
/**
* Adds a CSRF field to the root form view.
*
* @param FormView $view The form view
* @param FormInterface $form The form
* @param array $options The options
*/
public function finishView(FormView $view, FormInterface $form, array $options)
{
if (!$view->parent && $options['compound']) {
$token = $this->session->token();
$factory = $form->getConfig()->getFormFactory();
$csrfForm = $factory->createNamed('_token', 'hidden', $token, array('mapped' => false));
$view->children['_token'] = $csrfForm->createView(null);
}
}
开发者ID:seydu,项目名称:laravel-form-bridge,代码行数:16,代码来源:CsrfTypeExtension.php
示例18: add
/**
* Add notification.
*
* @param $type
* @param $message
* @param null $title
* @param array $options
*
* @return bool
*/
public function add($type, $message, $title = null, $options = [])
{
$types = ['info', 'warning', 'success', 'error'];
if (!in_array($type, $types)) {
return false;
}
$this->notifications[] = ['type' => $type, 'title' => $title, 'message' => $message, 'options' => $options];
$this->session->flash('toastr:notifications', $this->notifications);
}
开发者ID:yuansir,项目名称:toastr-for-laravel5,代码行数:19,代码来源:Toastr.php
示例19: getRecentAuthData
/**
* Allows you retrieve the most recent social provider
* authorized with.
*
* @return mixed
*/
public function getRecentAuthData()
{
$providers = $this->session->get('__sp_auth.p');
if (!$providers) {
return null;
}
return array_first($providers, function ($provider) {
return $provider === $this->session->get('__sp_auth.r');
});
}
开发者ID:morrelinko,项目名称:laravel5-socialplus,代码行数:16,代码来源:SocialPlus.php
示例20: usingCookieSessions
/**
* Determine if the session is using cookie sessions.
*
* @return bool
*/
protected function usingCookieSessions()
{
if (!$this->sessionConfigured()) {
return false;
}
return $this->manager->driver()->getHandler() instanceof CookieSessionHandler;
}
开发者ID:hramose,项目名称:Sistema-Control-de-Almacen,代码行数:12,代码来源:StartSession.php
注:本文中的Illuminate\Session\SessionManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论