mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@202 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
0463fa5b58
commit
9a9f9af0bc
14 changed files with 162 additions and 1 deletions
|
|
@ -37,6 +37,29 @@
|
|||
return $this->insertModule($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈의 기본 정보 입력
|
||||
* 모듈의 정보를 입력받은 데이터를 serialize하여 등록한다.
|
||||
**/
|
||||
function insertModuleConfig($module, $config) {
|
||||
// 변수 정리
|
||||
$args->module = $module;
|
||||
$args->config = serialize($config);
|
||||
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
// 일단 삭제 (캐쉬 파일도 지운다)
|
||||
$output = $oDB->executeQuery('module.deleteModuleConfig', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
@unlink( sprintf('./files/cache/module_info/%s.config.php',$module) );
|
||||
|
||||
// 변수 정리후 query 실행
|
||||
$output = $oDB->executeQuery('module.insertModuleConfig', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈 입력
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -279,6 +279,31 @@
|
|||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 모듈의 설정 정보 return
|
||||
* 캐시된 설정 정보가 없으면 만들 후 캐시하고 return
|
||||
**/
|
||||
function getModuleConfig($module) {
|
||||
$cache_file = sprintf('./files/cache/module_info/%s.config.php',$module);
|
||||
if(!file_exists($cache_file)) {
|
||||
// DB 객체 생성
|
||||
$oDB = &DB::getInstance();
|
||||
$args->module = $module;
|
||||
$output = $oDB->executeQuery('module.getModuleConfig', $args);
|
||||
|
||||
$config = $output->data;
|
||||
|
||||
$buff = sprintf('<?php if(!__ZB5__) exit(); $config = "%s"; ?>', $config);
|
||||
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
}
|
||||
|
||||
if(file_exists($cache_file)) @include($cache_file);
|
||||
|
||||
return unserialize($config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
|
||||
**/
|
||||
|
|
|
|||
8
modules/module/queries/deleteModuleConfig.xml
Normal file
8
modules/module/queries/deleteModuleConfig.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteModuleConfig" action="delete">
|
||||
<tables>
|
||||
<table name="module_config" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module" var="module" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/module/queries/getModuleConfig.xml
Normal file
11
modules/module/queries/getModuleConfig.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getModuleConfig" action="select">
|
||||
<tables>
|
||||
<table name="module_config" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="config" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module" var="module" />
|
||||
</conditions>
|
||||
</query>
|
||||
10
modules/module/queries/insertModuleConfig.xml
Normal file
10
modules/module/queries/insertModuleConfig.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<query id="insertModuleConfig" action="insert">
|
||||
<tables>
|
||||
<table name="module_config" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="module" default="module" notnull="notnull" />
|
||||
<column name="config" var="config" />
|
||||
<column name="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
5
modules/module/schemas/module_config.xml
Normal file
5
modules/module/schemas/module_config.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<table name="module_config">
|
||||
<column name="module" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="config" type="text" />
|
||||
<column name="regdate" type="date" />
|
||||
</table>
|
||||
Loading…
Add table
Add a link
Reference in a new issue