本文整理汇总了PHP中OC\Files\Filesystem::getMountByStorageId方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::getMountByStorageId方法的具体用法?PHP Filesystem::getMountByStorageId怎么用?PHP Filesystem::getMountByStorageId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC\Files\Filesystem
的用法示例。
在下文中一共展示了Filesystem::getMountByStorageId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkUpdate
private static function checkUpdate($id)
{
$cacheItem = Cache::getById($id);
if (is_null($cacheItem)) {
return;
}
list($storageId, $internalPath) = $cacheItem;
$mounts = Filesystem::getMountByStorageId($storageId);
if (count($mounts) === 0) {
//if the storage we need isn't mounted on default, try to find a user that has access to the storage
$permissionsCache = new Permissions($storageId);
$users = $permissionsCache->getUsers($id);
if (count($users) === 0) {
return;
}
Filesystem::initMountPoints($users[0]);
$mounts = Filesystem::getMountByStorageId($storageId);
if (count($mounts) === 0) {
return;
}
}
$storage = $mounts[0]->getStorage();
$watcher = new Watcher($storage);
$watcher->checkUpdate($internalPath);
}
示例2: getPathWithMountPoint
/**
* Get the path including the storage mount point
* @param int $id
* @return string the path including the mount point like AmazonS3/folder/file.txt
*/
public function getPathWithMountPoint($id)
{
list($storage, $internalPath) = \OC\Files\Cache\Cache::getById($id);
$mount = \OC\Files\Filesystem::getMountByStorageId($storage);
$mountPoint = $mount[0]->getMountPoint();
$path = \OC\Files\Filesystem::normalizePath($mountPoint . '/' . $internalPath);
// reformat the path to be relative e.g. /user/files/folder becomes /folder/
$relativePath = \OCA\Encryption\Helper::stripUserFilesPath($path);
return $relativePath;
}