forked from devsam/core
f_config/app.php 삭제, AppConf 클래스로 통합
This commit is contained in:
@@ -5,7 +5,5 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '.');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
@@ -5,7 +5,5 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
+2
-5
@@ -1,11 +1,8 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.'/f_config/SETTING.php');
|
||||
|
||||
if($SETTING->isExists()) {
|
||||
require_once($SETTING->getSettingFile());
|
||||
if(AppConf::getRoot()->isExists()) {
|
||||
require_once(AppConf::getRoot()->getSettingFile());
|
||||
} else {
|
||||
Error('설정 파일이 없습니다. 설정을 먼저 하십시요!');
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.'/f_func/class._Mail.php');
|
||||
require_once(ROOT.'/f_config/SETTING.php');
|
||||
|
||||
if($SETTING->isExists()) {
|
||||
$MAIL = new _Mail();
|
||||
} else {
|
||||
Error('설정 파일이 없습니다. 설정을 먼저 하십시요!');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require_once('_common.php');
|
||||
|
||||
$SETTING = new Setting(__DIR__.'/..');
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require_once('_common.php');
|
||||
require_once(ROOT.'/f_func/class.Setting.php');
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
+4
-2
@@ -3,9 +3,11 @@ namespace sammo;
|
||||
|
||||
ob_start();
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require_once(__dir__.'/func.php');
|
||||
|
||||
|
||||
|
||||
define('__LINE__',__FILE__." ".__FUNCTION__." ".__LINE__." : ");
|
||||
|
||||
|
||||
define('IMAGE', '../../image');
|
||||
define('IMAGES', '../../images');
|
||||
//define('IMAGE', 'http://115.68.28.99/image');
|
||||
|
||||
@@ -5,8 +5,6 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -3,9 +3,6 @@ namespace sammo;
|
||||
|
||||
|
||||
require('_common.php');
|
||||
require(__DIR__.'/../f_config/SETTING.php');
|
||||
|
||||
|
||||
|
||||
session_start();
|
||||
session_destroy();
|
||||
@@ -28,7 +25,7 @@ if(strlen($password)!=128){
|
||||
]);
|
||||
}
|
||||
|
||||
if(!$SETTING->isExists()){
|
||||
if(!AppConf::getRoot()->isExists()){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'DB 설정이 완료되지 않았습니다.'
|
||||
|
||||
@@ -3,9 +3,6 @@ namespace sammo;
|
||||
|
||||
|
||||
require('_common.php');
|
||||
require(__DIR__.'/../f_config/SETTING.php');
|
||||
|
||||
|
||||
|
||||
function dbConnFail($params){
|
||||
Json::die([
|
||||
@@ -19,7 +16,7 @@ function dbSQLFail($params){
|
||||
]);
|
||||
}
|
||||
|
||||
if(!$SETTING->isExists()){
|
||||
if(!AppConf::getRoot()->isExists()){
|
||||
Json::die([
|
||||
'step'=>'config'
|
||||
]);
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
namespace sammo;
|
||||
|
||||
require('_common.php');
|
||||
require(__DIR__.'/../f_config/SETTING.php');
|
||||
|
||||
|
||||
|
||||
function dbConnFail($params){
|
||||
Json::die([
|
||||
@@ -48,7 +45,7 @@ if(file_exists(ROOT.'/d_setting/conf.php') && is_dir(ROOT.'/d_setting/conf.php')
|
||||
]);
|
||||
}
|
||||
|
||||
if($SETTING->isExists()){
|
||||
if(AppConf::getRoot()->isExists()){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'이미 conf.php 파일이 있습니다'
|
||||
|
||||
@@ -5,8 +5,5 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '.');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ if(!defined('ROOT')){
|
||||
}
|
||||
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ if(!is_uploaded_file($image['tmp_name'])) {
|
||||
|
||||
$servers = [];
|
||||
|
||||
foreach(getServerConfigList() as $key=>$server){
|
||||
foreach(AppConf::getList() as $key=>$server){
|
||||
$setting = $server[2];
|
||||
if($setting->isExists()){
|
||||
$servers[] = $key;
|
||||
|
||||
@@ -46,7 +46,7 @@ if($dt == $rf) {
|
||||
|
||||
$servers = [];
|
||||
|
||||
foreach(getServerConfigList() as $key=>$server){
|
||||
foreach(AppConf::getList() as $key=>$server){
|
||||
$setting = $server[2];
|
||||
if($setting->isExists()){
|
||||
$servers[] = $key;
|
||||
|
||||
@@ -32,7 +32,7 @@ if($userGrade < 6) {
|
||||
}
|
||||
|
||||
function doServerModeSet($server, $action, &$response){
|
||||
$serverList = getServerConfigList();
|
||||
$serverList = AppConf::getList();
|
||||
$settingObj = $serverList[$server][2];
|
||||
|
||||
$serverDir = $settingObj->getShortName();
|
||||
|
||||
@@ -11,7 +11,7 @@ $result = [];
|
||||
|
||||
session_write_close();
|
||||
|
||||
foreach (getServerConfigList() as $server) {
|
||||
foreach (AppConf::getList() as $server) {
|
||||
list($serverKorName, $serverColor, $setting) = $server;
|
||||
|
||||
$serverPath = $setting->getBasePath();
|
||||
|
||||
@@ -7,7 +7,7 @@ require_once(ROOT.'/f_config/DB.php');
|
||||
// 외부 파라미터
|
||||
$response['server'] = [];
|
||||
|
||||
foreach(getServerConfigList() as $serverInfo){
|
||||
foreach(AppConf::getList() as $serverInfo){
|
||||
list($serverKorName, $serverColor, $setting) = $serverInfo;
|
||||
|
||||
$serverObj = [
|
||||
|
||||
@@ -5,8 +5,5 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ if(!defined('ROOT')){
|
||||
}
|
||||
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -3,9 +3,8 @@ namespace sammo;
|
||||
|
||||
require('d_setting/conf_kakao.php');
|
||||
require('_common.php');
|
||||
require(ROOT.'/f_config/SETTING.php');
|
||||
|
||||
if(!$SETTING->isExists()){
|
||||
if(!AppConf::getRoot()->isExists()){
|
||||
header ('Location:install.php');
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
CustomHeader();
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ namespace sammo;
|
||||
|
||||
require_once('_common.php');
|
||||
require_once(__dir__.'/../d_setting/conf.php');
|
||||
require_once(__dir__.'/../f_func/func.php');
|
||||
|
||||
function checkUsernameDup($username){
|
||||
if(!$username){
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
if(!defined('ROOT')){
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
|
||||
class AppConf{
|
||||
private static $serverList = null;
|
||||
private static $rootSetting = null;
|
||||
|
||||
public static function getList(){
|
||||
if(self::$serverList === null){
|
||||
self::$serverList = [
|
||||
'che'=>['체', 'white', new Setting(ROOT.'/che')],
|
||||
'kwe'=>['퀘', 'yellow', new Setting(ROOT.'/kwe')],
|
||||
'pwe'=>['풰', 'orange', new Setting(ROOT.'/pwe')],
|
||||
'twe'=>['퉤', 'magenta', new Setting(ROOT.'/twe')],
|
||||
'hwe'=>['훼', 'red', new Setting(ROOT.'/hwe')]
|
||||
];
|
||||
}
|
||||
return self::$serverList;
|
||||
}
|
||||
|
||||
public static function getRoot(){
|
||||
if(self::$rootSetting === null){
|
||||
self::$rootSetting = new Setting(ROOT);
|
||||
}
|
||||
return self::$rootSetting;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
namespace sammo;
|
||||
|
||||
if(!defined('ROOT')){
|
||||
define('ROOT', '..');
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
class Lock {
|
||||
private static $l = ROOT.'/d_log/lock.txt';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
namespace sammo;
|
||||
|
||||
if(!defined('ROOT')){
|
||||
define('ROOT', '..');
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
class Session {
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class Setting {
|
||||
private $settingFile;
|
||||
private $exist = false;
|
||||
|
||||
public function __construct($basepath) {
|
||||
public function __construct($basepath = __DIR__.'/../..') {
|
||||
$this->basepath = $basepath;
|
||||
$this->settingFile = realpath($basepath.'/d_setting/conf.php');
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ if(!defined('ROOT')){
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
require_once(ROOT.'/f_config/config.php');
|
||||
require_once(ROOT.'/f_config/app.php');
|
||||
require_once(ROOT.'/f_func/func.php');
|
||||
|
||||
|
||||
CustomHeader();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
namespace sammo;
|
||||
|
||||
|
||||
require(__DIR__.'/../f_func/func.php');
|
||||
require(__DIR__.'/../f_func/config.php');
|
||||
require('func_install.php');
|
||||
|
||||
$session = Session::requireLogin();
|
||||
|
||||
Reference in New Issue
Block a user