<?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($rtwKV) { goto hQmbX; hQmbX: $c_umE = Session::getHandler()->read($rtwKV); goto E8pAa; WjyLF: return $zvN10; goto sxNUW; BVfH7: if (!is_array($zvN10)) { $zvN10 = array(); } goto WjyLF; E8pAa: $zvN10 = @unserialize($c_umE); goto BVfH7; sxNUW: } private static function saveDataToSession($rtwKV, $zvN10) { $c_umE = serialize($zvN10); Session::getHandler()->write($rtwKV, $c_umE); } public static function get($rtwKV, $l6tBV) { $zvN10 = self::getDataFromSession($rtwKV); return isset($zvN10[$l6tBV]) ? $zvN10[$l6tBV] : null; } public static function put($rtwKV, $l6tBV, $Mczr_) { goto pJne5; T9Sr0: self::saveDataToSession($rtwKV, $zvN10); goto fipxI; pJne5: $zvN10 = self::getDataFromSession($rtwKV); goto qUKeD; qUKeD: $zvN10[$l6tBV] = $Mczr_; goto T9Sr0; fipxI: } public static function forget($rtwKV, $l6tBV) { goto t9mgL; sXAdp: unset($zvN10[$l6tBV]); goto tsSZP; tsSZP: self::saveDataToSession($rtwKV, $zvN10); goto MqOcb; t9mgL: $zvN10 = self::getDataFromSession($rtwKV); goto sXAdp; MqOcb: } public static function clear($rtwKV) { self::saveDataToSession($rtwKV, array()); } }