当前位置: 首页>>代码示例>>PHP>>正文


PHP Storage::hasUpdated方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:20,代码来源:watcher.php

示例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;
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:15,代码来源:Watcher.php

示例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;
     }
 }
开发者ID:olucao,项目名称:owncloud-core,代码行数:28,代码来源:watcher.php

示例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);
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:14,代码来源:Wrapper.php


注:本文中的OC\Files\Storage\Storage::hasUpdated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。