mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 14:22:54 +09:00
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:
parent
cc7dd67ed2
commit
5934906056
41 changed files with 372 additions and 445 deletions
|
|
@ -18,6 +18,9 @@
|
|||
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminCategory');
|
||||
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminInfo');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->addIndex("module_part_config","idx_module_part_config", array("module","module_srl"));
|
||||
|
||||
// module 모듈에서 사용할 디렉토리 생성
|
||||
FileHandler::makeDir('./files/cache/module_info');
|
||||
FileHandler::makeDir('./files/cache/triggers');
|
||||
|
|
@ -29,6 +32,11 @@
|
|||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
**/
|
||||
function checkUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 2008. 10. 27 module_part_config 테이블의 결합 인덱스 추가
|
||||
if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -36,6 +44,61 @@
|
|||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 2008. 10. 27 module_part_config 테이블의 결합 인덱스 추가하고 기존에 module_config에 몰려 있던 모든 정보를 재점검
|
||||
if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
$modules = $oModuleModel->getModuleList();
|
||||
foreach($modules as $key => $module_info) {
|
||||
$module = $module_info->module;
|
||||
if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue;
|
||||
$config = $oModuleModel->getModuleConfig($module);
|
||||
|
||||
$module_config = null;
|
||||
switch($module) {
|
||||
case 'point' :
|
||||
$module_config = $config->module_point;
|
||||
unset($config->module_point);
|
||||
break;
|
||||
case 'trackback' :
|
||||
case 'rss' :
|
||||
case 'file' :
|
||||
case 'comment' :
|
||||
case 'editor' :
|
||||
$module_config = $config->module_config;
|
||||
unset($config->module_config);
|
||||
if(is_array($module_config) && count($module_config)) {
|
||||
foreach($module_config as $key => $val) {
|
||||
if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'layout' :
|
||||
$tmp = $config->header_script;
|
||||
if(is_array($tmp) && count($tmp)) {
|
||||
foreach($tmp as $k => $v) {
|
||||
if(!$v && !trim($v)) continue;
|
||||
$module_config[$k]->header_script = $v;
|
||||
}
|
||||
}
|
||||
$config = null;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$oModuleController->insertModuleConfig($module, $config);
|
||||
|
||||
if(is_array($module_config) && count($module_config)) {
|
||||
foreach($module_config as $module_srl => $module_part_config) {
|
||||
$oModuleController->insertModulePartConfig($module,$module_srl,$module_part_config);
|
||||
}
|
||||
}
|
||||
}
|
||||
$oDB->addIndex("module_part_config","idx_module_part_config", array("module","module_srl"));
|
||||
}
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue