本文整理汇总了PHP中elFinder::sessionWrite方法的典型用法代码示例。如果您正苦于以下问题:PHP elFinder::sessionWrite方法的具体用法?PHP elFinder::sessionWrite怎么用?PHP elFinder::sessionWrite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类elFinder
的用法示例。
在下文中一共展示了elFinder::sessionWrite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: localFileSystemInotify
/**
* Long pooling sync checker
* This function require server command `inotifywait`
* If `inotifywait` need full path, Please add `define('ELFINER_INOTIFYWAIT_PATH', '/PATH_TO/inotifywait');` into connector.php
*
* @param string $path
* @param int $standby
* @param number $compare
* @return number|bool
*/
public function localFileSystemInotify($path, $standby, $compare)
{
if (isset($this->sessionCache['localFileSystemInotify_disable'])) {
return false;
}
$path = realpath($path);
$mtime = filemtime($path);
if ($mtime != $compare) {
return $mtime;
}
$inotifywait = defined('ELFINER_INOTIFYWAIT_PATH') ? ELFINER_INOTIFYWAIT_PATH : 'inotifywait';
$path = escapeshellarg($path);
$standby = max(1, intval($standby));
$cmd = $inotifywait . ' ' . $path . ' -t ' . $standby . ' -e moved_to,moved_from,move,close_write,delete,delete_self';
$this->procExec($cmd, $o, $r);
if ($r === 0) {
// changed
clearstatcache();
$mtime = @filemtime($path);
// error on busy?
return $mtime ? $mtime : time();
} else {
if ($r === 2) {
// not changed (timeout)
return $compare;
}
}
// error
// cache to $_SESSION
$sessionStart = $this->sessionRestart();
if ($sessionStart) {
$this->sessionCache['localFileSystemInotify_disable'] = true;
elFinder::sessionWrite();
}
return false;
}
示例2: clearcache
/**
* Clean cache
*
* @return void
* @author Dmitry (dio) Levashov
**/
protected function clearcache()
{
$this->cache = $this->dirsCache = array();
$this->sessionRestart();
unset($this->sessionCache['rootstat'][md5($this->root)]);
elFinder::sessionWrite();
}
示例3: saveNetVolumes
/**
* 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();
}