本文整理汇总了PHP中FileBackend::getLocalReference方法的典型用法代码示例。如果您正苦于以下问题:PHP FileBackend::getLocalReference方法的具体用法?PHP FileBackend::getLocalReference怎么用?PHP FileBackend::getLocalReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileBackend
的用法示例。
在下文中一共展示了FileBackend::getLocalReference方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFileSha1
/**
* Get the sha1 of a file with a given virtual URL/storage path
*
* @param $virtualUrl string
* @return string|false
*/
public function getFileSha1($virtualUrl)
{
$path = $this->resolveToStoragePath($virtualUrl);
$tmpFile = $this->backend->getLocalReference(array('src' => $path));
if (!$tmpFile) {
return false;
}
return $tmpFile->getSha1Base36();
}
示例2: doTestGetLocalCopyAndReference404
public function doTestGetLocalCopyAndReference404()
{
$backendName = $this->backendClass();
$base = self::baseStorePath();
$tmpFile = $this->backend->getLocalCopy(array('src' => "{$base}/unittest-cont1/not-there"));
$this->assertEquals(null, $tmpFile, "Local copy of not existing file is null ({$backendName}).");
$tmpFile = $this->backend->getLocalReference(array('src' => "{$base}/unittest-cont1/not-there"));
$this->assertEquals(null, $tmpFile, "Local ref of not existing file is null ({$backendName}).");
}
示例3: getLocalReference
/**
* Get a local FS file with a given virtual URL/storage path.
* The file is either an original or a copy. It should not be changed.
* Temporary files may be purged when the file object falls out of scope.
*
* @param string $virtualUrl
* @return FSFile|null Returns null on failure.
*/
public function getLocalReference($virtualUrl)
{
$path = $this->resolveToStoragePath($virtualUrl);
return $this->backend->getLocalReference(array('src' => $path));
}