当前位置: 首页>>代码示例>>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;未经允许,请勿转载。