mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
#18581867 공백 제거 옵션 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7093 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
840c55e770
commit
9dfe775c0e
6 changed files with 41 additions and 5 deletions
|
|
@ -14,7 +14,7 @@
|
|||
var $cache_path = "./files/cache/optimized/";
|
||||
|
||||
/**
|
||||
* @brief optimizer에서 캐싱파일을 저장할 곳을 찾아서 없으면 만듬
|
||||
* @brief optimizer에서 캐싱파일을 저장할 곳을 찾아서 없으면 만듦
|
||||
**/
|
||||
function Optimizer() {
|
||||
if(!is_dir($this->cache_path)) {
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
function getOptimizedInfo($files) {
|
||||
// 개별 요소들 또는 Optimizer.class.php파일이 갱신되었으면 새로 옵티마이징
|
||||
$count = count($files);
|
||||
$last_modified = 0;
|
||||
$last_modified = filemtime(_XE_PATH_.'classes/optimizer/Optimizer.class.php');
|
||||
for($i=0;$i<$count;$i++) {
|
||||
$mtime = filemtime($files[$i]['file']);
|
||||
if($last_modified < $mtime) $last_modified = $mtime;
|
||||
|
|
@ -157,7 +157,8 @@
|
|||
unset($str);
|
||||
}
|
||||
|
||||
$str_to_write = $this->doCompressCode($str_to_write, $type);
|
||||
$db_info = Context::getDBInfo();
|
||||
if($db_info->use_spaceremover != N) $str_to_write = $this->doCompressCode($str_to_write, $db_info->use_spaceremover);
|
||||
|
||||
$file_object->write($str_to_write);
|
||||
$file_object->close();
|
||||
|
|
@ -251,7 +252,11 @@ if(!$cached) {
|
|||
return 'url("'.$target.'")';
|
||||
}
|
||||
|
||||
function doCompressCode($str_code, $type) {
|
||||
function doCompressCode($str_code, $condition = 'Y') {
|
||||
if($condition == 'N' || ($condition != 'P' && $condition != 'Y')) return $str_code;
|
||||
|
||||
if($condition == 'P' && ((int)date('H') < 1 || 5 < (int)date('H'))) return $str_code;
|
||||
|
||||
$str_code = str_replace("\r", "\n", $str_code);
|
||||
$str_code = preg_replace("!^([ \t]+)!m", '', $str_code);
|
||||
$str_code = preg_replace("!([ \t]+)$!m", '', $str_code);
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@
|
|||
Context::set('time_zone', $GLOBALS['_time_zone']);
|
||||
Context::set('use_rewrite', $db_info->use_rewrite=='Y'?'Y':'N');
|
||||
Context::set('use_optimizer', $db_info->use_optimizer!='N'?'Y':'N');
|
||||
Context::set('use_spaceremover', $db_info->use_spaceremover?$db_info->use_spaceremover:'Y');
|
||||
Context::set('qmail_compatibility', $db_info->qmail_compatibility=='Y'?'Y':'N');
|
||||
Context::set('use_db_session', $db_info->use_db_session=='N'?'N':'Y');
|
||||
Context::set('use_ssl', $db_info->use_ssl?$db_info->use_ssl:"none");
|
||||
|
|
|
|||
|
|
@ -64,6 +64,19 @@
|
|||
<p>{$lang->about_optimizer}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<!--@if($use_optimizer!='N')-->
|
||||
<tr>
|
||||
<th><div>{$lang->use_spaceremover}</div></th>
|
||||
<td>
|
||||
<select name="use_spaceremover">
|
||||
<!--@foreach($lang->use_spaceremover_condition as $key => $val)-->
|
||||
<option value="{$key}"<!--@if($key==$use_spaceremover)--> selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@endforeach-->
|
||||
</select>
|
||||
<p>{$lang->about_spaceremover}</p>
|
||||
</td>
|
||||
</tr><!--@end-->
|
||||
|
||||
<tr>
|
||||
<th><div>Language</div></th>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@
|
|||
$use_optimizer = Context::get('use_optimizer');
|
||||
if($use_optimizer!='Y') $use_optimizer = 'N';
|
||||
|
||||
$use_spaceremover = Context::get('use_spaceremover');
|
||||
if(!$use_spaceremover && $use_optimizer!='Y') $use_spaceremover = 'N';
|
||||
elseif($use_spaceremover != 'P' && $use_spaceremover != 'Y') $use_spaceremover = 'N';
|
||||
|
||||
$time_zone = Context::get('time_zone');
|
||||
|
||||
$qmail_compatibility = Context::get('qmail_compatibility');
|
||||
|
|
@ -73,6 +77,7 @@
|
|||
$db_info->use_db_session = $use_db_session;
|
||||
$db_info->use_rewrite = $use_rewrite;
|
||||
$db_info->use_optimizer = $use_optimizer;
|
||||
$db_info->use_spaceremover = $use_spaceremover;
|
||||
$db_info->use_ssl = $use_ssl;
|
||||
if($http_port) $db_info->http_port = (int) $http_port;
|
||||
else if($db_info->http_port) unset($db_info->http_port);
|
||||
|
|
|
|||
|
|
@ -163,6 +163,12 @@ EndOfLicense;
|
|||
$lang->env_title = 'Configuration';
|
||||
$lang->use_optimizer = 'Enable Optimizer';
|
||||
$lang->about_optimizer = 'If optimizer is enabled, users can quickly access to this site, since multiple CSS / JS files are put together and compressed before transmission. <br /> Nevertheless, this optimization might be problematic according to CSS or JS. If you disable it, it would work properly though it would work slower.';
|
||||
$lang->use_spaceremover = '통합된 파일 공백 제거';
|
||||
$lang->about_spaceremover = 'Optimizer로 파일을 통합할 때, 공백과 중복된 줄 바꿈을 제거합니다. 스크립트 파일 크기를 줄일 수 있습니다.<br />새벽 시간대에만 적용 옵션은 오전 1시 - 오전 5시 사이에 생성되는 파일에만 공백 제거 옵션을 적용합니다.';
|
||||
$lang->use_spaceremover_condition = array(
|
||||
'Y' => '항상 사용',
|
||||
'P' => '새벽 시간대에만 적용',
|
||||
'N' => '사용 안함');
|
||||
$lang->use_rewrite = 'Rewrite Mod';
|
||||
$lang->about_rewrite = "If web server provides rewrite mod, long URL such as http://blah/?document_srl=123 can be shortened like http://blah/123";
|
||||
$lang->time_zone = 'Time Zone';
|
||||
|
|
|
|||
|
|
@ -256,6 +256,12 @@ EndOfLicense;
|
|||
$lang->env_title = '환경 설정';
|
||||
$lang->use_optimizer = 'Optimizer 사용';
|
||||
$lang->about_optimizer = 'Optimizer를 사용하면 다수의 CSS/JS파일을 통합/압축 전송하여 매우 빠르게 사이트 접속이 가능하게 합니다.<br />다만 CSS나 JS에 따라서 문제가 생길 수 있습니다. 이때는 Optimizer 비활성화 하시면 정상적인 동작은 가능합니다.';
|
||||
$lang->use_spaceremover = '통합된 파일 공백 제거';
|
||||
$lang->about_spaceremover = 'Optimizer로 파일을 통합할 때, 공백과 중복된 줄 바꿈을 제거합니다. 스크립트 파일 크기를 줄일 수 있습니다.<br />새벽 시간대에만 적용 옵션은 오전 1시 - 오전 5시 사이에 생성되는 파일에만 공백 제거 옵션을 적용합니다.';
|
||||
$lang->use_spaceremover_condition = array(
|
||||
'Y' => '항상 사용',
|
||||
'P' => '새벽 시간대에만 적용',
|
||||
'N' => '사용 안함');
|
||||
$lang->use_rewrite = 'rewrite mod 사용';
|
||||
$lang->about_rewrite = '웹서버에서 rewrite mod를 지원하면 http://주소/?document_srl=123 같이 복잡한 주소를 http://주소/123과 같이 간단하게 줄일 수 있습니다.';
|
||||
$lang->time_zone = '표준 시간대';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue