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


PHP phpThumb::setCacheDirectory方法代码示例

本文整理汇总了PHP中phpThumb::setCacheDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP phpThumb::setCacheDirectory方法的具体用法?PHP phpThumb::setCacheDirectory怎么用?PHP phpThumb::setCacheDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phpThumb的用法示例。


在下文中一共展示了phpThumb::setCacheDirectory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

echo '">' . $phpThumb->phpthumb_version;
echo '</th><td>' . $message . '.<br></td></tr>';
echo '<tr><th>phpThumb.config.php:</th><th colspan="2" bgcolor="';
if (file_exists('../phpThumb.config.php') && !file_exists('../phpThumb.config.php.default')) {
    echo 'lime">"phpThumb.config.php" exists and "phpThumb.config.php.default" does not';
} elseif (file_exists('../phpThumb.config.php') && file_exists('../phpThumb.config.php.default')) {
    echo 'yellow">"phpThumb.config.php" and "phpThumb.config.php.default" both exist';
} elseif (!file_exists('../phpThumb.config.php') && file_exists('../phpThumb.config.php.default')) {
    echo 'yellow">rename "phpThumb.config.php.default" to "phpThumb.config.php"';
} else {
    echo 'yellow">"phpThumb.config.php" not found (nor "phpThumb.config.php")';
}
echo '</th><td>"phpThumb.config.php.default" that comes in the distribution must be renamed to "phpThumb.config.php" before phpThumb.php can be used. Avoid having both files present to minimize confusion.</td></tr>';
echo '<tr><th>cache directory:</th><th colspan="2">';
$orig_config_cache_directory = $phpThumb->config_cache_directory;
$phpThumb->setCacheDirectory();
echo '<div style="background-color: ' . (is_dir($phpThumb->config_cache_directory) ? 'lime;">exists' : 'red;">does NOT exist') . '</div>';
echo '<div style="background-color: ' . (is_readable($phpThumb->config_cache_directory) ? 'lime;">readable' : 'red;">NOT readable') . '</div>';
echo '<div style="background-color: ' . (is_writable($phpThumb->config_cache_directory) ? 'lime;">writable' : 'red;">NOT writable') . '</div>';
echo '</th><td>Original: "' . htmlentities($orig_config_cache_directory) . '"<br>Resolved: "' . htmlentities($phpThumb->config_cache_directory) . '"<br>Must exist and be both readable and writable by PHP.</td></tr>';
echo '<tr><th>cache write test:</th><th colspan="2">';
$phpThumb->rawImageData = 'phpThumb.demo.check.php_cachetest';
$phpThumb->SetCacheFilename();
echo '<div>' . htmlentities($phpThumb->cache_filename ? implode(' / ', split('[/\\]', $phpThumb->cache_filename)) : 'NO CACHE FILENAME RESOLVED') . '</div>';
echo '<div>directory ' . (is_dir(dirname($phpThumb->cache_filename)) ? 'exists' : 'does NOT exist') . ' (before EnsureDirectoryExists())</div>';
phpthumb_functions::EnsureDirectoryExists(dirname($phpThumb->cache_filename));
echo '<div style="background-color: ' . (is_dir(dirname($phpThumb->cache_filename)) ? 'lime;">directory exists' : 'red;">directory does NOT exist') . ' (after EnsureDirectoryExists())</div>';
if ($fp = @fopen($phpThumb->cache_filename, 'wb')) {
    fwrite($fp, 'this is a test from ' . __FILE__);
    fclose($fp);
    echo '<div style="background-color: lime;">write test succeeded</div>';
开发者ID:jtresca,项目名称:nysurveyor,代码行数:31,代码来源:phpThumb.demo.check.php


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