- Timestamp:
- 06/27/2008 05:23:23 PM (2 months ago)
- Location:
- sandbox
- Files:
-
- 5 added
- 38 modified
-
.htaccess (modified) (1 diff)
-
addons/member_communication/member_communication.addon.php (modified) (1 diff)
-
classes/context/Context.class.php (modified) (1 diff)
-
classes/db/DB.class.php (modified) (1 diff)
-
classes/file/FileHandler.class.php (modified) (7 diffs)
-
classes/template/TemplateHandler.class.php (modified) (3 diffs)
-
classes/widget/WidgetHandler.class.php (modified) (1 diff)
-
config/func.inc.php (modified) (1 diff)
-
modules/admin/admin.class.php (modified) (1 diff)
-
modules/board/board.admin.controller.php (modified) (1 diff)
-
modules/comment/comment.class.php (modified) (1 diff)
-
modules/comment/comment.model.php (modified) (1 diff)
-
modules/communication/communication.view.php (modified) (1 diff)
-
modules/document/document.admin.controller.php (modified) (1 diff)
-
modules/document/document.class.php (modified) (4 diffs)
-
modules/document/document.controller.php (modified) (1 diff)
-
modules/document/document.item.php (modified) (2 diffs)
-
modules/file/file.controller.php (modified) (2 diffs)
-
modules/importer/extract.class.php (modified) (2 diffs)
-
modules/importer/importer.admin.controller.php (modified) (5 diffs)
-
modules/importer/ttimport.class.php (modified) (3 diffs)
-
modules/integration_search/integration_search.admin.controller.php (modified) (1 diff)
-
modules/layout/layout.admin.controller.php (modified) (4 diffs)
-
modules/layout/layout.admin.view.php (modified) (1 diff)
-
modules/layout/layout.class.php (modified) (1 diff)
-
modules/lifepod/lifepod.admin.controller.php (modified) (1 diff)
-
modules/member/member.controller.php (modified) (5 diffs)
-
modules/member/openid_lib/class_HTTPRetriever.php (modified) (1 diff)
-
modules/member/openid_lib/libcurlexternal.inc.php (modified) (2 diffs)
-
modules/member/openid_lib/libcurlnative.inc.php (modified) (1 diff)
-
modules/menu/menu.admin.controller.php (modified) (3 diffs)
-
modules/module/module.controller.php (modified) (1 diff)
-
modules/opage/opage.admin.controller.php (modified) (1 diff)
-
modules/opage/opage.view.php (modified) (1 diff)
-
modules/point/point.admin.controller.php (modified) (1 diff)
-
modules/springnote/springnote.admin.controller.php (modified) (1 diff)
-
modules/tccommentnotify/tccommentnotify.controller.php (modified) (2 diffs)
-
modules/widget/widget.controller.php (modified) (3 diffs)
-
tools (added)
-
tools/cache_cleaner (added)
-
tools/cache_cleaner/form.html (added)
-
tools/cache_cleaner/index.php (added)
-
tools/cache_cleaner/style.css (added)
Legend:
- Unmodified
- Added
- Removed
-
sandbox/.htaccess
r4278 r4331 13 13 RewriteRule ^(.+)/layouts/(.*) ./layouts/$2 [L] 14 14 RewriteRule ^(.+)/addons/(.*) ./addons/$2 [L] 15 RewriteRule ^(.+)/tools/(.*) ./tools/$2 [L] 15 16 16 17 # page -
sandbox/addons/member_communication/member_communication.addon.php
r4230 r4331 34 34 35 35 if(file_exists($flag_file)) { 36 @unlink($flag_file);36 FileHandler::removeFile($flag_file); 37 37 Context::loadLang('./addons/member_communication/lang'); 38 38 -
sandbox/classes/context/Context.class.php
r4312 r4331 184 184 $oDB = &DB::getInstance(); 185 185 if(is_object($oDB)&&method_exists($oDB, 'close')) $oDB->close(); 186 } 187 188 /** 189 * @brief DB의 및 기타 정보 load 190 **/ 191 function loadDBInfo() { 192 $oContext = &Context::getInstance(); 193 return $oContext->_loadDBInfo(); 186 194 } 187 195 -
sandbox/classes/db/DB.class.php
r4290 r4331 497 497 foreach($tables as $alias => $table) { 498 498 $filename = sprintf('%s/cache.%s%s', $this->count_cache_path, $this->prefix, $table); 499 @unlink($filename);499 FileHandler::removeFile($filename); 500 500 FileHandler::writeFile( $filename, '' ); 501 501 } -
sandbox/classes/file/FileHandler.class.php
r4290 r4331 11 11 12 12 /** 13 * @brief 대상 파일이름이나 디렉토리의 위치를 확인함 14 **/ 15 function getRealPath($source) { 16 if(substr($source,0,1)=='/') return $source; 17 if(substr($source,0,2)=='./') $source = substr($source,2); 18 return _XE_PATH_.$source; 19 } 20 21 /** 13 22 * @brief 파일의 내용을 읽어서 return 14 23 **/ 15 24 function readFile($file_name) { 25 $file_name = FileHandler::getRealPath($file_name); 26 16 27 if(!file_exists($file_name)) return; 17 28 $filesize = filesize($file_name); … … 36 47 **/ 37 48 function writeFile($file_name, $buff, $mode = "w") { 49 $file_name = FileHandler::getRealPath($file_name); 50 38 51 $pathinfo = pathinfo($file_name); 39 52 $path = $pathinfo['dirname']; … … 49 62 50 63 /** 64 * @brief 파일 삭제 65 **/ 66 function removeFile($file_name) { 67 $file_name = FileHandler::getRealPath($file_name); 68 if(file_exists($file_name)) @unlink($file_name); 69 } 70 71 /** 72 * @brief 파일이름이나 디렉토리명이나 위치 변경 73 **/ 74 function rename($source, $target) { 75 $source = FileHandler::getRealPath($source); 76 $target = FileHandler::getRealPath($target); 77 @rename($source, $target); 78 } 79 80 /** 51 81 * @brief 특정 디렉토리를 이동 52 82 **/ 53 83 function moveDir($source_dir, $target_dir) { 54 if(!is_dir($source_dir)) return; 55 56 if(!is_dir($target_dir)) { 57 FileHandler::makeDir($target_dir); 58 @unlink($target_dir); 59 } 60 61 @rename($source_dir, $target_dir); 84 FileHandler::rename($source_dir, $target_dir); 62 85 } 63 86 … … 66 89 **/ 67 90 function readDir($path, $filter = '', $to_lower = false, $concat_prefix = false) { 91 $path = FileHandler::getRealPath($path); 92 68 93 if(substr($path,-1)!='/') $path .= '/'; 69 94 if(!is_dir($path)) return array(); 95 70 96 $oDir = dir($path); 71 97 while($file = $oDir->read()) { 72 98 if(substr($file,0,1)=='.') continue; 99 73 100 if($filter && !preg_match($filter, $file)) continue; 101 74 102 if($to_lower) $file = strtolower($file); 103 75 104 if($filter) $file = preg_replace($filter, '$1', $file); 76 105 else $file = $file; 77 106 78 if($concat_prefix) $file = $path.$file; 107 if($concat_prefix) { 108 $file = sprintf('%s%s', str_replace(_XE_PATH_, '', $path), $file); 109 } 110 79 111 $output[] = $file; 80 112 } 81 113 if(!$output) return array(); 114 82 115 return $output; 83 116 } … … 109 142 **/ 110 143 function removeDir($path) { 144 $path = FileHandler::getRealPath($path); 111 145 if(!is_dir($path)) return; 112 146 $directory = dir($path); … … 146 180 **/ 147 181 function getRemoteFile($url, $target_filename) { 182 $target_filename = FileHandler::getRealPath($target_filename); 183 148 184 $url_info = parse_url($url); 149 185 … … 192 228 **/ 193 229 function createImageFile($source_file, $target_file, $resize_width = 0, $resize_height = 0, $target_type = '', $thumbnail_type = 'crop') { 230 $source_file = FileHandler::getRequestUri($source_file); 231 $target_file = FileHandler::getRequestUri($target_file); 232 194 233 if(!file_exists($source_file)) return; 195 234 if(!$resize_width) $resize_width = 100; -
sandbox/classes/template/TemplateHandler.class.php
r4087 r4331 46 46 47 47 // tpl_file이 비어 있거나 해당 파일이 없으면 return 48 if(!$tpl_file || !file_exists( $tpl_file)) return;48 if(!$tpl_file || !file_exists(FileHandler::getRealPath($tpl_file))) return; 49 49 50 50 $this->tpl_path = $tpl_path; … … 52 52 53 53 // compiled된(or 될) 파일이름을 구함 54 $compiled_tpl_file = $this->_getCompiledFileName($tpl_file);54 $compiled_tpl_file = FileHandler::getRealPath($this->_getCompiledFileName($tpl_file)); 55 55 56 56 // 일단 컴파일 57 57 $buff = $this->_compile($tpl_file, $compiled_tpl_file); 58 58 59 59 // Context와 compiled_tpl_file로 컨텐츠 생성 60 60 $output = $this->_fetch($compiled_tpl_file, $buff, $tpl_path); … … 84 84 if(!file_exists($compiled_tpl_file)) return $this->_compileTplFile($tpl_file, $compiled_tpl_file); 85 85 86 $source_ftime = filemtime( $tpl_file);86 $source_ftime = filemtime(FileHandler::getRealPath($tpl_file)); 87 87 $target_ftime = filemtime($compiled_tpl_file); 88 if($source_ftime>$target_ftime || $target_ftime < filemtime( './classes/template/TemplateHandler.class.php') ) return $this->_compileTplFile($tpl_file, $compiled_tpl_file);88 if($source_ftime>$target_ftime || $target_ftime < filemtime(_XE_PATH_.'classes/template/TemplateHandler.class.php') ) return $this->_compileTplFile($tpl_file, $compiled_tpl_file); 89 89 } 90 90 -
sandbox/classes/widget/WidgetHandler.class.php
r4322 r4331 75 75 76 76 // lock 파일 제거 77 @unlink($lock_file);77 FileHandler::removeFile($lock_file); 78 78 79 79 return $widget_content; -
sandbox/config/func.inc.php
r4316 r4331 473 473 **/ 474 474 function getScriptPath() { 475 $url = $_SERVER['PHP_SELF']?$_SERVER['PHP_SELF']:($_SERVER['REQUEST_URI']?$_SERVER['REQUEST_URI']:$_SERVER['URL']); 476 return preg_replace('/index.php/i','',$url); 475 static $url = null; 476 if($url === null) { 477 $document_root = str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']); 478 $file = str_replace('\\','/',__FILE__); 479 $url = preg_replace('/index.php/i','',str_replace('config/func.inc.php','',str_replace($document_root, '', $file))); 480 } 481 return $url; 477 482 } 478 483 -
sandbox/modules/admin/admin.class.php
r4184 r4331 47 47 48 48 // ./files/cache/news* 파일 삭제 49 $directory = dir( "./files/cache/");49 $directory = dir(_XE_PATH_."files/cache/"); 50 50 while($entry = $directory->read()) { 51 if(substr($entry,0,11)=='newest_news') @unlink("./files/cache/".$entry);51 if(substr($entry,0,11)=='newest_news') FileHandler::removeFile("./files/cache/".$entry); 52 52 } 53 53 $directory->close(); -
sandbox/modules/board/board.admin.controller.php
r4208 r4331 68 68 unset($obj->{"del_".$vars->name}); 69 69 if($del_var == 'Y') { 70 @unlink($module_info->{$vars->name});70 FileHandler::removeFile($module_info->{$vars->name}); 71 71 continue; 72 72 } -
sandbox/modules/comment/comment.class.php
r4197 r4331 6 6 **/ 7 7 8 require_once( './modules/comment/comment.item.php');8 require_once(_XE_PATH_.'modules/comment/comment.item.php'); 9 9 10 10 class comment extends ModuleObject { -
sandbox/modules/comment/comment.model.php
r4251 r4331 286 286 287 287 // 성공시 lock파일 제거 288 @unlink($lock_file);288 FileHandler::removeFile($lock_file); 289 289 } 290 290 -
sandbox/modules/communication/communication.view.php
r4226 r4331 79 79 $flag_path = './files/communication_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl); 80 80 $flag_file = sprintf('%s%s', $flag_path, $logged_info->member_srl); 81 @unlink($flag_file);81 FileHandler::removeFile($flag_file); 82 82 83 83 $this->setTemplateFile('new_message'); -
sandbox/modules/document/document.admin.controller.php
r4226 r4331 398 398 } else { 399 399 if(!preg_match('/^thumbnail_([^\.]*)\.jpg$/i',$entry)) continue; 400 @unlink($path.'/'.$entry);400 FileHandler::removeFile($path.'/'.$entry); 401 401 } 402 402 } -
sandbox/modules/document/document.class.php
r4140 r4331 6 6 **/ 7 7 8 require_once( './modules/document/document.item.php');8 require_once(_XE_PATH_.'modules/document/document.item.php'); 9 9 10 10 class document extends ModuleObject { … … 32 32 $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice")); 33 33 $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl")); 34 $oDB->addIndex("documents","idx_module_blamed_count", array("module_srl","blamed_count"));34 $oDB->addIndex("documents","idx_module_blamed_count", array("module_srl","blamed_count")); 35 35 36 36 // 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가 … … 183 183 if(!$oDB->isIndexExists("documents","idx_module_document_srl")) $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl")); 184 184 185 // 2008. 04. 23 blamed count 컬럼 추가 186 if(!$oDB->isColumnExists("documents", "blamed_count")) 187 { 188 $oDB->addColumn('documents', 'blamed_count', 'number', 11, 0, true); 189 $oDB->addIndex('documents', 'idx_blamed_count', array('blamed_count')); 190 } 191 192 if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) 193 { 194 $oDB->addIndex('documents', 'idx_module_blamed_count', array('module_srl', 'blamed_count')); 195 } 196 197 if(!$oDB->isColumnExists("document_voted_log", "point")) 198 $oDB->addColumn('document_voted_log', 'point', 'number', 11, 0, true); 199 200 return new Object(0,'success_updated'); 201 } 185 // 2008. 04. 23 blamed count 컬럼 추가 186 if(!$oDB->isColumnExists("documents", "blamed_count")) { 187 $oDB->addColumn('documents', 'blamed_count', 'number', 11, 0, true); 188 $oDB->addIndex('documents', 'idx_blamed_count', array('blamed_count')); 189 } 190 191 if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) { 192 $oDB->addIndex('documents', 'idx_module_blamed_count', array('module_srl', 'blamed_count')); 193 } 194 195 if(!$oDB->isColumnExists("document_voted_log", "point")) 196 $oDB->addColumn('document_voted_log', 'point', 'number', 11, 0, true); 197 return new Object(0,'success_updated'); 198 } 202 199 203 200 /** … … 206 203 function recompileCache() { 207 204 // 게시글 분류 캐시 파일 삭제 208 FileHandler::removeFilesInDir( "./files/cache/document_category");205 FileHandler::removeFilesInDir(_XE_PATH_."files/cache/document_category"); 209 206 } 210 207 -
sandbox/modules/document/document.controller.php
r4300 r4331 763 763 764 764 if(!$category_list) { 765 @unlink($xml_file);766 @unlink($php_file);765 FileHandler::removeFile($xml_file); 766 FileHandler::removeFile($php_file); 767 767 return false; 768 768 } -
sandbox/modules/document/document.item.php
r4324 r4331 456 456 $file_created_time = date("YmdHis",filemtime($thumbnail_file)); 457 457 $modified_time = $this->get('last_update'); 458 if($modified_time > $file_created_time) @unlink($thumbnail_file);458 if($modified_time > $file_created_time) FileHandler::removeFile($thumbnail_file); 459 459 } 460 460 … … 501 501 FileHandler::getRemoteFile($target_src, $tmp_file); 502 502 FileHandler::createImageFile($tmp_file, $thumbnail_file, $width, $height, 'jpg', $config->thumbnail_type); 503 @unlink($tmp_file);503 FileHandler::removeFile($tmp_file); 504 504 return Context::getRequestUri().$thumbnail_file; 505 505 } -
sandbox/modules/file/file.controller.php
r4264 r4331 347 347 348 348 // 삭제 성공하면 파일 삭제 349 @unlink($uploaded_filename);349 FileHandler::removeFile($uploaded_filename); 350 350 351 351 return $output; … … 416 416 417 417 // 파일 이동 418 @rename($old_file, $new_file);418 FileHandler::rename($old_file, $new_file); 419 419 420 420 // DB 정보도 수정 -
sandbox/modules/importer/extract.class.php
r3947 r4331 51 51 **/ 52 52 function openFile() { 53 @unlink($this->cache_index_file);53 FileHandler::removeFile($this->cache_index_file); 54 54 $this->index_fd = fopen($this->cache_index_file,"a"); 55 55 … … 141 141 fwrite($fd, FileHandler::readFile($target_file)); 142 142 143 @unlink($target_file);143 FileHandler::removeFile($target_file); 144 144 } 145 145 fwrite($fd, '</items>'); -
sandbox/modules/importer/importer.admin.controller.php
r4226 r4331 191 191 // 대상 파일을 읽여서 파싱후 입력 192 192 $xmlObj = $oXmlParser->loadXmlFile($target_file); 193 @unlink($target_file);193 FileHandler::removeFile($target_file); 194 194 if(!$xmlObj) continue; 195 195 … … 327 327 // 대상 파일을 읽여서 파싱후 입력 328 328 $xmlObj = $oXmlParser->loadXmlFile($target_file); 329 @unlink($target_file);329 FileHandler::removeFile($target_file); 330 330 if(!$xmlObj) continue; 331 331 … … 434 434 $oDocumentController->makeCategoryFile($module_srl); 435 435 } 436 @unlink($category_file);436 FileHandler::removeFile($category_file); 437 437 } 438 438 … … 559 559 560 560 fclose($fp); 561 @unlink($target_file);561 FileHandler::removeFile($target_file); 562 562 } 563 563 … … 794 794 if(!FileHandler::makeDir($path)) continue; 795 795 796 if(preg_match('/^\.\/files\/cache\/tmp/i',$file_obj->file)) @rename($file_obj->file, $filename);796 if(preg_match('/^\.\/files\/cache\/tmp/i',$file_obj->file)) FileHandler::rename($file_obj->file, $filename); 797 797 else @copy($file_obj->file, $filename); 798 798 -
sandbox/modules/importer/ttimport.class.php
r4058 r4331 56 56 $oDocumentController->makeCategoryFile($module_srl); 57 57 } 58 @unlink($category_file);58 FileHandler::removeFile($category_file); 59 59 } 60 60 $category_list = $category_titles = array(); … … 240 240 241 241 fclose($fp); 242 @unlink($target_file);242 FileHandler::removeFile($target_file); 243 243 } 244 244 … … 299 299 if(!FileHandler::makeDir($path)) continue; 300 300 301 @rename($file_obj->file, $filename);301 FileHandler::rename($file_obj->file, $filename); 302 302 303 303 // DB입력 -
sandbox/modules/integration_search/integration_search.admin.controller.php
r3528