sessionDataEncode() public static method

serialize and base64_encode of session data (If needed)
Deprecation:
Author: Naoki Sawada
public static sessionDataEncode ( mixed $var ) : mixed | string
$var mixed target variable
return mixed | string
コード例 #1
0
ファイル: elFinder.class.php プロジェクト: oblagiolabs/core
 /**
  * Save network volumes config.
  *
  * @param  array  $volumes  volumes config
  * @return void
  * @author Dmitry (dio) Levashov
  */
 protected function saveNetVolumes($volumes)
 {
     $_SESSION[$this->netVolumesSessionKey] = elFinder::sessionDataEncode($volumes);
 }
コード例 #2
0
 /**
  * Save network volumes config.
  *
  * @param  array  $volumes  volumes config
  * @return void
  * @author Dmitry (dio) Levashov
  */
 protected function saveNetVolumes($volumes)
 {
     // try session restart
     @session_start();
     $_SESSION[$this->netVolumesSessionKey] = elFinder::sessionDataEncode($volumes);
     elFinder::sessionWrite();
 }
コード例 #3
0
 /**
  * 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;
 }
コード例 #4
0
 /**
  * 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;
 }