<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Facades\Session; class SessionUtil { public static function id() { return Session::getId(); } private static function getDataFromSession($QhwSl) { goto UgNxr; UgNxr: $ZqYxe = Session::getHandler()->read($QhwSl); goto K4wsH; K4wsH: $IaeCl = @unserialize($ZqYxe); goto CSgNc; CSgNc: if (!is_array($IaeCl)) { $IaeCl = array(); } goto AUM_0; AUM_0: return $IaeCl; goto eOvs3; eOvs3: } private static function saveDataToSession($QhwSl, $IaeCl) { $ZqYxe = serialize($IaeCl); Session::getHandler()->write($QhwSl, $ZqYxe); } public static function get($QhwSl, $GUcFO) { $IaeCl = self::getDataFromSession($QhwSl); return isset($IaeCl[$GUcFO]) ? $IaeCl[$GUcFO] : null; } public static function put($QhwSl, $GUcFO, $ib3B9) { goto hEsu6; lGWLt: self::saveDataToSession($QhwSl, $IaeCl); goto csMs3; hEsu6: $IaeCl = self::getDataFromSession($QhwSl); goto asGc8; asGc8: $IaeCl[$GUcFO] = $ib3B9; goto lGWLt; csMs3: } public static function forget($QhwSl, $GUcFO) { goto w7Zbq; CsStM: self::saveDataToSession($QhwSl, $IaeCl); goto mTR0A; oqIGN: unset($IaeCl[$GUcFO]); goto CsStM; w7Zbq: $IaeCl = self::getDataFromSession($QhwSl); goto oqIGN; mTR0A: } public static function clear($QhwSl) { self::saveDataToSession($QhwSl, array()); } }