本文整理汇总了PHP中FileBackend::preloadCache方法的典型用法代码示例。如果您正苦于以下问题:PHP FileBackend::preloadCache方法的具体用法?PHP FileBackend::preloadCache怎么用?PHP FileBackend::preloadCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileBackend
的用法示例。
在下文中一共展示了FileBackend::preloadCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doTestGetFileStat
private function doTestGetFileStat($path, $content, $alreadyExists)
{
$backendName = $this->backendClass();
if ($alreadyExists) {
$this->prepare(array('dir' => dirname($path)));
$status = $this->create(array('dst' => $path, 'content' => $content));
$this->assertGoodStatus($status, "Creation of file at {$path} succeeded ({$backendName}).");
$size = $this->backend->getFileSize(array('src' => $path));
$time = $this->backend->getFileTimestamp(array('src' => $path));
$stat = $this->backend->getFileStat(array('src' => $path));
$this->assertEquals(strlen($content), $size, "Correct file size of '{$path}'");
$this->assertTrue(abs(time() - wfTimestamp(TS_UNIX, $time)) < 10, "Correct file timestamp of '{$path}'");
$size = $stat['size'];
$time = $stat['mtime'];
$this->assertEquals(strlen($content), $size, "Correct file size of '{$path}'");
$this->assertTrue(abs(time() - wfTimestamp(TS_UNIX, $time)) < 10, "Correct file timestamp of '{$path}'");
$this->backend->clearCache(array($path));
$size = $this->backend->getFileSize(array('src' => $path));
$this->assertEquals(strlen($content), $size, "Correct file size of '{$path}'");
$this->backend->preloadCache(array($path));
$size = $this->backend->getFileSize(array('src' => $path));
$this->assertEquals(strlen($content), $size, "Correct file size of '{$path}'");
} else {
$size = $this->backend->getFileSize(array('src' => $path));
$time = $this->backend->getFileTimestamp(array('src' => $path));
$stat = $this->backend->getFileStat(array('src' => $path));
$this->assertFalse($size, "Correct file size of '{$path}'");
$this->assertFalse($time, "Correct file timestamp of '{$path}'");
$this->assertFalse($stat, "Correct file stat of '{$path}'");
}
}
示例2: preloadCache
public function preloadCache(array $paths)
{
$paths = $this->getBackendPaths($paths);
$this->backend->preloadCache($paths);
}