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


PHP Storage::getStorageId方法代码示例

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


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

示例1: getFileInfo

 public static function getFileInfo($numericId, $path, $pharPath = null)
 {
     $storage = Storage::getStorageId($numericId);
     $config = \OC::$server->getConfig();
     $home = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/');
     $user = explode("::", $storage)[1];
     $urn = $home . '/' . $user . '/' . $path;
     if ($pharPath != null) {
         $urn = TarParser::PHAR_PROTOCOLE . $urn . $pharPath;
     }
     return array('urn' => $urn, 'user' => $user);
 }
开发者ID:ifremer,项目名称:snanny-owncloudapi,代码行数:12,代码来源:filecachedao.php

示例2: getById

 /**
  * get the storage id of the storage for a file and the internal path of the file
  * unlike getPathById this does not limit the search to files on this storage and
  * instead does a global search in the cache table
  *
  * @param int $id
  * @deprecated use getPathById() instead
  * @return array first element holding the storage id, second the path
  */
 public static function getById($id)
 {
     $connection = \OC::$server->getDatabaseConnection();
     $sql = 'SELECT `storage`, `path` FROM `*PREFIX*filecache` WHERE `fileid` = ?';
     $result = $connection->executeQuery($sql, array($id));
     if ($row = $result->fetch()) {
         $numericId = $row['storage'];
         $path = $row['path'];
     } else {
         return null;
     }
     if ($id = Storage::getStorageId($numericId)) {
         return array($id, $path);
     } else {
         return null;
     }
 }
开发者ID:sunblade,项目名称:core,代码行数:26,代码来源:cache.php

示例3: findByNumericId

 /**
  * Find mounts by numeric storage id
  *
  * @param int $id
  * @return MountPoint[]
  */
 public function findByNumericId($id)
 {
     $storageId = \OC\Files\Cache\Storage::getStorageId($id);
     return $this->findByStorageId($storageId);
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:11,代码来源:Manager.php

示例4: getById

 /**
  * get the storage id of the storage for a file and the internal path of the file
  * unlike getPathById this does not limit the search to files on this storage and
  * instead does a global search in the cache table
  *
  * @param int $id
  * @deprecated use getPathById() instead
  * @return array first element holding the storage id, second the path
  */
 public static function getById($id)
 {
     $sql = 'SELECT `storage`, `path` FROM `*PREFIX*filecache` WHERE `fileid` = ?';
     $result = \OC_DB::executeAudited($sql, array($id));
     if ($row = $result->fetchRow()) {
         $numericId = $row['storage'];
         $path = $row['path'];
     } else {
         return null;
     }
     if ($id = Storage::getStorageId($numericId)) {
         return array($id, $path);
     } else {
         return null;
     }
 }
开发者ID:rajeshpillai,项目名称:core,代码行数:25,代码来源:cache.php


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