本文整理汇总了PHP中FileBackend::getLocalCopy方法的典型用法代码示例。如果您正苦于以下问题:PHP FileBackend::getLocalCopy方法的具体用法?PHP FileBackend::getLocalCopy怎么用?PHP FileBackend::getLocalCopy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileBackend
的用法示例。
在下文中一共展示了FileBackend::getLocalCopy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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}).");
}
示例2: getLocalCopy
/**
* Get a local FS copy of a file with a given virtual URL/storage path.
* Temporary files may be purged when the file object falls out of scope.
*
* @param $virtualUrl string
* @return TempFSFile|null Returns null on failure
*/
public function getLocalCopy($virtualUrl)
{
$path = $this->resolveToStoragePath($virtualUrl);
return $this->backend->getLocalCopy(array('src' => $path));
}