本文整理汇总了PHP中sp_clear_cache函数的典型用法代码示例。如果您正苦于以下问题:PHP sp_clear_cache函数的具体用法?PHP sp_clear_cache怎么用?PHP sp_clear_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sp_clear_cache函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clean
public function clean()
{
if (sp_clear_cache()) {
$this->success('缓存已清除');
} else {
$this->error('缓存清楚失败!');
}
}
示例2: index_post
public function index_post()
{
$_POST = array_map('trim', I('post.'));
if (in_array('', $_POST)) {
$this->error("不能留空!");
}
$configs['SP_MAIL_ADDRESS'] = $_POST['address'];
$configs['SP_MAIL_SENDER'] = $_POST['sender'];
$configs['SP_MAIL_SMTP'] = $_POST['smtp'];
$configs['SP_MAIL_LOGINNAME'] = $_POST['loginname'];
$configs['SP_MAIL_PASSWORD'] = $_POST['password'];
$rst = sp_set_dynamic_config($configs);
sp_clear_cache();
if ($rst) {
$this->success("保存成功!");
} else {
$this->error("保存失败!");
}
}
示例3: index
public function index()
{
sp_clear_cache();
$this->success('缓存更新成功', U('Index/index'));
}
示例4: sp_set_dynamic_config
function sp_set_dynamic_config($data)
{
if (sp_is_sae()) {
$kv = new SaeKV();
$ret = $kv->init();
$configs = $kv->get("THINKCMF_DYNAMIC_CONFIG");
$configs = empty($configs) ? array() : unserialize($configs);
$configs = array_merge($configs, $data);
$result = $kv->set('THINKCMF_DYNAMIC_CONFIG', serialize($configs));
} elseif (defined('IS_BAE') && IS_BAE) {
$bae_mc = new BaeMemcache();
$configs = $bae_mc->get("THINKCMF_DYNAMIC_CONFIG");
$configs = empty($configs) ? array() : unserialize($configs);
$configs = array_merge($configs, $data);
$result = $bae_mc->set("THINKCMF_DYNAMIC_CONFIG", serialize($configs), MEMCACHE_COMPRESSED, 0);
} else {
$config_file = "./data/conf/config.php";
if (file_exists($config_file)) {
$configs = (include $config_file);
} else {
$configs = array();
}
$configs = array_merge($configs, $data);
$result = file_put_contents($config_file, "<?php\treturn " . var_export($configs, true) . ";?>");
}
sp_clear_cache();
return $result;
}
示例5: clearcache
function clearcache()
{
sp_clear_cache();
$this->display();
}