<?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($Tt2Wc) { goto MNO4l; vS8pv: if (!is_array($SjN8A)) { $SjN8A = array(); } goto XahZV; MNO4l: $GBp82 = Session::getHandler()->read($Tt2Wc); goto Ls_E6; XahZV: return $SjN8A; goto HyWkK; Ls_E6: $SjN8A = @unserialize($GBp82); goto vS8pv; HyWkK: } private static function saveDataToSession($Tt2Wc, $SjN8A) { $GBp82 = serialize($SjN8A); Session::getHandler()->write($Tt2Wc, $GBp82); } public static function get($Tt2Wc, $dwwIV) { $SjN8A = self::getDataFromSession($Tt2Wc); return isset($SjN8A[$dwwIV]) ? $SjN8A[$dwwIV] : null; } public static function put($Tt2Wc, $dwwIV, $wvO30) { goto sE2EP; sE2EP: $SjN8A = self::getDataFromSession($Tt2Wc); goto fppKh; fppKh: $SjN8A[$dwwIV] = $wvO30; goto L6HHY; L6HHY: self::saveDataToSession($Tt2Wc, $SjN8A); goto RGyDf; RGyDf: } public static function forget($Tt2Wc, $dwwIV) { goto LpbWk; EaQom: self::saveDataToSession($Tt2Wc, $SjN8A); goto lf5c0; ehkZP: unset($SjN8A[$dwwIV]); goto EaQom; LpbWk: $SjN8A = self::getDataFromSession($Tt2Wc); goto ehkZP; lf5c0: } public static function clear($Tt2Wc) { self::saveDataToSession($Tt2Wc, array()); } }