mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 06:42:14 +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
|
|
@ -83,11 +83,6 @@
|
|||
* @brief 모듈별 설정 저장
|
||||
**/
|
||||
function procPointAdminInsertModuleConfig() {
|
||||
// 설정 정보 가져오기
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
// 변수 정리
|
||||
$args = Context::getRequestVars();
|
||||
|
||||
foreach($args as $key => $val) {
|
||||
|
|
@ -95,13 +90,15 @@
|
|||
if(!$matches[1]) continue;
|
||||
$name = $matches[1];
|
||||
$module_srl = $matches[2];
|
||||
if(strlen($val)==0) unset($config->module_point[$module_srl][$name]);
|
||||
else $config->module_point[$module_srl][$name] = (int)$val;
|
||||
if(strlen($val)>0) $module_config[$module_srl][$name] = (int)$val;
|
||||
}
|
||||
|
||||
// 저장
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('point', $config);
|
||||
if(count($module_config)) {
|
||||
foreach($module_config as $module_srl => $config) {
|
||||
$oModuleController->insertModulePartConfig('point',$module_srl,$config);
|
||||
}
|
||||
}
|
||||
|
||||
$this->cacheActList();
|
||||
|
||||
|
|
@ -119,58 +116,26 @@
|
|||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
|
||||
// 설정 정보 가져오기
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
// 설정 저장
|
||||
$oModuleController = &getController('module');
|
||||
for($i=0;$i<count($module_srl);$i++) {
|
||||
$srl = trim($module_srl[$i]);
|
||||
if(!$srl) continue;
|
||||
$config->module_point[$srl]['insert_document'] = (int)Context::get('insert_document');
|
||||
$config->module_point[$srl]['insert_comment'] = (int)Context::get('insert_comment');
|
||||
$config->module_point[$srl]['upload_file'] = (int)Context::get('upload_file');
|
||||
$config->module_point[$srl]['download_file'] = (int)Context::get('download_file');
|
||||
$config->module_point[$srl]['read_document'] = (int)Context::get('read_document');
|
||||
$config->module_point[$srl]['voted'] = (int)Context::get('voted');
|
||||
$config->module_point[$srl]['blamed'] = (int)Context::get('blamed');
|
||||
unset($config);
|
||||
$config['insert_document'] = (int)Context::get('insert_document');
|
||||
$config['insert_comment'] = (int)Context::get('insert_comment');
|
||||
$config['upload_file'] = (int)Context::get('upload_file');
|
||||
$config['download_file'] = (int)Context::get('download_file');
|
||||
$config['read_document'] = (int)Context::get('read_document');
|
||||
$config['voted'] = (int)Context::get('voted');
|
||||
$config['blamed'] = (int)Context::get('blamed');
|
||||
$oModuleController->insertModulePartConfig('point', $srl, $config);
|
||||
}
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('point', $config);
|
||||
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 기능별 act 저장
|
||||
**/
|
||||
function procPointAdminInsertActConfig() {
|
||||
// 설정 정보 가져오기
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
// 변수 정리
|
||||
$args = Context::getRequestVars();
|
||||
|
||||
$config->insert_document_act = $args->insert_document_act;
|
||||
$config->delete_document_act = $args->delete_document_act;
|
||||
$config->insert_comment_act = $args->insert_comment_act;
|
||||
$config->delete_comment_act = $args->delete_comment_act;
|
||||
$config->upload_file_act = $args->upload_file_act;
|
||||
$config->delete_file_act = $args->delete_file_act;
|
||||
$config->download_file_act = $args->download_file_act;
|
||||
|
||||
// 저장
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('point', $config);
|
||||
|
||||
$this->cacheActList();
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 포인트 변경
|
||||
**/
|
||||
|
|
@ -192,6 +157,8 @@
|
|||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
$module_config = $oModuleModel->getModulePartConfigs('point');
|
||||
|
||||
// 회원의 포인트 저장을 위한 변수
|
||||
$member = array();
|
||||
|
||||
|
|
@ -201,7 +168,7 @@
|
|||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
if($config->module_point[$val->module_srl]['insert_document']) $insert_point = $config->module_point[$val->module_srl]['insert_document'];
|
||||
if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document'];
|
||||
else $insert_point = $config->insert_document;
|
||||
|
||||
if(!$val->member_srl) continue;
|
||||
|
|
@ -217,7 +184,7 @@
|
|||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
if($config->module_point[$val->module_srl]['insert_comment']) $insert_point = $config->module_point[$val->module_srl]['insert_comment'];
|
||||
if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment'];
|
||||
else $insert_point = $config->insert_comment;
|
||||
|
||||
if(!$val->member_srl) continue;
|
||||
|
|
@ -233,7 +200,7 @@
|
|||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
if($config->module_point[$val->module_srl]['upload_file']) $insert_point = $config->module_point[$val->module_srl]['upload_file'];
|
||||
if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file'];
|
||||
else $insert_point = $config->upload_file;
|
||||
|
||||
if(!$val->member_srl) continue;
|
||||
|
|
@ -306,23 +273,7 @@
|
|||
* @brief 캐시파일 저장
|
||||
**/
|
||||
function cacheActList() {
|
||||
// 설정 정보 가져오기
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
// 각 act값을 정리
|
||||
$act_list = sprintf("%s,%s,%s,%s,%s,%s,%s",
|
||||
$config->insert_document_act,
|
||||
$config->delete_document_act,
|
||||
$config->insert_comment_act,
|
||||
$config->delete_comment_act,
|
||||
$config->upload_file_act,
|
||||
$config->delete_file_act,
|
||||
$config->download_file_act
|
||||
);
|
||||
|
||||
$act_cache_file = "./files/cache/point.act.cache";
|
||||
FileHandler::writeFile($act_cache_file, $act_list);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue