mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-02 16:52:16 +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
|
|
@ -72,23 +72,19 @@
|
|||
function getFileConfig($module_srl = null) {
|
||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||
$oModuleModel = &getModel('module');
|
||||
$file_config = $oModuleModel->getModuleConfig('file');
|
||||
|
||||
$config->allowed_filesize = $file_config->allowed_filesize;
|
||||
$config->allowed_attach_size = $file_config->allowed_attach_size;
|
||||
$config->allowed_filetypes = $file_config->allowed_filetypes;
|
||||
|
||||
if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
|
||||
if(!$file_config) $file_config = $oModuleModel->getModuleConfig('file');
|
||||
if($file_config) {
|
||||
$config->allowed_filesize = $file_config->allowed_filesize;
|
||||
$config->allowed_attach_size = $file_config->allowed_attach_size;
|
||||
$config->allowed_filetypes = $file_config->allowed_filetypes;
|
||||
$config->download_grant = $file_config->download_grant;
|
||||
}
|
||||
if(!$config->allowed_filesize) $config->allowed_filesize = '2';
|
||||
if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
|
||||
if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
|
||||
|
||||
if($module_srl && $file_config->module_config[$module_srl]) {
|
||||
$module_config = $file_config->module_config[$module_srl];
|
||||
$config->allowed_filesize = $module_config->allowed_filesize;
|
||||
$config->allowed_attach_size = $module_config->allowed_attach_size;
|
||||
$config->allowed_filetypes = $module_config->allowed_filetypes;
|
||||
}
|
||||
|
||||
if(!$config->download_grant) $config->download_grant = array();
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
|
@ -136,8 +132,6 @@
|
|||
function getUploadConfig() {
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y') {
|
||||
//$file_config->allowed_filesize = 1024;
|
||||
//$file_config->allowed_attach_size = 1024;
|
||||
$file_config->allowed_filesize = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
|
||||
$file_config->allowed_attach_size = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
|
||||
$file_config->allowed_filetypes = '*.*';
|
||||
|
|
@ -172,24 +166,7 @@
|
|||
* @brief 특정 모듈의 file 설정을 return
|
||||
**/
|
||||
function getFileModuleConfig($module_srl) {
|
||||
// file 모듈의 config를 가져옴
|
||||
$oModuleModel = &getModel('module');
|
||||
$file_config = $oModuleModel->getModuleConfig('file');
|
||||
|
||||
$module_file_config = $file_config->module_config[$module_srl];
|
||||
if(!is_object($module_file_config)) $module_file_config = null;
|
||||
|
||||
if(!$module_file_config->module_srl) {
|
||||
$module_file_config->module_srl = $module_srl;
|
||||
$module_file_config->allowed_filesize = $file_config->allowed_filesize;
|
||||
$module_file_config->allowed_attach_size = $file_config->allowed_attach_size;
|
||||
$module_file_config->allowed_filetypes = $file_config->allowed_filetypes;
|
||||
$module_file_config->download_grant = array();
|
||||
} else {
|
||||
if(!$module_file_config->download_grant) $module_file_config->download_grant = array();
|
||||
}
|
||||
|
||||
return $module_file_config;
|
||||
return $this->getFileConfig($module_srl);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue