mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-10 02:05:34 +08:00
initial commit
This commit is contained in:
33
src/Framework/GlobalConfig.php
Normal file
33
src/Framework/GlobalConfig.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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 WORKING_DIR.'/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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user