sessionDataDecode() публичный статический Метод

base64_decode and unserialize of session data (If needed)
Устаревший:
Автор: Naoki Sawada
public static sessionDataDecode ( mixed &$var, boolean $checkIs = null ) : boolean | mixed
$var mixed target variable
$checkIs boolean data type for check (array|string|object|int)
Результат boolean | mixed
 /**
  * Return fileinfo 
  *
  * @param  string  $path  file cache
  * @return array
  * @author Dmitry (dio) Levashov
  **/
 protected function stat($path)
 {
     if ($path === false || is_null($path)) {
         return false;
     }
     $is_root = $path == $this->root;
     if ($is_root) {
         $rootKey = md5($path);
         if (!isset($this->sessionCache['rootstat'])) {
             $this->sessionCache['rootstat'] = array();
         }
         if (!$this->isMyReload()) {
             // need $path as key for netmount/netunmount
             if (isset($this->sessionCache['rootstat'][$rootKey])) {
                 if ($ret = elFinder::sessionDataDecode($this->sessionCache['rootstat'][$rootKey], 'array')) {
                     return $ret;
                 }
             }
         }
     }
     $ret = isset($this->cache[$path]) ? $this->cache[$path] : $this->updateCache($path, $this->convEncOut($this->_stat($this->convEncIn($path))));
     if ($is_root) {
         $this->sessionRestart();
         $this->sessionCache['rootstat'][$rootKey] = elFinder::sessionDataEncode($ret);
         elFinder::sessionWrite();
     }
     return $ret;
 }
Пример #2
0
 /**
  * Return network volumes config.
  *
  * @return array
  * @author Dmitry (dio) Levashov
  */
 protected function getNetVolumes()
 {
     if (isset($_SESSION[$this->netVolumesSessionKey])) {
         if ($data = elFinder::sessionDataDecode($_SESSION[$this->netVolumesSessionKey], 'array')) {
             return $data;
         }
     }
     return array();
 }
 /**
  * Return fileinfo
  *
  * @param  string  $path  file cache
  * @return array
  * @author Dmitry (dio) Levashov
  **/
 protected function stat($path)
 {
     if ($path === false || is_null($path)) {
         return false;
     }
     $is_root = $path === $this->root;
     if ($is_root) {
         $rootKey = md5($path);
         if (!isset($this->sessionCache['rootstat'])) {
             $this->sessionCache['rootstat'] = array();
         }
         if (empty($this->ARGS['reload']) || empty($this->ARGS['target']) || strpos($this->ARGS['target'], $this->id) !== 0) {
             // need $path as key for netmount/netunmount
             if (isset($this->sessionCache['rootstat'][$rootKey])) {
                 if ($ret = elFinder::sessionDataDecode($this->sessionCache['rootstat'][$rootKey], 'array')) {
                     return $ret;
                 }
             }
         }
     }
     $ret = isset($this->cache[$path]) ? $this->cache[$path] : $this->updateCache($path, $this->convEncOut($this->_stat($this->convEncIn($path))));
     if ($is_root) {
         $this->sessionCache['rootstat'][$rootKey] = elFinder::sessionDataEncode($ret);
     }
     return $ret;
 }