本文整理汇总了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;
}
示例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);
}
}
示例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);
}