示例#1
0
 function saveSetting($key, $value)
 {
     $pluginid = $this->getPluginId();
     $vars = CACHE::get('plugin');
     if (!$vars) {
         $vars = array();
     }
     if (!$vars[$pluginid]) {
         $vars[$pluginid] = array();
     }
     $vars[$pluginid][$key] = $value;
     DB::query("REPLACE INTO plugin_var SET `key` = '" . addslashes($key) . "', `value` = '" . addslashes($value) . "', pluginid='" . addslashes($pluginid) . "'");
     CACHE::clean('plugin');
 }
示例#2
0
function saveSetting($k, $v)
{
    if (!defined('IN_XAE') && $k == 'version') {
        return saveVersion($v);
    }
    static $cache_cleaned = false;
    $v = addslashes($v);
    DB::query("REPLACE INTO setting SET v='{$v}', k='{$k}'");
    if ($cache_cleaned) {
        return;
    }
    CACHE::clean('setting');
    $cache_cleaned = true;
}