亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? yfast.php

?? YFast is a PHP class developed to use on this blog, it gives you the possibility to use all modern t
?? PHP
字號:
<?php
/*
 * YFast - makes your site faster and get A on YSlow!
 *
 * Copyright (c) 2007 Eduardo Lundgren (braeker.org)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2007-31-10 00:53:06 -0300 (Wed, 10 Oct 2007) $
 * $Rev: 2 $ 
 */

class YFast {
	
	private $docRoot;
	
	private $uri;
	
	private $uriRealPath;
	
	private $gzFilePath;
	
	private $uriDir;
	
	private $fileName;

	private $extension;

	private $mimeType;
	
	private $lastModified;
	
	private $expires;
	
	private $maxAge;
	
	private $etag;
	
	private $cacheControl;
	
	private $typePaths = array();
	
	private $knownTypes = array(
	    "htm"  => "text/html",
	    "html" => "text/html",
	    "js"   => "text/javascript",
	    "css"  => "text/css",
	    "xml"  => "text/xml",
	    "gif"  => "image/gif",
	    "jpg"  => "image/jpeg",
	    "jpeg" => "image/jpeg",
	    "png"  => "image/png",
	    "txt"  => "text/plain"
	);
	
	public function __construct($docRoot, $paths = array(), $types = array()) {
		
		$this->docRoot = $this->normalizePath($docRoot);
		
		$this->typePaths = array_merge($this->typePaths, $paths);
		
		$this->knownTypes = array_merge($this->knownTypes, $types);
		
	}
	
	public function noCache() {
		header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
		header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
		header( 'Cache-Control: no-store, no-cache, must-revalidate' );
		header( 'Cache-Control: post-check=0, pre-check=0', false );
		header( 'Pragma: no-cache' );
	}
	
	public function autoCache($config = array()) {
	
		$config = array_merge(array(
			match_etag => true,
			match_modified => true,
			last_modified => true,
			expires => true,
			etags => true,
			cache => true,
			gzip => false,
			maxAge => 1000
		), $config);

		$id = md5($html);
		
		$this->lastModified = getlastmod();
		
		$this->maxAge = $config["maxAge"] * 24 * 60 * 60;
		
		$this->expires = $this->lastModified + $this->maxAge;
		
		$this->etag = dechex($this->lastModified);
		
		$this->cacheControl = "must-revalidate, proxy-revalidate, max-age=".
			$this->maxAge . ", s-maxage=" . $this->maxAge;
		
		if ($config["last_modified"])
			$this->setLastModifiedHeader();
		
		if ($config["expires"])
			$this->setExpiresHeader();
		
		if ($config["etags"])
			$this->setETagsHeader();
		
		if ($config["cache"])
			$this->setCacheControlHeader();
		
		
	   if ($config["match_modified"] || $config["match_etag"])
			$this->getIfModified();
		
		echo $html;
		
	}
	
	public function loadFile($uri, $config = array()) {
	
		$config = array_merge(array(
			match_etag => true,
			match_modified => true,
			last_modified => true,
			expires => true,
			etags => true,
			cache => true,
			gzip => true,
			maxAge => 1000
		), $config);
		
		$this->uri = $uri;
		
		$this->uriRealPath = $this->getRealPath($uri);
		
		$this->fileName = basename($this->uriRealPath);
		
		$this->checkPermission($uri);
		
		$this->checkExistence($uri);
		
		$this->uriDir = str_replace($this->fileName, "", $this->uriRealPath);
				
		$this->extension = $this->getExtension($this->fileName);

		$this->mimeType = $this->getMimeType($this->extension);
		
		$this->lastModified = filemtime($this->uriRealPath);
		
		$this->maxAge = $config["maxAge"] * 24 * 60 * 60;
		
		$this->expires = $this->lastModified + $this->maxAge;
		
		$this->etag = dechex($this->lastModified);
		
		$this->cacheControl = "must-revalidate, proxy-revalidate, max-age=".
			$this->maxAge . ", s-maxage=" . $this->maxAge;
		

		if ($config["gzip"])
			$this->obStart();
		
		if ($config["last_modified"])
			$this->setLastModifiedHeader();
		
		if ($config["expires"])
			$this->setExpiresHeader();
		
		if ($config["etags"])
			$this->setETagsHeader();
		
		if ($config["cache"])
			$this->setCacheControlHeader();

		
		if ($config["gzip"]) {
			
			$this->setGzipHeader();
			
			$this->gzFilePath = $this->uriDir."/gz/".$this->fileName.".gz";
			
			
			if (file_exists($this->gzFilePath)) {
		        $srcLastModified = filemtime( $this->uriRealPath );
		        $gzLastModified = filemtime( $this->gzFilePath );
	
		        if ($srcLastModified > $gzLastModified)
		       	// we need to recreate it...
		            @unlink($this->gzFilePath);
		    }
		    
		    if (!file_exists($this->gzFilePath)) {
		    	// create gzip version
				@mkdir($this->uriDir."/gz/", 0777);
				$this->gzCompressFile($this->uriRealPath, $this->gzFilePath, 9);
		    }
		    
		    $this->uriRealPath = $this->gzFilePath;
		    
		}
		
		
	   if ($config["match_modified"] || $config["match_etag"])
			$this->getIfModified();

		$this->setContentTypeHeader();
		
		
		readgzfile($this->uriRealPath);
		
		if ($config["gzip"])
			$this->obEndFlush();
	}
	
	public function obStart() {
		ob_start('ob_gzhandler');
	}
	
	public function obEndFlush() {
		ob_end_flush();
	}
	
	public function setLastModifiedHeader() {
		header("Last-Modified: " . date( "r", $this->lastModified ));
	}
	
	public function setExpiresHeader() {
		header("Expires: " . date("r", $this->expires));
	}
	
	public function setETagsHeader() {
		header("ETag: " . $this->etag);
	}
	
	public function setCacheControlHeader() {
		header("Cache-Control: " . $this->cacheControl);
	}

	public function setGzipHeader() {
		header("Content-Encoding: gzip");
	}
	
	public function setContentLengthHeader($bytes) {
		header("Content-Length: $bytes");
	}
	
	public function getIfModified() {
		if ($this->httpMatchETag() || $this->httpMatchModified()) {
	    	header( "HTTP/1.1 304 Not Modified" );
	        exit;
	    }
	}
	
	public function setContentTypeHeader() {
		header("Content-Type: ".$this->mimeType);
	}
	
	public function httpMatchETag() {
		global $_SERVER;
		return ereg("^".$this->etag."|[*]$", $_SERVER["HTTP_IF_NONE_MATCH"]);
	}
	
	public function httpMatchModified() {
		global $_SERVER;
		$lastModHeader = $_SERVER["HTTP_IF_MODIFIED_SINCE"];
		$tLastModHeader = strtotime($lastModified ? $lastModified : time());
		return $this->lastModified < $tLastModHeader ? true : false;
	}
	
	public function checkExistence($uri) {
		if (!file_exists($this->uriRealPath)) {
			header("HTTP/1.1 404 Not Found");
    		echo("<h1>HTTP 404 - Not Found</h1>");
			exit;
		}
	}
	
	public function checkPermission($uri) {
		if (strpos($this->uriRealPath, $this->docRoot) !== 0) {
			header("HTTP/1.1 403 Forbidden");
			echo("<h1>HTTP 403 - Forbidden</h1>");
			exit;
		}
	}
	
	public function getRealPath($filename) {
		if (ereg("^(\.{1,2}[/\])+", $filename) && realpath($filename))
			return $this->normalizePath(realpath($filename));
		
		foreach ($this->typePaths as $exts => $path) {
			if (eregi("\.$exts$", $filename)) {
				
				$path = explode(",", $path);
				
				foreach ($path as $pth) {
					$pth = $this->docRoot . trim($pth) . $filename;
					
					if (file_exists($pth))
						return $pth;
				}
				
				return $this->normalizePath($this->docRoot . $path . $filename);
			}
		}
		return null;		
	}
	
	private function getExtension($filename) {
		eregi("\.([^.]+)*$", basename($filename), $m);
		return $m[1];
	}
	
	private function getMimeType($extension) {
		return $this->knownTypes[$extension];
	}
	
	private function normalizePath($p) {
		return ereg_replace("[/\]", "/", $p);
	}
	
	function gzCompressFile($source, $dest, $level = false){
		$mode = "wb" . $level;
		if ($fp_out = gzopen($dest, $mode)) {
			if ($fp_in = fopen($source, "rb")) {
				while (!feof($fp_in)) {
					gzwrite($fp_out, fread($fp_in,1024*512));
				}
				fclose($fp_in);
			}
			gzclose($fp_out);
		}
		return $dest;
	}

	public function __destruct() { /*TODO*/ }
}

?>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久综合| 欧美亚洲一区三区| 国产精品久久二区二区| 欧美日本免费一区二区三区| 国产69精品久久777的优势| 亚洲愉拍自拍另类高清精品| 欧美mv和日韩mv国产网站| 91麻豆免费看片| 国产盗摄一区二区| 青椒成人免费视频| 一区二区三区精密机械公司| 久久婷婷色综合| 在线不卡一区二区| 在线观看欧美黄色| 亚洲丰满少妇videoshd| 国产精品入口麻豆原神| 日韩一级免费一区| 在线观看日韩毛片| 成人伦理片在线| 韩国欧美一区二区| 日本欧美在线观看| 亚洲第一福利视频在线| 日韩美女久久久| 中文文精品字幕一区二区| 欧美电视剧免费观看| 7777精品伊人久久久大香线蕉超级流畅 | 成人av在线资源| 国产精选一区二区三区| 麻豆一区二区三区| 日日夜夜免费精品视频| 亚洲国产精品一区二区久久恐怖片 | 欧美日韩大陆在线| 欧洲视频一区二区| 国产日韩一级二级三级| 欧美sm美女调教| 欧美一级二级在线观看| 337p亚洲精品色噜噜| 欧美日韩精品一区视频| 欧美手机在线视频| 久久这里只有精品视频网| 欧美午夜不卡在线观看免费| 欧美在线视频日韩| 欧美中文字幕一区二区三区| 91成人网在线| 欧美在线观看一区| 欧美日韩国产另类一区| 欧美精品自拍偷拍| 日韩欧美三级在线| 日韩女优av电影在线观看| 欧美一级免费大片| 日韩免费看网站| 久久久综合网站| 国产午夜精品久久久久久久| 久久精品欧美日韩精品| 国产精品美女久久久久久久| 自拍av一区二区三区| 亚洲乱码日产精品bd| 亚洲国产一区二区在线播放| 午夜av一区二区三区| 91黄色免费网站| 国产精品一区二区在线看| 国产一区二区视频在线| 懂色av一区二区在线播放| av高清不卡在线| 在线观看91精品国产入口| 欧美日韩一区二区三区在线看| 欧美日韩精品一区二区三区四区 | 欧美日韩高清影院| 欧美一区二区三区婷婷月色| 久久一二三国产| 成人欧美一区二区三区小说| 亚洲五月六月丁香激情| 久久97超碰国产精品超碰| 国产jizzjizz一区二区| 在线免费观看日韩欧美| 精品少妇一区二区三区视频免付费 | 欧美一级日韩一级| 欧美激情一区二区三区全黄| 亚洲精品亚洲人成人网在线播放| 日韩电影在线一区| 国产91精品一区二区麻豆网站| 91丨porny丨在线| 久久精品国产秦先生| 久久er精品视频| 不卡的av电影| 欧美精品1区2区3区| 国产亚洲欧美在线| 亚洲高清免费在线| 国产福利一区在线| 欧美日韩视频一区二区| 国产日韩精品一区二区三区| 亚洲一区二区在线免费观看视频 | 日本va欧美va精品| 青娱乐精品在线视频| 成人综合在线视频| 欧美日韩情趣电影| 国产精品少妇自拍| 日韩电影一区二区三区四区| 懂色av一区二区三区免费观看| 欧美日韩大陆在线| 中文字幕在线不卡视频| 麻豆精品久久精品色综合| 色悠悠亚洲一区二区| 欧美精品一区二区高清在线观看 | 91原创在线视频| 精品剧情在线观看| 亚洲1区2区3区4区| 91在线视频官网| 国产日韩精品视频一区| 奇米色777欧美一区二区| 在线观看三级视频欧美| 国产欧美一区二区精品性色超碰 | 日本一区二区久久| 狠狠色丁香久久婷婷综合_中| 在线观看亚洲一区| 中文字幕一区二区三区不卡在线 | 成人免费视频国产在线观看| 日韩一区二区在线观看| 国产成人精品午夜视频免费| 欧美喷水一区二区| 一区二区三区在线观看动漫| 成人av在线电影| 国产日产亚洲精品系列| 精品在线视频一区| 日韩一区二区免费视频| 午夜精品福利久久久| 欧美最猛黑人xxxxx猛交| 亚洲男人的天堂一区二区| 东方aⅴ免费观看久久av| 久久久久久日产精品| 精品一二三四区| 精品成人私密视频| 精品亚洲免费视频| 欧美videos大乳护士334| 免费成人小视频| 欧美va在线播放| 九色综合国产一区二区三区| 精品久久久久久综合日本欧美| 免费成人深夜小野草| 欧美一级黄色片| 国产综合久久久久久鬼色| 精品国产乱码久久久久久免费| 国内精品久久久久影院色| 26uuu国产电影一区二区| 国产一区二区在线视频| 久久久久国产精品厨房| 成人免费毛片片v| 亚洲天堂av一区| 在线观看欧美黄色| 首页国产欧美日韩丝袜| 欧美成人精品高清在线播放| 久久精品国产亚洲5555| 久久久91精品国产一区二区精品| 国产成人精品免费在线| 国产精品久久久久久久久果冻传媒 | 欧美剧情片在线观看| 日本欧美一区二区三区| 欧美成人乱码一区二区三区| 国产精品小仙女| 亚洲婷婷综合久久一本伊一区| 色综合久久精品| 天天色综合成人网| 26uuu国产在线精品一区二区| 成人免费视频免费观看| 亚洲自拍偷拍图区| 日韩午夜激情免费电影| 国产精品系列在线观看| 亚洲日本一区二区| 51久久夜色精品国产麻豆| 国内不卡的二区三区中文字幕| 国产精品天美传媒沈樵| 91福利视频网站| 国产综合一区二区| 自拍偷在线精品自拍偷无码专区| 欧美三日本三级三级在线播放| 久久精品二区亚洲w码| 中文字幕va一区二区三区| 欧美在线制服丝袜| 国产中文一区二区三区| 亚洲免费av高清| 欧美va亚洲va| 91麻豆国产福利在线观看| 欧美a级一区二区| 亚洲欧美综合另类在线卡通| 7777精品伊人久久久大香线蕉 | 精品sm在线观看| 色国产精品一区在线观看| 奇米一区二区三区| 日韩一区欧美小说| 日韩欧美国产三级| 色女孩综合影院| 狠狠色狠狠色综合系列| 亚洲一区二区三区四区在线| 久久日一线二线三线suv| 91成人免费在线视频| 国产九九视频一区二区三区| 亚洲成av人片在线| 中文字幕亚洲综合久久菠萝蜜| 日韩欧美一二三| 欧美日韩亚洲综合一区|