<?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($nbDxJ) { goto BFPl4; BFPl4: $tF92x = Session::getHandler()->read($nbDxJ); goto H4mAG; G5Q27: return $dTnlu; goto f4syG; kxn65: if (!is_array($dTnlu)) { $dTnlu = array(); } goto G5Q27; H4mAG: $dTnlu = @unserialize($tF92x); goto kxn65; f4syG: } private static function saveDataToSession($nbDxJ, $dTnlu) { $tF92x = serialize($dTnlu); Session::getHandler()->write($nbDxJ, $tF92x); } public static function get($nbDxJ, $oMJcb) { $dTnlu = self::getDataFromSession($nbDxJ); return isset($dTnlu[$oMJcb]) ? $dTnlu[$oMJcb] : null; } public static function put($nbDxJ, $oMJcb, $cBDsM) { goto c3TMG; c3TMG: $dTnlu = self::getDataFromSession($nbDxJ); goto wkulw; wkulw: $dTnlu[$oMJcb] = $cBDsM; goto l3yCM; l3yCM: self::saveDataToSession($nbDxJ, $dTnlu); goto jiRA_; jiRA_: } public static function forget($nbDxJ, $oMJcb) { goto HQ52N; HQ52N: $dTnlu = self::getDataFromSession($nbDxJ); goto WxjUC; x4WXr: self::saveDataToSession($nbDxJ, $dTnlu); goto DRl4e; WxjUC: unset($dTnlu[$oMJcb]); goto x4WXr; DRl4e: } public static function clear($nbDxJ) { self::saveDataToSession($nbDxJ, array()); } }