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


PHP Filesystem::getMountByStorageId方法代码示例

本文整理汇总了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);
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:25,代码来源:backgroundwatcher.php

示例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;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:15,代码来源:util.php


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