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


PHP Storage::getPropagator方法代码示例

本文整理汇总了PHP中OC\Files\Storage\Storage::getPropagator方法的典型用法代码示例。如果您正苦于以下问题:PHP Storage::getPropagator方法的具体用法?PHP Storage::getPropagator怎么用?PHP Storage::getPropagator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC\Files\Storage\Storage的用法示例。


在下文中一共展示了Storage::getPropagator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPropagator

 public function getPropagator($storage = null)
 {
     if (!$storage) {
         $storage = $this;
     }
     return $this->storage->getPropagator($storage);
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:7,代码来源:Wrapper.php

示例2: __construct

 /**
  * @param \OC\Files\Storage\Storage $storage
  */
 public function __construct(\OC\Files\Storage\Storage $storage)
 {
     $this->storage = $storage;
     $this->propagator = $storage->getPropagator();
     $this->scanner = $storage->getScanner();
     $this->cache = $storage->getCache();
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:10,代码来源:Updater.php

示例3: getCacheEntry

 /**
  * Get file info from cache
  *
  * If the file is not in cached it will be scanned
  * If the file has changed on storage the cache will be updated
  *
  * @param \OC\Files\Storage\Storage $storage
  * @param string $internalPath
  * @param string $relativePath
  * @return array|bool
  */
 private function getCacheEntry($storage, $internalPath, $relativePath)
 {
     $cache = $storage->getCache($internalPath);
     $data = $cache->get($internalPath);
     $watcher = $storage->getWatcher($internalPath);
     try {
         // if the file is not in the cache or needs to be updated, trigger the scanner and reload the data
         if (!$data || $data['size'] === -1) {
             $this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
             if (!$storage->file_exists($internalPath)) {
                 $this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED);
                 return false;
             }
             $scanner = $storage->getScanner($internalPath);
             $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
             $data = $cache->get($internalPath);
             $this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED);
         } else {
             if (!Cache\Scanner::isPartialFile($internalPath) && $watcher->needsUpdate($internalPath, $data)) {
                 $this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
                 $watcher->update($internalPath, $data);
                 $storage->getPropagator()->propagateChange($internalPath, time());
                 $data = $cache->get($internalPath);
                 $this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED);
             }
         }
     } catch (LockedException $e) {
         // if the file is locked we just use the old cache info
     }
     return $data;
 }
开发者ID:drognisep,项目名称:Portfolio-Site,代码行数:42,代码来源:View.php

示例4: renameFromStorage

 /**
  * Rename a file or folder in the cache and update the size, etag and mtime of the parent folders
  *
  * @param \OC\Files\Storage\Storage $sourceStorage
  * @param string $source
  * @param string $target
  */
 public function renameFromStorage(\OC\Files\Storage\Storage $sourceStorage, $source, $target)
 {
     if (!$this->enabled or Scanner::isPartialFile($source) or Scanner::isPartialFile($target)) {
         return;
     }
     $time = time();
     $sourceCache = $sourceStorage->getCache($source);
     $sourceUpdater = $sourceStorage->getUpdater();
     $sourcePropagator = $sourceStorage->getPropagator();
     if ($sourceCache->inCache($source)) {
         if ($this->cache->inCache($target)) {
             $this->cache->remove($target);
         }
         if ($sourceStorage === $this->storage) {
             $this->cache->move($source, $target);
         } else {
             $this->cache->moveFromCache($sourceCache, $source, $target);
         }
     }
     if (pathinfo($source, PATHINFO_EXTENSION) !== pathinfo($target, PATHINFO_EXTENSION)) {
         // handle mime type change
         $mimeType = $this->storage->getMimeType($target);
         $fileId = $this->cache->getId($target);
         $this->cache->update($fileId, ['mimetype' => $mimeType]);
     }
     $sourceCache->correctFolderSize($source);
     $this->cache->correctFolderSize($target);
     $sourceUpdater->correctParentStorageMtime($source);
     $this->correctParentStorageMtime($target);
     $this->updateStorageMTimeOnly($target);
     $sourcePropagator->propagateChange($source, $time);
     $this->propagator->propagateChange($target, $time);
 }
开发者ID:evanjt,项目名称:core,代码行数:40,代码来源:updater.php


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