配置参数管理
  wecenter的配置有两种:
  · system_setting规范化的键值对,通过get_setting访问
  · 由core_config管理的各类异构配置数据
  get_setting
  使用方式
  get_setting('weibo_msg_enabled')
  实现
system/functions.inc.php
function get_setting($varname = null, $permission_check = true)
{
if (! class_exists('AWS_APP', false))
{
return false;
}
if ($settings = AWS_APP::$settings)
{
// AWS_APP::session()->permission 是指当前用户所在用户组的权限许可项,在 users_group 表中,你可以看到 permission 字段
if ($permission_check AND $settings['upload_enable'] == 'Y')
{
if (AWS_APP::session())
{
if (!AWS_APP::session()->permission['upload_attach'])
{
$settings['upload_enable'] = 'N';
}
}
}
}
if ($varname)
{
return $settings[$varname];
}
else
{
return $settings;
}
}
  AWS_APP::$settings是从数据库加载的内容
  system/aws_app.inc.php#init
  self::$settings = self::model('setting')->get_settings();
  models/setting.php#get_settings
public function get_settings()
{
if ($system_setting = $this->fetch_all('system_setting'))
{
foreach ($system_setting as $key => $val)
{
if ($val['value'])
{
$val['value'] = unserialize($val['value']);
}
$settings[$val['varname']] = $val['value'];
}
}
return $settings;
}
  system_setting表中的数据有安装脚本插入,内容皆为键值对
  install/system_settings.sql
INSERT INTO `[#DB_PREFIX#]system_setting` (`varname`, `value`) VALUES
('site_name', 's:8:"WeCenter";'),
('description', 's:30:"WeCenter 社交化知识社区";'),
('keywords', 's:47:"WeCenter,知识社区,社交社区,问答社区";'),
('sensitive_words', 's:0:"";'),
('def_focus_uids', 's:1:"1";'),
('answer_edit_time', 's:2:"30";'),
('cache_level_high', 's:2:"60";'),
...