ѡ̳
标题:
站点设置
[打印本页]
作者:
admin
时间:
2017-11-5 18:23
标题:
站点设置
多站点设置问题 待处理,区分系统设置
作者:
admin
时间:
2017-11-5 23:17
已完成设置管理。新增sysconfig.php 文件存放配置文件
function set_config($config, $filename="sysconfig") {
$configfile = APP_PATH.DIRECTORY_SEPARATOR.MODULE_NAME.DIRECTORY_SEPARATOR.'Conf'.DIRECTORY_SEPARATOR.$filename.'.php';
if(!is_writable($configfile)) showmessage('Please chmod '.$configfile.' to 0777 !');
$pattern = $replacement = array();
foreach($config as $k=>$v) {
if(in_array($k,array('js_path','css_path','img_path','attachment_stat','admin_log','gzip','errorlog','phpsso','phpsso_appid','phpsso_api_url','phpsso_auth_key','phpsso_version','connect_enable', 'upload_url','sina_akey', 'sina_skey', 'snda_enable', 'snda_status', 'snda_akey', 'snda_skey', 'qq_akey', 'qq_skey','qq_appid','qq_appkey','qq_callback','admin_url'))) {
$v = trim($v);
$configs[$k] = $v;
$pattern[$k] = "/'".$k."'\s*=>\s*([']?)[^']*([']?)(\s*),/is";
$replacement[$k] = "'".$k."' => \${1}".$v."\${2}\${3},";
}
}
$str = file_get_contents($configfile);
$str = preg_replace($pattern, $replacement, $str);
return C('lock_ex') ? file_put_contents($configfile, $str, LOCK_EX) : file_put_contents($configfile, $str);
}
复制代码
欢迎光临 ѡ̳ (http://www.sunminxuan.cn/bbs/)
Powered by Discuz! X3.4