当前位置: 首页>>代码示例>>PHP>>正文


PHP FileBackend::preloadCache方法代码示例

本文整理汇总了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}'");
     }
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:31,代码来源:FileBackendTest.php

示例2: preloadCache

 public function preloadCache(array $paths)
 {
     $paths = $this->getBackendPaths($paths);
     $this->backend->preloadCache($paths);
 }
开发者ID:nanasess,项目名称:mediawiki,代码行数:5,代码来源:FileBackendDBRepoWrapper.php


注:本文中的FileBackend::preloadCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。