本文整理汇总了PHP中Session::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::all方法的具体用法?PHP Session::all怎么用?PHP Session::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getExample
function getExample()
{
dump(\Auth::check());
dump(auth()->check());
dump(Auth::check());
dump(\Session::all());
dump(session()->all());
dump(Session::all());
}
示例2: boot
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
View::composer('*', function (\Illuminate\View\View $view) {
$view->with('session', \Session::all());
if (\Sentry::check()) {
$view->with('user', \Sentry::getUser());
}
});
}
示例3: __construct
public function __construct()
{
self::$items['GET'] = $_GET;
self::$items['POST'] = $_POST;
self::$items['REQUEST'] = $_REQUEST;
self::$items['SERVER'] = $_SERVER;
self::$items['GLOBALS'] = $GLOBALS;
self::$items['SESSION'] = Session::all();
self::$items['COOKIE'] = Cookie::all();
}
示例4: show
public function show()
{
if (Session::has('user')) {
$respuesta = json_encode(array("error" => false, 'message' => "Usuario autenticado", 'respuesta' => array(Session::all(), 200)));
} else {
$respuesta = json_encode(array("error" => true, 'message' => "Usuario no autenticado", 'respuesta' => array('', 404)));
}
$final_response = Response::make($respuesta, 200);
$final_response->header('Content-Type', "application/json; charset=utf-8");
return $final_response;
}
示例5: session
function session($get = false, $set = false)
{
if ($get) {
if ($set) {
return Session::set($get, $set);
} else {
return Session::get($get);
}
} else {
return Session::all();
}
}
示例6: sess
/**
* Return specified session data.
* Return all session if empty parameter.
*
* @param null $eleK
*
* @return mixed
*/
function sess($eleK = null)
{
if (empty($eleK)) {
return Session::all();
} else {
$ele = Session::get($eleK);
}
if (empty($ele)) {
return false;
} else {
return $ele;
}
}
示例7: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
echo '<pre>';
print_r(Session::all());
// $u = new User;
$u = User::find(1);
$u->first_name = 'Mohamed';
$u->last_name = 'J';
$u->email = 'moh8med@gmail.com';
$u->password = Hash::make('123456');
$u->level_access = 1;
$u->status = 1;
$u->user_key = str_random(32);
$u->save();
return 'Default Admin Controller.';
}
示例8: ajaxChangeCity
public function ajaxChangeCity()
{
$city_id = Input::get('city_id');
$response = ['status' => false, 'errorText' => ''];
$user_city_cache_key = self::$user_city_cache_key;
$user_city_cache_min = self::$user_city_cache_min;
if (is_numeric($city_id)) {
$city = Dic::valueBySlugAndId('city', $city_id, 'all');
if (is_object($city) && $city->id) {
Session::set($user_city_cache_key, $city->id);
setcookie('change_city', true, time() + 60 * $user_city_cache_min, '/');
$response['status'] = true;
$response['session'] = Session::all();
} else {
$response['errorText'] = 'wrong city_id';
}
} else {
$response['errorText'] = 'bad city_id';
}
return Response::json($response);
}
示例9: strtolower
<div class="container page-board page-auth-forms">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="content-popup @if($errors->any()) animated shake @endif">
<div class="popup-intro">
<h3>Dokończ rejestrację</h3>
<p>Potrzebujemy Twój E-mail</p>
</div>
{{ Form::open(array('url' => '/auth/login/complete', 'class' => 'form-auth')) }}
<?php
$session = Session::all();
?>
<input type="email" id="email" name="email" class="input-default @if ($errors->has('email'))has-error @endif" placeholder="Twój E-mail">
@if ($errors->has('email')) <p class="help-block">{{ $errors->first('email') }}</p> @endif
@if(strtolower($session['mmanos']['social']['pending']['provider']) == 'instagram')
<input type="hidden" name="provider" value="{{ strtolower($session['mmanos']['social']['pending']['provider']) }}">
<input type="hidden" name="provider_id" value="{{ $session['mmanos']['social']['pending']['provider_id'] }}">
<input type="hidden" name="first_name" value="{{ $session['mmanos']['social']['pending']['user_info']['first_name'] }}">
<input type="hidden" name="last_name" value="{{ $session['mmanos']['social']['pending']['user_info']['last_name'] }}">
<input type="hidden" name="access_token" value="{{ $session['mmanos']['social']['pending']['access_token']['token'] }}">
<input type="hidden" name="profile_picture" value="{{$session['mmanos']['social']['pending']['access_token']['extra_params']['user']['profile_picture']}}">
@elseif(strtolower($session['mmanos']['social']['pending']['provider']) == 'twitter')
<input type="hidden" name="provider" value="{{ strtolower($session['mmanos']['social']['pending']['provider']) }}">
<input type="hidden" name="provider_id" value="{{ $session['mmanos']['social']['pending']['provider_id'] }}">
<input type="hidden" name="first_name" value="{{ $session['mmanos']['social']['pending']['user_info']['first_name'] }}">
示例10: progress
/**
* For handle order step by step
*
* @return Redirect
*/
public function progress()
{
$order_session = Session::all();
$data_ret = [];
switch (Input::get('step')) {
case 'index':
Session::put('order.index', Input::only(['type', 'quantity_box', 'quantity_custom', 'quantity_item', 'description']));
break;
case 'schedule':
$delivery_date = Input::get('delivery_year') . '-' . Input::get('delivery_month') . '-' . Input::get('delivery_day');
if (!$this->_validateDateShouldLater($delivery_date)) {
return Redirect::back()->withMessages(['Delivery date should greater than today'])->withInput();
}
// if pickup immediaetly we pass this validation
if (Input::get('type') != 'immediately') {
$pickup_date = Input::get('pickup_year') . '-' . Input::get('pickup_month') . '-' . Input::get('pickup_day');
if (!$this->_validateDateShouldLater($pickup_date)) {
return Redirect::back()->withMessages(['Pickup date should greater than today'])->withInput();
}
}
Session::put('order.schedule', Input::only(['delivery_day', 'delivery_month', 'delivery_year', 'delivery_time', 'type', 'pickup_day', 'pickup_month', 'pickup_year', 'pickup_time']));
break;
case 'payment':
if (!Auth::check()) {
$userRepo = app('UserRepo');
if (Input::get('user_action') == 'signin') {
// if fails login redirect back with errors and input
if (!$userRepo->login(Input::get('credentials'))) {
return Redirect::back()->withMessages($userRepo->getErrors())->withInput();
}
} elseif (Input::get('user_action') == 'signup') {
// if fails register redirect back with errors and input
if (!$userRepo->register(Input::only(['firstname', 'lastname', 'email', 'phone', 'address', 'password']))) {
return Redirect::back()->withMessages($userRepo->getErrors())->withInput();
}
}
}
Session::put('order.payment', Input::only(['method', 'message']));
break;
case 'review':
# save space credit used
$space_credit = app('UserRepo')->getCustomerSpaceCredit();
$order_index = Session::get('order.index');
$total = calcPrice('box', $order_index['quantity_box']) + calcPrice('item', $order_index['quantity_item']);
if ($total > $space_credit) {
$data_ret['total'] = "Total : Rp. " . number_format($total - $space_credit, 0, ',', '.') . ',-';
$data_ret['space_credit_sisa'] = "Rp. " . number_format(0, 0, ',', '.') . ',-';
$data_ret['space_credit_used'] = "Rp. " . number_format($space_credit, 0, ',', '.') . ',-';
Session::put('order.space_credit_used', $space_credit);
} else {
$data_ret['total'] = "Total : Rp. " . number_format(0, 0, ',', '.') . ',-';
$data_ret['space_credit_sisa'] = "Rp. " . number_format($space_credit - $total, 0, ',', '.') . ',-';
$data_ret['space_credit_used'] = "Rp. " . number_format($total, 0, ',', '.') . ',-';
Session::put('order.space_credit_used', $total);
}
break;
}
if (Request::ajax()) {
return $data_ret;
} else {
$redirectTo = Input::get('redirect_to');
return Redirect::to($redirectTo);
}
}
示例11: deleteimages
public function deleteimages()
{
$removed_image = Input::get('removed_image');
//former name
$added_images = Session::all();
$added_image = Session::get($removed_image);
$new_file_name = $added_image['newfilename'];
$destinationPath = 'public/pb-uploads/pet_images/';
/*
TODO FOR THE IMAGE FILE
-----------------------
* Delete it from the /pet-image path
* Delete it from the session
*/
// delete from the folder
File::delete($destinationPath . $new_file_name);
// Deleted the image from the session.
Session::forget($removed_image);
}
示例12: function
<?php
if (Sentry::check()) {
$user = Sentry::getUser();
} else {
$user = null;
}
$guest = !Sentry::check();
View::composer('*', function ($view) use($user, $guest) {
$view->with('session', Session::all());
$view->with('guest', $guest);
$view->with('user', $user);
});
Route::get('/imprint', array('as' => 'imprint', 'uses' => 'HomeController@imprint'));
Route::get('/privacy', array('as' => 'privacy', 'uses' => 'HomeController@privacy'));
/**
* Account
*/
Route::get('/', array('as' => 'home', 'uses' => 'HomeController@index'));
Route::group(array(Config::get('app.forceSsl') ? 'https' : 'http'), function () {
Route::get('/login', array('as' => 'user.login', 'uses' => 'UserController@login'));
Route::post('/login', array('as' => 'user.do-login', 'uses' => 'UserController@doLogin', 'before' => 'csrf'));
Route::get('/login/github', array('as' => 'user.login.github', 'uses' => 'UserController@loginGithub'));
Route::post('/login/github', array('as' => 'user.login.github', 'uses' => 'UserController@loginGithub'));
Route::get('/register', array('as' => 'user.register', 'uses' => 'UserController@register'));
Route::post('/register', array('as' => 'user.do-register', 'uses' => 'UserController@doRegister', 'before' => 'csrf'));
Route::get('/activate/{code}', array('as' => 'user.activate', 'uses' => 'UserController@activate'))->where('code', '\\w+');
});
Route::group(array('before' => 'auth', Config::get('app.forceSsl') ? 'https' : 'http'), function () {
/**
* Users
示例13: print_session
/**
* Echo out the session.
*/
static function print_session()
{
static::debug(Session::all());
}
示例14: function
Route::get('/', 'PostsController@index');
// Route::get('/resume', 'HomeController@showResume');
Route::get('/portfolio', 'HomeController@showPortfolio');
// Route::get('/sayhello/{name}', function($name)
// {
// if ($name == "") {
// return Redirect::to('/');
// } else {
// $data = array('name' => $name);
// return View::make('my-first-view')->with($data);
// }
// });
Route::get('/posts', 'PostsController@index');
Route::resource('/posts', 'PostsController');
Route::get('/create', 'PostsController@create');
Route::get('/session/{value}', function ($value) {
Session::put('some-key', $value);
if (Session::has('some-key')) {
echo Session::get('some-key');
}
});
Route::get('/session', function () {
return Session::all();
});
Route::get('login', 'HomeController@getLogin');
Route::post('login', 'HomeController@postLogin');
Route::get('logout', 'HomeController@getLogout');
// Route::get('/orm-test', function(){
// $post = Post::find(2);
// dd($post);
// });
示例15: function
return View::make('user.user_login');
}
});
Route::get('/user/login/', function () {
return redirect('/');
});
Route::any('/user/', function () {
return redirect('/');
});
Route::any('/user/request_amendment', 'User\\DashboardController@request_amendment');
Route::get('user/dashboard', 'User\\DashboardController@index');
Route::post('user/time_entry', 'User\\DashboardController@time_entry');
Route::post('/user/login', 'User\\LoginController@authenticate');
Route::get('/logout', function () {
Auth::logout();
Session::flush();
return redirect('/');
});
Route::get('/user/logout/', function () {
return redirect('/logout');
});
Route::get('/client/logout/', function () {
return redirect('/logout');
});
Route::get('/testldap/', 'User\\DashboardController@testLdap');
Route::get('/client/', 'Client\\LoginController@index');
Route::post('/client/login', 'Client\\LoginController@authenticate');
Route::get('/client/dashboard', function () {
print_r(Session::all());
});
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);