mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 06:13:32 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7483 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e7b8c02a40
commit
9206af975c
8 changed files with 33 additions and 31 deletions
|
|
@ -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 = '<?php $f=array();';
|
||||
|
|
@ -81,6 +85,7 @@
|
|||
FileHandler::writeFile($list_file, $str);
|
||||
}
|
||||
}
|
||||
|
||||
array_unshift($files, array('file' => sprintf($this->script_file, $list_file_hash, $type) , 'media' => 'all'));
|
||||
$files = $this->_getOptimizedRemoved($files);
|
||||
if(!count($files)) return $files;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
@charset "utf-8";
|
||||
|
||||
/* default.css - Type Selector Definition */
|
||||
body { margin:0;padding:0; font-size:.75em;}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,2 @@
|
|||
@charset "utf-8";
|
||||
|
||||
body { overflow:hidden; }
|
||||
table.colTable { margin:0; }
|
||||
table.colTable { margin:0; }
|
||||
|
|
|
|||
|
|
@ -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<count($charset_list);$i++) {
|
||||
for($i=0,$c=count($charset_list);$i<$c;$i++) {
|
||||
$charset = $charset_list[$i];
|
||||
if($str){
|
||||
$cstr = iconv($charset,$charset.'//IGNORE',$str);
|
||||
if($str == $cstr && $charset != 'UTF-8'){
|
||||
return iconv($charset, 'UTF-8//IGNORE', $str);
|
||||
}
|
||||
if($str == iconv($charset, $charset.'//IGNORE',$str)){
|
||||
if($charset == 'UTF-8') return $str;
|
||||
return iconv($charset, 'UTF-8//IGNORE', $str);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -234,10 +235,11 @@ function convertEncodingStr($str) {
|
|||
if($type == '.js'){
|
||||
printFileList($list);
|
||||
}else if($type == '.css'){
|
||||
$css = array();
|
||||
|
||||
if($cache_support){
|
||||
foreach($list as $file){
|
||||
$cache_file = $cache_path . md5($file);
|
||||
$cache_file = $cache_path . md5($file). '.cache.php';
|
||||
$css[] = getRealPath($cache_file);
|
||||
}
|
||||
|
||||
|
|
@ -246,9 +248,8 @@ if($type == '.js'){
|
|||
if(!$buff){
|
||||
$buff = '';
|
||||
$css = array();
|
||||
foreach($list as $file){
|
||||
$cache_file = $cache_path . md5($file);
|
||||
$buff .= makeCacheFileCSS($file, getRealPath($cache_file), true);
|
||||
foreach($list as $file){
|
||||
$buff .= makeCacheFileCSS($file, '', true);
|
||||
$css[] = getRealPath($cache_file);
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +258,7 @@ if($type == '.js'){
|
|||
|
||||
}else{
|
||||
foreach($list as $file){
|
||||
$cache_file = $cache_path . md5($file);
|
||||
$cache_file = $cache_path . md5($file). '.cache.php';
|
||||
$cache_mtime = getMtime($cache_file);
|
||||
$css_mtime = getMtime($file);
|
||||
|
||||
|
|
|
|||
|
|
@ -76,4 +76,4 @@
|
|||
<div id="waitingforserverresponse"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
@ -9,4 +9,4 @@
|
|||
<script type="text/javascript">
|
||||
jQuery(window).load(setFixedPopupSize);
|
||||
var _isPoped = true;
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -23,4 +23,4 @@
|
|||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
<script type="text/javascript">
|
||||
top.location.reload();
|
||||
</script>
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue