本文整理汇总了PHP中CCache::getStatusOfSubdir方法的典型用法代码示例。如果您正苦于以下问题:PHP CCache::getStatusOfSubdir方法的具体用法?PHP CCache::getStatusOfSubdir怎么用?PHP CCache::getStatusOfSubdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCache
的用法示例。
在下文中一共展示了CCache::getStatusOfSubdir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateSubdir
/**
* Test
*
* @return void
*/
public function testCreateSubdir()
{
$cache = new CCache();
$cache->setDir(CACHE_PATH);
$subdir = "__test__";
$cache->removeSubdir($subdir);
$exp = "does not exist";
$res = $cache->getStatusOfSubdir($subdir, false);
$this->assertEquals($exp, $res, "Subdir should not be created.");
$res = $cache->getPathToSubdir($subdir);
$exp = realpath(CACHE_PATH . "/{$subdir}");
$this->assertEquals($exp, $res, "Subdir path missmatch.");
$exp = "exists, writable";
$res = $cache->getStatusOfSubdir($subdir);
$this->assertEquals($exp, $res, "Subdir should exist.");
$res = $cache->removeSubdir($subdir);
$this->assertTrue($res, "Remove subdir.");
}
示例2: verbose
if ($srgb || $srgbDefault) {
$filename = $img->convert2sRGBColorSpace($srcImage, $imagePath, $cache->getPathToSubdir("srgb"), $srgbColorProfile, $useCache);
if ($filename) {
$srcImage = $img->getTarget();
$imagePath = null;
verbose("srgb conversion and saved to cache = {$srcImage}");
} else {
verbose("srgb not op");
}
}
if ($status) {
$text = "img.php version = {$version}\n";
$text .= "PHP version = " . PHP_VERSION . "\n";
$text .= "Running on: " . $_SERVER['SERVER_SOFTWARE'] . "\n";
$text .= "Allow remote images = {$allowRemote}\n";
$res = $cache->getStatusOfSubdir("");
$text .= "Cache {$res}\n";
$res = $cache->getStatusOfSubdir("remote");
$text .= "Cache remote {$res}\n";
$res = $cache->getStatusOfSubdir("dummy");
$text .= "Cache dummy {$res}\n";
$res = $cache->getStatusOfSubdir("srgb");
$text .= "Cache srgb {$res}\n";
$text .= "Alias path writable = " . is_writable($aliasPath) . "\n";
$no = extension_loaded('exif') ? null : 'NOT';
$text .= "Extension exif is {$no} loaded.<br>";
$no = extension_loaded('curl') ? null : 'NOT';
$text .= "Extension curl is {$no} loaded.<br>";
$no = extension_loaded('imagick') ? null : 'NOT';
$text .= "Extension imagick is {$no} loaded.<br>";
$no = extension_loaded('gd') ? null : 'NOT';