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


PHP timthumb::tryServerCache方法代碼示例

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


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

示例1: start

 /**
  * timthumb::start()
  * 
  * @return
  */
 public static function start()
 {
     $tim = new timthumb();
     $tim->handleErrors();
     $tim->securityChecks();
     if ($tim->tryBrowserCache()) {
         exit(0);
     }
     $tim->handleErrors();
     if (FILE_CACHE_ENABLED && $tim->tryServerCache()) {
         exit(0);
     }
     $tim->handleErrors();
     $tim->run();
     $tim->handleErrors();
     exit(0);
 }
開發者ID:guyt101z,項目名稱:MembershipMan,代碼行數:22,代碼來源:thumbmaker.php

示例2: start

 public static function start($param_array)
 {
     self::$param_array = $param_array;
     $tim = new timthumb();
     $tim->handleErrors();
     $tim->securityChecks();
     if ($tim->tryBrowserCache()) {
         return $tim->cachefile;
         //exit(0);
     }
     $tim->handleErrors();
     if (FILE_CACHE_ENABLED && $tim->tryServerCache()) {
         return $tim->cachefile;
         //exit(0);
     }
     $tim->handleErrors();
     $tim->run();
     $tim->handleErrors();
     return $tim->cachefile;
     //exit(0);
 }
開發者ID:vstorm83,項目名稱:propertease,代碼行數:21,代碼來源:timthumb.php

示例3: start

 /**
  * @param array $options
  */
 public static function start(array $options = null)
 {
     //Image fetching and caching
     if (!defined('FILE_CACHE_TIME_BETWEEN_CLEANS')) {
         define('FILE_CACHE_TIME_BETWEEN_CLEANS', 86400);
     }
     // How often the cache is cleaned
     if (!defined('FILE_CACHE_MAX_FILE_AGE')) {
         define('FILE_CACHE_MAX_FILE_AGE', 86400);
     }
     // How old does a file have to be to be deleted from the cache
     if (!defined('FILE_CACHE_SUFFIX')) {
         define('FILE_CACHE_SUFFIX', '.timthumb.txt');
     }
     // What to put at the end of all files in the cache directory so we can identify them
     if (!defined('FILE_CACHE_PREFIX')) {
         define('FILE_CACHE_PREFIX', 'timthumb');
     }
     // What to put at the beg of all files in the cache directory so we can identify them
     if (!defined('MAX_FILE_SIZE')) {
         define('MAX_FILE_SIZE', 10485760);
     }
     // 10 Megs is 10485760. This is the max internal or external file size that we'll process.
     if (!defined('CURL_TIMEOUT')) {
         define('CURL_TIMEOUT', 20);
     }
     // Timeout duration for Curl. This only applies if you have Curl installed and aren't using PHP's default URL fetching mechanism.
     if (!defined('WAIT_BETWEEN_FETCH_ERRORS')) {
         define('WAIT_BETWEEN_FETCH_ERRORS', 3600);
     }
     // Time to wait between errors fetching remote file
     //Browser caching
     if (!defined('BROWSER_CACHE_MAX_AGE')) {
         define('BROWSER_CACHE_MAX_AGE', 864000);
     }
     // Time to cache in the browser
     if (!defined('BROWSER_CACHE_DISABLE')) {
         define('BROWSER_CACHE_DISABLE', false);
     }
     // Use for testing if you want to disable all browser caching
     //Image size and defaults
     if (!defined('NOT_FOUND_IMAGE')) {
         define('NOT_FOUND_IMAGE', '');
     }
     // Image to serve if any 404 occurs
     if (!defined('ERROR_IMAGE')) {
         define('ERROR_IMAGE', '');
     }
     // Image to serve if an error occurs instead of showing error message
     if (!defined('PNG_IS_TRANSPARENT')) {
         define('PNG_IS_TRANSPARENT', FALSE);
     }
     // Define if a png image should have a transparent background color. Use False value if you want to display a custom coloured canvas_colour
     //Image compression is enabled if either of these point to valid paths
     //These are now disabled by default because the file sizes of PNGs (and GIFs) are much smaller than we used to generate.
     //They only work for PNGs. GIFs and JPEGs are not affected.
     if (!defined('OPTIPNG_ENABLED')) {
         define('OPTIPNG_ENABLED', false);
     }
     if (!defined('OPTIPNG_PATH')) {
         define('OPTIPNG_PATH', '/usr/bin/optipng');
     }
     //This will run first because it gives better compression than pngcrush.
     if (!defined('PNGCRUSH_ENABLED')) {
         define('PNGCRUSH_ENABLED', false);
     }
     if (!defined('PNGCRUSH_PATH')) {
         define('PNGCRUSH_PATH', '/usr/bin/pngcrush');
     }
     //This will only run if OPTIPNG_PATH is not set or is not valid
     $tim = new timthumb($options);
     $tim->handleErrors();
     $tim->securityChecks();
     if ($tim->tryBrowserCache()) {
         exit(0);
     }
     $tim->handleErrors();
     if (static::$options['file_cache_enabled'] && $tim->tryServerCache()) {
         exit(0);
     }
     $tim->handleErrors();
     $tim->run();
     $tim->handleErrors();
     exit(0);
 }
開發者ID:johnstyle,項目名稱:timthumb,代碼行數:88,代碼來源:Timthumb.php

示例4: start

 public static function start()
 {
     if (LIMIT_ON) {
         if (count($_GET) > 1 || !$_GET['src'] || $_POST) {
             return;
         }
     }
     $tim = new timthumb();
     $tim->handleErrors();
     $tim->securityChecks();
     if ($tim->tryBrowserCache()) {
         exit(0);
     }
     $tim->handleErrors();
     if (FILE_CACHE_ENABLED && $tim->tryServerCache()) {
         exit(0);
     }
     $tim->handleErrors();
     $tim->run();
     $tim->handleErrors();
     exit(0);
 }
開發者ID:J3n5en,項目名稱:Diaspora,代碼行數:22,代碼來源:timthumb.php


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