moduleModel 및 moduleController에서 제공하던 각 모듈별 설정을 이용시 너무 많은 설정값들이 생길 경우 이를 serialize/ unserialize하는데 드는 부하가 커짐을 방지하기 위해서 module_config외에 module_part_config 테이블을 주고 module_srl 별 설정을 분산하도록 하여 쓸데없는 부하가 생기지 않도록 수정.

files/cache/module_info내에 있던 module_config 캐시 파일도 사용하지 않도록 변경


git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4696 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-10-27 07:27:47 +00:00
parent cc7dd67ed2
commit 5934906056
41 changed files with 372 additions and 445 deletions

View file

@ -73,32 +73,21 @@
* @brief 댓글의 모듈별 추가 확장 폼을 저장
**/
function procCommentAdminInsertModuleConfig() {
// 기존 설정을 가져옴
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('comment');
// 대상을 구함
$module_srl = Context::get('target_module_srl');
// 여러개의 모듈 일괄 설정일 경우
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
else $module_srl = array($module_srl);
$comment_config = null;
$comment_config->comment_count = (int)Context::get('comment_count');
if(!$comment_config->comment_count) $comment_config->comment_count = 50;
$oModuleController = &getController('module');
for($i=0;$i<count($module_srl);$i++) {
$srl = trim($module_srl[$i]);
if(!$srl) continue;
$config->module_config[$srl] = $comment_config;
$output = $oModuleController->insertModulePartConfig('comment',$srl,$comment_config);
}
// module Controller 객체 생성하여 입력
$oModuleController = &getController('module');
$output = $oModuleController->insertModuleConfig('comment',$config);
$this->setError(-1);
$this->setMessage('success_updated');
}

View file

@ -386,18 +386,9 @@
* @brief 모듈별 댓글 설정을 return
**/
function getCommentConfig($module_srl) {
if(!$GLOBLAS['__comment_module_config__']) {
// 선택된 모듈의 trackback설정을 가져옴
$oModuleModel = &getModel('module');
$GLOBLAS['__comment_module_config__'] = $oModuleModel->getModuleConfig('comment');
}
$comment_config = $GLOBLAS['__comment_module_config__']->module_config[$module_srl];
if(!is_object($comment_config)) $comment_config = null;
$oModuleModel = &getModel('module');
$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
if(!isset($comment_config->comment_count)) $comment_count->comment_count = 50;
return $comment_config;
}