本文整理汇总了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;
}
}