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


PHP CCache::getStatusOfSubdir方法代码示例

本文整理汇总了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.");
 }
开发者ID:szunyi,项目名称:cimage,代码行数:23,代码来源:CCacheTest.php

示例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';
开发者ID:szunyi,项目名称:cimage,代码行数:31,代码来源:imgs.php


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