當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。