本文整理汇总了PHP中Illuminate\Support\Facades\Session::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::all方法的具体用法?PHP Session::all怎么用?PHP Session::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Session
的用法示例。
在下文中一共展示了Session::all方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getExceptionData
private function getExceptionData($exception)
{
$data = [];
$data['host'] = Request::server('HTTP_HOST');
$data['method'] = Request::method();
$data['fullUrl'] = Request::fullUrl();
if (php_sapi_name() === 'cli') {
$data['host'] = parse_url(config('app.url'), PHP_URL_HOST);
$data['method'] = 'CLI';
}
$data['exception'] = $exception->getMessage();
$data['error'] = $exception->getTraceAsString();
$data['line'] = $exception->getLine();
$data['file'] = $exception->getFile();
$data['class'] = get_class($exception);
$data['storage'] = array('SERVER' => Request::server(), 'GET' => Request::query(), 'POST' => $_POST, 'FILE' => Request::file(), 'OLD' => Request::hasSession() ? Request::old() : [], 'COOKIE' => Request::cookie(), 'SESSION' => Request::hasSession() ? Session::all() : [], 'HEADERS' => Request::header());
$data['storage'] = array_filter($data['storage']);
$count = $this->config['count'];
$data['exegutor'] = [];
$data['file_lines'] = [];
$file = new SplFileObject($data['file']);
for ($i = -1 * abs($count); $i <= abs($count); $i++) {
list($line, $exegutorLine) = $this->getLineInfo($file, $data['line'], $i);
$data['exegutor'][] = $exegutorLine;
$data['file_lines'][$data['line'] + $i] = $line;
}
// to make Symfony exception more readable
if ($data['class'] == 'Symfony\\Component\\Debug\\Exception\\FatalErrorException') {
preg_match("~^(.+)' in ~", $data['exception'], $matches);
if (isset($matches[1])) {
$data['exception'] = $matches[1];
}
}
return $data;
}
示例2: new_page
public function new_page()
{
$first = 'Aarooran';
$last = 'Kanthasamy';
// Session::put('key',$first);
dd(Session::all());
return view('check');
}
示例3: store
public function store($id)
{
$game = $this->gameRepository->getWithId($id);
Session::put($game->id, $game);
//session()->get('');
// ::has('') ::get('') ::all()
$games = Session::all();
return view('pages.cart', compact('games'));
}
示例4: postPayment
public function postPayment()
{
$payer = new Payer();
$payer->setPaymentMethod('paypal');
$item_1 = new Item();
$item_1->setName('Item 1')->setCurrency('USD')->setQuantity(2)->setPrice('150');
// unit price
$item_2 = new Item();
$item_2->setName('Item 2')->setCurrency('USD')->setQuantity(4)->setPrice('70');
$item_3 = new Item();
$item_3->setName('Item 3')->setCurrency('USD')->setQuantity(1)->setPrice('20');
// add item to list
$item_list = new ItemList();
$item_list->setItems(array($item_1, $item_2, $item_3));
$amount = new Amount();
$amount->setCurrency('USD')->setTotal(580);
$transaction = new Transaction();
$transaction->setAmount($amount)->setItemList($item_list)->setDescription('Your transaction description');
$redirect_urls = new RedirectUrls();
$redirect_urls->setReturnUrl(URL::route('payment.status'))->setCancelUrl(URL::route('payment.status'));
$payment = new Payment();
$payment->setIntent('Sale')->setPayer($payer)->setRedirectUrls($redirect_urls)->setTransactions(array($transaction));
try {
$payment->create($this->_api_context);
// echo'hello';
// print_r($test);die;
} catch (\PayPal\Exception\PPConnectionException $ex) {
if (\Config::get('app.debug')) {
echo "Exception: " . $ex->getMessage() . PHP_EOL;
$err_data = json_decode($ex->getData(), true);
exit;
} else {
die('Some error occur, sorry for inconvenient');
}
}
if (is_array($payment->getLinks()) || is_object($payment->getLinks())) {
foreach ($payment->getLinks() as $link) {
echo 'reached';
if ($link->getRel() == 'approval_url') {
$redirect_url = $link->getHref();
break;
}
}
}
// add payment ID to session
Session::put('paypal_payment_id', $payment->getId());
dd(Session::all());
if (isset($redirect_url)) {
// redirect to paypal
return Redirect::away($redirect_url);
}
return Redirect::route('original.route')->with('error', 'Unknown error occurred');
}
示例5: logRequest
/**
* Logs an API request
*
* @param \Illuminate\Http\Request $request The request
* @param array $sessionData User session data, if any
*
* @return bool
*/
public function logRequest(Request $request, $sessionData = [])
{
try {
// Get some session data if none given, then remove any unmentionables...
if (empty($sessionData) || !is_array($sessionData)) {
/** @noinspection PhpUndefinedMethodInspection */
$sessionData = Session::all();
}
array_forget($sessionData, ['_token', 'token', 'api_key', 'session_token', 'metadata']);
$_cluster = Cluster::service();
// Add in stuff for API request logging
$this->log(['dfe' => $this->prepareMetadata($_cluster->getInstanceName(), $request, $_cluster->getConfig('audit', [])), 'user' => $sessionData], AuditLevels::INFO, $request, $_cluster->getClusterId());
} catch (\Exception $_ex) {
// Completely ignore any issues
}
}
示例6: register
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->after(function ($request, $response) {
$session = Session::all();
unset($session['_token']);
$empty_flash = true;
if (isset($session['flash'])) {
if (is_array($session['flash']['old']) && count($session['flash']['old']) > 0) {
$empty_flash = false;
}
if (is_array($session['flash']['new']) && count($session['flash']['new']) > 0) {
$empty_flash = false;
}
}
if ($empty_flash) {
unset($session['flash']);
}
if (count($session) >= 1) {
return;
}
$response->headers->set('X-No-Session', 'yeah');
});
}
示例7: session_all
public function session_all()
{
$value = Session::all();
return $value;
}
示例8: doCreateField
protected function doCreateField($table_name, $field_name)
{
$field_bd = $this->getAttribute('field');
$data = Session::all();
if (!Session::has($table_name . '.' . $field_name)) {
if ($field_bd && !Schema::hasColumn($table_name, $field_name)) {
Session::push($table_name . '.' . $field_name, 'created');
@(list($field, $param) = explode("|", $field_bd));
Schema::table($table_name, function ($table) use($field_name, $field, $param) {
$field_add = $table->{$field}($field_name);
if ($param) {
$field_add->length($param);
}
});
} else {
Session::push($table_name . '.' . $field_name, 'created');
}
}
}
示例9: seesess
public function seesess()
{
return dd(Session::all());
}
示例10: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(Request $request)
{
dd($request->all());
Session::put('fname', 'hasha');
dd(Session::all());
}
示例11: getAll
/**
* Get all key-value pairs from storage.
*
* @return array
*/
public function getAll()
{
return Session::all();
}
示例12: assertSessionHasNoFlashData
protected function assertSessionHasNoFlashData()
{
$all_session = Session::all();
$this->assertFalse(isset($all_session['flash']));
}
示例13: dump
public function dump()
{
dd(Session::all());
}