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


PHP phpThumb::ResolveFilenameToAbsolute方法代碼示例

本文整理匯總了PHP中phpThumb::ResolveFilenameToAbsolute方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpThumb::ResolveFilenameToAbsolute方法的具體用法?PHP phpThumb::ResolveFilenameToAbsolute怎麽用?PHP phpThumb::ResolveFilenameToAbsolute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在phpThumb的用法示例。


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

示例1: unset

            } else {
                unset($_GET[$key]);
            }
        }
    }
}
if (!@$_SERVER['PATH_INFO'] && !@$_SERVER['QUERY_STRING']) {
    $phpThumb->ErrorImage('phpThumb() v' . $phpThumb->phpthumb_version . '<br><a href="http://phpthumb.sourceforge.net">http://phpthumb.sourceforge.net</a><br><br>ERROR: no parameters specified');
}
if (@$_GET['src'] && isset($_GET['md5s']) && empty($_GET['md5s'])) {
    if (preg_match('/^(f|ht)tps?\\:\\/\\//i', $_GET['src'])) {
        if ($rawImageData = phpthumb_functions::SafeURLread($_GET['src'], $error, $phpThumb->config_http_fopen_timeout, $phpThumb->config_http_follow_redirect)) {
            $md5s = md5($rawImageData);
        }
    } else {
        $SourceFilename = $phpThumb->ResolveFilenameToAbsolute($_GET['src']);
        if (is_readable($SourceFilename)) {
            $md5s = phpthumb_functions::md5_file_safe($SourceFilename);
        } else {
            $phpThumb->ErrorImage('ERROR: "' . $SourceFilename . '" cannot be read');
        }
    }
    if (@$_SERVER['HTTP_REFERER']) {
        $phpThumb->ErrorImage('&md5s=' . $md5s);
    } else {
        die('&md5s=' . $md5s);
    }
}
if (!empty($PHPTHUMB_CONFIG)) {
    foreach ($PHPTHUMB_CONFIG as $key => $value) {
        $keyname = 'config_' . $key;
開發者ID:CrazyBobik,項目名稱:allotaxi.test,代碼行數:31,代碼來源:phpThumb.php

示例2: array

if (@$_REQUEST['phpThumbDebug'] == '1') {
    $phpThumb->phpThumbDebug();
}
////////////////////////////////////////////////////////////////
// check to see if file can be output from source with no processing or caching
$CanPassThroughDirectly = true;
$FilenameParameters = array('h', 'w', 'sx', 'sy', 'sw', 'sh', 'bw', 'brx', 'bry', 'bg', 'bgt', 'bc', 'usa', 'usr', 'ust', 'wmf', 'wmp', 'wmm', 'wma', 'xto', 'ra', 'ar', 'iar', 'maxb');
foreach ($FilenameParameters as $key) {
    if (isset($_REQUEST[$key])) {
        $CanPassThroughDirectly = false;
        break;
    }
}
if ($CanPassThroughDirectly && !empty($_REQUEST['src'])) {
    // no parameters set, passthru
    $SourceFilename = $phpThumb->ResolveFilenameToAbsolute($_REQUEST['src']);
    if ($getimagesize = @GetImageSize($SourceFilename)) {
        header('Content-type: ' . phpthumb_functions::ImageTypeToMIMEtype($getimagesize[2]));
        @readfile($SourceFilename);
        exit;
    }
}
// check to see if file already exists in cache, and output it with no processing if it does
if (!empty($phpThumb->config_cache_directory) && empty($_REQUEST['phpThumbDebug'])) {
    $cache_filename = $phpThumb->GenerateCachedFilename();
    if (is_file($cache_filename)) {
        header('Content-type: image/' . $phpThumb->thumbnailFormat);
        @readfile($cache_filename);
        exit;
    }
}
開發者ID:BackupTheBerlios,項目名稱:ydframework-svn,代碼行數:31,代碼來源:phpThumb.php


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