From 9206af975c50dd877c4a9044b868f9007e231b62 Mon Sep 17 00:00:00 2001 From: ngleader Date: Tue, 25 May 2010 05:50:12 +0000 Subject: [PATCH] =?UTF-8?q?#18902269=20#18908923=20optimizer=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=8B=9C=20addon=20js=20=EB=AF=B8=ED=8F=AC=ED=95=A8?= =?UTF-8?q?=20=EB=B0=8F=20=EC=9D=B8=EC=BD=94=EB=94=A9=20=EB=AC=B8=EC=A0=9C?= =?UTF-8?q?,=20=EA=B8=B0=EB=B3=B8=20css=EC=9D=98=20=EC=9D=B8=EC=BD=94?= =?UTF-8?q?=EB=94=A9=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7483 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/optimizer/Optimizer.class.php | 25 +++++++++++++++---------- common/css/default.css | 2 -- common/css/popup.css | 4 +--- common/script.php | 25 +++++++++++++------------ common/tpl/common_layout.html | 2 +- common/tpl/popup_layout.html | 2 +- common/tpl/redirect.html | 2 +- common/tpl/refresh.html | 2 +- 8 files changed, 33 insertions(+), 31 deletions(-) diff --git a/classes/optimizer/Optimizer.class.php b/classes/optimizer/Optimizer.class.php index 6b91727f0..cffe5f9e7 100644 --- a/classes/optimizer/Optimizer.class.php +++ b/classes/optimizer/Optimizer.class.php @@ -48,18 +48,22 @@ $files = array(); $hash = ""; foreach($source_files as $key => $file) { - if($file['file'][0] == '/') - { - if(!file_exists($_SERVER['DOCUMENT_ROOT'].$file['file'])) continue; - } - else if(!$file || !$file['file'] || !file_exists($file['file'])) continue; - $file['file'] = $source_files[$key]['file'] = str_replace("\\","/",$file['file']); - if(empty($file['optimized']) || preg_match('/^https?:\/\//i', $file['file']) ) $files[] = $file; - else{ + if($file['file'][0] == '/'){ + if(!file_exists($file['file'])){ + if(file_exists($_SERVER['DOCUMENT_ROOT'] . $file['file'])){ + $source_files[$key] = $file['file'] = $_SERVER['DOCUMENT_ROOT'].$file['file']; + }else{ + continue; + } + } + } else if(!$file || !$file['file'] || !file_exists($file['file'])) continue; + $file['file'] = $source_files[$key]['file'] = str_replace("\\","/",$file['file']); + if(empty($file['optimized']) || preg_match('/^https?:\/\//i', $file['file']) ) $files[] = $file; + else{ $targets[] = $file; $hash .= $file['file']; } - } + } if(!count($targets)) return $this->_getOptimizedRemoved($files); $list_file_hash = md5($hash); @@ -71,7 +75,7 @@ $oCacheHandler->put($list_file_hash, $buff); } }else{ - $list_file = FileHandler::getRealPath($this->cache_path . $list_file_hash); + $list_file = FileHandler::getRealPath($this->cache_path . $list_file_hash . '.info.php'); if(!file_exists($list_file)){ $str = ' sprintf($this->script_file, $list_file_hash, $type) , 'media' => 'all')); $files = $this->_getOptimizedRemoved($files); if(!count($files)) return $files; diff --git a/common/css/default.css b/common/css/default.css index d4f85fc4b..dba8b421f 100644 --- a/common/css/default.css +++ b/common/css/default.css @@ -1,5 +1,3 @@ -@charset "utf-8"; - /* default.css - Type Selector Definition */ body { margin:0;padding:0; font-size:.75em;} diff --git a/common/css/popup.css b/common/css/popup.css index 109a830e3..6b558e507 100644 --- a/common/css/popup.css +++ b/common/css/popup.css @@ -1,4 +1,2 @@ -@charset "utf-8"; - body { overflow:hidden; } -table.colTable { margin:0; } \ No newline at end of file +table.colTable { margin:0; } diff --git a/common/script.php b/common/script.php index f5c9b865e..599c2115c 100644 --- a/common/script.php +++ b/common/script.php @@ -33,7 +33,7 @@ $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']; +$list_file = $cache_path . $_GET['l'] .'.info.php'; function getRealPath($file){ @@ -111,6 +111,7 @@ function printFileList($list){ for($i=0,$c=count($list);$i<$c;$i++){ $file = getRealPath($list[$i]); if(file_exists($file)){ + $output .= '/* file:' . $file . " */\n"; $output .= file_get_contents($file); $output .= "\n"; } @@ -207,6 +208,8 @@ function _replaceCssPath($matches) { } function convertEncodingStr($str) { + if(!$str) return ''; + $charset_list = array( 'UTF-8', 'EUC-KR', 'CP949', 'ISO8859-1', 'EUC-JP', 'SHIFT_JIS', 'CP932', 'EUC-CN', 'HZ', 'GBK', 'GB18030', 'EUC-TW', 'BIG5', 'CP950', 'BIG5-HKSCS', @@ -218,13 +221,11 @@ function convertEncodingStr($str) { 'CP1257', 'CP850', 'CP866', ); - for($i=0;$i - + \ No newline at end of file diff --git a/common/tpl/popup_layout.html b/common/tpl/popup_layout.html index 1131076fb..9131fc9fb 100644 --- a/common/tpl/popup_layout.html +++ b/common/tpl/popup_layout.html @@ -9,4 +9,4 @@ \ No newline at end of file + diff --git a/common/tpl/redirect.html b/common/tpl/redirect.html index 53f59e4f5..087cb18a8 100644 --- a/common/tpl/redirect.html +++ b/common/tpl/redirect.html @@ -23,4 +23,4 @@ } - + \ No newline at end of file diff --git a/common/tpl/refresh.html b/common/tpl/refresh.html index 4ac78ff14..8dd70d228 100644 --- a/common/tpl/refresh.html +++ b/common/tpl/refresh.html @@ -1,3 +1,3 @@ + \ No newline at end of file