qa-ifish7/web/Application/Admin/Controller/ConfigController.class.php

20 lines
713 B
PHP

<?php
namespace Admin\Controller;
use Think\Controller;
class ConfigController extends AdminController{
public function index(){
if(IS_POST){
$conarr=C("LOAD_EXT_CONFIG");
foreach($conarr as $conf){
$settingstr="<?php \n return ".var_export($_POST[$conf],true).";";//配置文件str
$setting_path=APP_PATH."Common/Conf/".$conf.".php";//配置文件路径
file_put_contents($setting_path,$settingstr);//保存到配置文件里
}
//
D("UserLog")->add("update","网站设置","-");
$this->success("保存成功",U("index"));
}
$this->display();
}
}