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


PHP Storage::instanceOfStorage方法代码示例

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


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

示例1: scan

 /**
  * scan a folder and all it's children
  *
  * @param string $path
  * @param bool $recursive
  * @param int $reuse
  * @param bool $lock set to false to disable getting an additional read lock during scanning
  * @return array an array of the meta data of the scanned file or folder
  */
 public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true)
 {
     if ($reuse === -1) {
         $reuse = $recursive === self::SCAN_SHALLOW ? self::REUSE_ETAG | self::REUSE_SIZE : self::REUSE_ETAG;
     }
     if ($lock) {
         if ($this->storage->instanceOfStorage('\\OCP\\Files\\Storage\\ILockingStorage')) {
             $this->storage->acquireLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider);
         }
     }
     $data = $this->scanFile($path, $reuse, -1, null, $lock);
     if ($data and $data['mimetype'] === 'httpd/unix-directory') {
         $size = $this->scanChildren($path, $recursive, $reuse, $data, $lock);
         $data['size'] = $size;
     }
     if ($lock) {
         if ($this->storage->instanceOfStorage('\\OCP\\Files\\Storage\\ILockingStorage')) {
             $this->storage->releaseLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider);
         }
     }
     return $data;
 }
开发者ID:kenwi,项目名称:core,代码行数:31,代码来源:scanner.php

示例2: changeLock

 /**
  * @param string $path
  * @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
  * @param \OCP\Lock\ILockingProvider $provider
  */
 public function changeLock($path, $type, ILockingProvider $provider)
 {
     if ($this->storage->instanceOfStorage('\\OCP\\Files\\Storage\\ILockingStorage')) {
         $this->storage->changeLock($path, $type, $provider);
     }
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:11,代码来源:Wrapper.php

示例3: instanceOfStorage

 /**
  * Check if the storage is an instance of $class or is a wrapper for a storage that is an instance of $class
  *
  * @param string $class
  * @return bool
  */
 public function instanceOfStorage($class)
 {
     return is_a($this, $class) or $this->storage->instanceOfStorage($class);
 }
开发者ID:adolfo2103,项目名称:hcloudfilem,代码行数:10,代码来源:wrapper.php


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