f_config/app.php 삭제, AppConf 클래스로 통합

This commit is contained in:
2018-03-24 22:50:46 +09:00
parent e97bb32fba
commit 2cf6d0f01a
33 changed files with 51 additions and 102 deletions
+31
View File
@@ -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
View File
@@ -2,7 +2,7 @@
namespace sammo;
if(!defined('ROOT')){
define('ROOT', '..');
define('ROOT', '../..');
}
class Lock {
private static $l = ROOT.'/d_log/lock.txt';
+1 -1
View File
@@ -2,7 +2,7 @@
namespace sammo;
if(!defined('ROOT')){
define('ROOT', '..');
define('ROOT', '../..');
}
class Session {
+1 -1
View File
@@ -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');