當前位置: 首頁>>代碼示例>>PHP>>正文


PHP RedirectToCachedFile函數代碼示例

本文整理匯總了PHP中RedirectToCachedFile函數的典型用法代碼示例。如果您正苦於以下問題:PHP RedirectToCachedFile函數的具體用法?PHP RedirectToCachedFile怎麽用?PHP RedirectToCachedFile使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了RedirectToCachedFile函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: header

if ($phpThumb->config_allow_parameter_file && $phpThumb->file) {
    $phpThumb->RenderToFile($phpThumb->ResolveFilenameToAbsolute($phpThumb->file));
    if ($phpThumb->config_allow_parameter_goto && $phpThumb->goto && preg_match('/^(f|ht)tps?\\:\\/\\//i', $phpThumb->goto)) {
        // redirect to another URL after image has been rendered to file
        header('Location: ' . $phpThumb->goto);
        exit;
    }
} elseif (@$PHPTHUMB_CONFIG['high_security_enabled'] && @$_GET['nocache']) {
    // cache disabled, don't write cachefile
} else {
    phpthumb_functions::EnsureDirectoryExists(dirname($phpThumb->cache_filename));
    if (@file_exists($phpThumb->cache_filename) && is_writable($phpThumb->cache_filename) || is_writable(dirname($phpThumb->cache_filename))) {
        $phpThumb->CleanUpCacheDirectory();
        if ($phpThumb->RenderToFile($phpThumb->cache_filename) && is_readable($phpThumb->cache_filename)) {
            chmod($phpThumb->cache_filename, 0644);
            RedirectToCachedFile();
        } else {
            $phpThumb->DebugMessage('Failed: RenderToFile(' . $phpThumb->cache_filename . ')', __FILE__, __LINE__);
        }
    } else {
        $phpThumb->DebugMessage('Cannot write to $phpThumb->cache_filename (' . $phpThumb->cache_filename . ') because that directory (' . dirname($phpThumb->cache_filename) . ') is not writable', __FILE__, __LINE__);
    }
}
////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
$phpThumb->DebugTimingMessage('phpThumbDebug[9]', __FILE__, __LINE__);
if (@$_GET['phpThumbDebug'] == '9') {
    $phpThumb->phpThumbDebug();
}
////////////////////////////////////////////////////////////////
if (!$phpThumb->OutputThumbnail()) {
開發者ID:CrazyBobik,項目名稱:allotaxi.test,代碼行數:31,代碼來源:phpThumb.php

示例2: chmod

////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
$phpThumb->DebugTimingMessage('phpThumbDebug[8]', __FILE__, __LINE__);
if (isset($_GET['phpThumbDebug']) && $_GET['phpThumbDebug'] == '8') {
    $phpThumb->phpThumbDebug();
}
////////////////////////////////////////////////////////////////
if (!empty($PHPTHUMB_CONFIG['high_security_enabled']) && !empty($_GET['nocache'])) {
    // cache disabled, don't write cachefile
} else {
    phpthumb_functions::EnsureDirectoryExists(dirname($phpThumb->cache_filename));
    if (is_writable(dirname($phpThumb->cache_filename)) || file_exists($phpThumb->cache_filename) && is_writable($phpThumb->cache_filename)) {
        $phpThumb->CleanUpCacheDirectory();
        if ($phpThumb->RenderToFile($phpThumb->cache_filename) && is_readable($phpThumb->cache_filename)) {
            chmod($phpThumb->cache_filename, 0644);
            RedirectToCachedFile($phpThumb, $PHPTHUMB_CONFIG);
        } else {
            $phpThumb->DebugMessage('Failed: RenderToFile(' . $phpThumb->cache_filename . ')', __FILE__, __LINE__);
        }
    } else {
        $phpThumb->DebugMessage('Cannot write to $phpThumb->cache_filename (' . $phpThumb->cache_filename . ') because that directory (' . dirname($phpThumb->cache_filename) . ') is not writable', __FILE__, __LINE__);
    }
}
////////////////////////////////////////////////////////////////
// Debug output, to try and help me diagnose problems
$phpThumb->DebugTimingMessage('phpThumbDebug[9]', __FILE__, __LINE__);
if (isset($_GET['phpThumbDebug']) && $_GET['phpThumbDebug'] == '9') {
    $phpThumb->phpThumbDebug();
}
////////////////////////////////////////////////////////////////
if (!$phpThumb->OutputThumbnail()) {
開發者ID:matteoantoci,項目名稱:phpthumb,代碼行數:31,代碼來源:phpThumb.php


注:本文中的RedirectToCachedFile函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。