From 821c1277d93003c54e4c9032c13234033ccdcbcd Mon Sep 17 00:00:00 2001 From: haneul Date: Tue, 11 May 2010 11:47:18 +0000 Subject: [PATCH] we need to add options for gzip handlers git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7442 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- common/script.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common/script.php b/common/script.php index 1d0ac583c..f82643f7d 100644 --- a/common/script.php +++ b/common/script.php @@ -14,6 +14,7 @@ if(version_compare(PHP_VERSION, '5.3.0') >= 0) // set env $XE_PATH = substr(dirname(__FILE__),0,strlen('common')*-1); $XE_WEB_PATH = substr($XE_PATH,strlen($_SERVER['DOCUMENT_ROOT'])); +if(substr($XE_WEB_PATH,-1) != "/") $XE_WEB_PATH .= "/"; $cache_path = $XE_PATH . 'files/cache/optimized/'; $type = $_GET['t']; $list_file = $cache_path . $_GET['l']; @@ -69,14 +70,19 @@ header("ETag: \"". md5(join(' ', $list)) .'-'. dechex($mtime)."\""); function printFileList($list){ + $output = ''; for($i=0,$c=count($list);$i<$c;$i++){ $file = getRealPath($list[$i]); if(file_exists($file)){ - $f = fopen($file,"r"); - fpassthru($f); - print("\n"); + //$f = fopen($file,"r"); + //fpassthru($f); + $output .= file_get_contents($file); + $output .= "\n"; + //print("\n"); } } + header("Content-Encoding: gzip"); + print ob_gzhandler($output, 5); } if($type == '.css'){