作者:推广中医 | 来源:互联网 | 2018-03-22 19:20
// 写入配置文件的变量
public static function rewriteConfig($key, $value) {
$path = app_path() . '/storage/Config.php';
$cOntents= file_get_contents($path);
$cOntents= str_replace(self::loadConfig($key), $value, $contents);
file_put_contents($path, $contents);
}
// 读取配置文件的变量
public static function loadConfig($key) {
$COnfig= require(app_path() . '/storage/Config.php');
return $Congig[$key];
}