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