forked from devsam/core
Setting 클래스들 접근 방법을 변경
-global 없이 사용가능 -isExist()를 isExists()로 변경
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.'/f_config/SETTING.php');
|
||||
|
||||
if($SETTING->isExist()) {
|
||||
if($SETTING->isExists()) {
|
||||
require_once($SETTING->getSettingFile());
|
||||
} else {
|
||||
Error('설정 파일이 없습니다. 설정을 먼저 하십시요!');
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ require_once('_common.php');
|
||||
require_once(ROOT.'/f_func/class._Mail.php');
|
||||
require_once(ROOT.'/f_config/SETTING.php');
|
||||
|
||||
if($SETTING->isExist()) {
|
||||
if($SETTING->isExists()) {
|
||||
$MAIL = new _Mail();
|
||||
} else {
|
||||
Error('설정 파일이 없습니다. 설정을 먼저 하십시요!');
|
||||
|
||||
+14
-7
@@ -17,10 +17,17 @@ define('MEMBER', 'member');
|
||||
define('MANAGE', 'manage');
|
||||
define('ICON', 'icon');
|
||||
|
||||
$serverList = [
|
||||
'che'=>['체', 'white', new _Setting(__DIR__.'/../che')],
|
||||
'kwe'=>['퀘', 'yellow', new _Setting(__DIR__.'/../kwe')],
|
||||
'pwe'=>['풰', 'orange', new _Setting(__DIR__.'/../pwe')],
|
||||
'twe'=>['퉤', 'magenta', new _Setting(__DIR__.'/../twe')],
|
||||
'hwe'=>['훼', 'red', new _Setting(__DIR__.'/../hwe')]
|
||||
];
|
||||
function getServerConfigList(){
|
||||
static $serverList = null;
|
||||
if($serverList !== null){
|
||||
return $serverList;
|
||||
}
|
||||
$serverList = [
|
||||
'che'=>['체', 'white', new _Setting(__DIR__.'/../che')],
|
||||
'kwe'=>['퀘', 'yellow', new _Setting(__DIR__.'/../kwe')],
|
||||
'pwe'=>['풰', 'orange', new _Setting(__DIR__.'/../pwe')],
|
||||
'twe'=>['퉤', 'magenta', new _Setting(__DIR__.'/../twe')],
|
||||
'hwe'=>['훼', 'red', new _Setting(__DIR__.'/../hwe')]
|
||||
];
|
||||
return $serverList;
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class _Setting {
|
||||
}
|
||||
}
|
||||
|
||||
public function isExist() {
|
||||
public function isExists() {
|
||||
return $this->exist;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ if(strlen($password)!=128){
|
||||
]);
|
||||
}
|
||||
|
||||
if(!$SETTING->isExist()){
|
||||
if(!$SETTING->isExists()){
|
||||
returnJson([
|
||||
'result'=>false,
|
||||
'reason'=>'DB 설정이 완료되지 않았습니다.'
|
||||
|
||||
@@ -17,7 +17,7 @@ function dbSQLFail($params){
|
||||
]);
|
||||
}
|
||||
|
||||
if(!$SETTING->isExist()){
|
||||
if(!$SETTING->isExists()){
|
||||
returnJson([
|
||||
'step'=>'config'
|
||||
]);
|
||||
|
||||
@@ -48,7 +48,7 @@ if(file_exists(ROOT.'/d_setting/conf.php') && is_dir(ROOT.'/d_setting/conf.php')
|
||||
]);
|
||||
}
|
||||
|
||||
if($SETTING->isExist()){
|
||||
if($SETTING->isExists()){
|
||||
returnJson([
|
||||
'result'=>false,
|
||||
'reason'=>'이미 conf.php 파일이 있습니다'
|
||||
|
||||
@@ -25,7 +25,7 @@ $db = getRootDB();
|
||||
$member = $db->queryFirstRow('SELECT `GRADE` FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
|
||||
|
||||
function doServerModeSet($server, $select, &$response){
|
||||
global $serverList;
|
||||
$serverList = getServerConfigList();
|
||||
$settingObj = $serverList[$server][2];
|
||||
|
||||
$serverDir = $settingObj->getShortName();
|
||||
|
||||
@@ -6,14 +6,14 @@ require_once(ROOT.'/f_config/SESSION.php');
|
||||
// 외부 파라미터
|
||||
$response['server'] = [];
|
||||
|
||||
foreach($serverList as $serverInfo){
|
||||
foreach(getServerConfigList() as $serverInfo){
|
||||
list($serverKorName, $serverColor, $setting) = $serverInfo;
|
||||
|
||||
$serverObj = [
|
||||
'color'=>$serverColor,
|
||||
'korName'=>$serverKorName,
|
||||
'name'=>$setting->getShortName(),
|
||||
'enable'=>$setting->isExist()
|
||||
'enable'=>$setting->isExists()
|
||||
];
|
||||
|
||||
$response['server'][] = $serverObj;
|
||||
|
||||
Reference in New Issue
Block a user