mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-18 05:04:51 +08:00
38 lines
744 B
PHP
38 lines
744 B
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: jerry
|
|
* Date: 2019-03-16
|
|
* Time: 13:58
|
|
*/
|
|
|
|
namespace Framework;
|
|
|
|
/**
|
|
* 请不要diss此class的语法。可能写的很糟糕。
|
|
* Class GlobalConfig
|
|
*/
|
|
class GlobalConfig
|
|
{
|
|
private $config = null;
|
|
public $success = false;
|
|
|
|
public function __construct() {
|
|
/** @noinspection PhpIncludeInspection */
|
|
include_once DataProvider::getWorkingDir() . '/config/global.php';
|
|
global $config;
|
|
$this->success = true;
|
|
$this->config = $config;
|
|
}
|
|
|
|
public function get($key) {
|
|
$r = $this->config[$key] ?? null;
|
|
if ($r === null) return null;
|
|
return $r;
|
|
}
|
|
|
|
public function getAll() {
|
|
return $this->config;
|
|
}
|
|
}
|