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