Setting 클래스 변경. 해당 클래스에서 한국어명 등을 모두 관리.

- 해당 클래스를 참조하는 코드들 수정
This commit is contained in:
2018-03-25 17:56:07 +09:00
parent b7c03e5554
commit 7a34cc4089
8 changed files with 99 additions and 22 deletions
+34 -2
View File
@@ -4,23 +4,55 @@ namespace sammo;
class Setting {
private $basepath;
private $settingFile;
private $htaccessFile;
private $exist = false;
private $running = false;
public function __construct($basepath = __DIR__.'/../..') {
private $shortName;
private $korName;
private $color;
public function __construct(string $basepath, string $korName, string $color, string $name=null) {
$this->basepath = $basepath;
$this->settingFile = realpath($basepath.'/d_setting/DB.php');
$this->htaccessFile = realpath($basepath.'/.htaccess');
$this->korName = $korName;
$this->color = $color;
if($name){
$this->shortName = $name;
}
else{
$this->shortName = basename($this->basepath);
}
if(file_exists($this->settingFile)) {
$this->exist = true;
if(!file_exists($this->htaccessFile)){
$this->running = true;
}
}
}
public function isRunning(){
return $this->running;
}
public function isExists() {
return $this->exist;
}
public function getShortName(){
return basename($this->basepath);
return $this->shortName;
}
public function getColor(){
return $this->color;
}
public function getKorName(){
return $this->korName;
}
public function getBasePath(){