本文整理汇总了PHP中OC\Files\Storage\Storage::hasUpdated方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::hasUpdated方法的具体用法?PHP Storage::hasUpdated怎么用?PHP Storage::hasUpdated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC\Files\Storage\Storage
的用法示例。
在下文中一共展示了Storage::hasUpdated方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkUpdate
/**
* check $path for updates
*
* @param string $path
*/
public function checkUpdate($path)
{
$cachedEntry = $this->cache->get($path);
if ($this->storage->hasUpdated($path, $cachedEntry['mtime'])) {
if ($this->storage->is_dir($path)) {
$this->scanner->scan($path, Scanner::SCAN_SHALLOW);
} else {
$this->scanner->scanFile($path);
}
if ($cachedEntry['mimetype'] === 'httpd/unix-directory') {
$this->cleanFolder($path);
}
$this->cache->correctFolderSize($path);
}
}
示例2: needsUpdate
/**
* Check if the cache for $path needs to be updated
*
* @param string $path
* @param ICacheEntry $cachedData
* @return bool
*/
public function needsUpdate($path, $cachedData)
{
if ($this->watchPolicy === self::CHECK_ALWAYS or $this->watchPolicy === self::CHECK_ONCE and array_search($path, $this->checkedPaths) === false) {
$this->checkedPaths[] = $path;
return $this->storage->hasUpdated($path, $cachedData['storage_mtime']);
}
return false;
}
示例3: checkUpdate
/**
* check $path for updates
*
* @param string $path
* @return boolean|array true if path was updated, otherwise the cached data is returned
*/
public function checkUpdate($path)
{
if ($this->watchPolicy === self::CHECK_ALWAYS or $this->watchPolicy === self::CHECK_ONCE and array_search($path, $this->checkedPaths) === false) {
$cachedEntry = $this->cache->get($path);
$this->checkedPaths[] = $path;
if ($this->storage->hasUpdated($path, $cachedEntry['storage_mtime'])) {
if ($this->storage->is_dir($path)) {
$this->scanner->scan($path, Scanner::SCAN_SHALLOW);
} else {
$this->scanner->scanFile($path);
}
if ($cachedEntry['mimetype'] === 'httpd/unix-directory') {
$this->cleanFolder($path);
}
$this->cache->correctFolderSize($path);
return true;
}
return $cachedEntry;
} else {
return false;
}
}
示例4: hasUpdated
/**
* check if a file or folder has been updated since $time
*
* @param string $path
* @param int $time
* @return bool
*
* hasUpdated for folders should return at least true if a file inside the folder is add, removed or renamed.
* returning true for other changes in the folder is optional
*/
public function hasUpdated($path, $time)
{
return $this->storage->hasUpdated($path, $time);
}