/** * 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."); }
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';