本文整理汇总了PHP中cache::clear方法的典型用法代码示例。如果您正苦于以下问题:PHP cache::clear方法的具体用法?PHP cache::clear怎么用?PHP cache::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cache
的用法示例。
在下文中一共展示了cache::clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
/**
* @author Mauricio Giraldo
* @desc Executes a query stores in $sql variable
* @version 1.0 03/05/2010
* @param None
* @return Boolean
*/
public function query($sql = "")
{
if (!$sql) {
$sql = $this->sql;
}
// Validate malicious code is not present:
//if (!strpos(strtolower($sql), "alter") && !strpos(strtolower($sql), "drop") && !strpos(strtolower($sql), "create")) {
logFactory::log($this, $sql);
$this->RES = mysql_query($sql) or logFactory::error($this, mysql_error());
//$this->RES = mysql_query($sql) or print(mysql_error().":".$sql);
$cache = new cache();
if (${$_POST}["do"] == "insert_exec" && $_POST["do"] != "insert_exec" && $_POST["do"] != "edit_exec") {
$cache->clear();
}
return true;
//}
//else
//return false;
}
示例2: template
<?php
if ($action == 'deleteCache') {
cache::clear();
pageCache::clearAll();
extension::get('SETTINGS_DELETE_CACHE');
echo message::success(lang::get('delete_cache_success'), true);
}
if ($action == 'loadTemplate') {
$template = new template(dyn::get('template'));
if ($template->install(true) !== true) {
echo message::danger(lang::get('load_template_failed'), true);
} else {
echo message::success(lang::get('load_template_success'), true);
}
}
?>
<div class="row">
<div class="col-lg-8">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title pull-left"><?php
echo lang::get('general');
?>
</h3>
<div class="pull-right">
<a href="<?php
echo url::backend('settings', ['subpage' => 'main', 'action' => 'deleteCache']);
?>
" class="btn btn-sm btn-default"><?php
echo lang::get('delete_cache');
示例3: clear
function clear()
{
if (function_exists('\\apcu_clear_cache')) {
\apcu_clear_cache();
} else {
if (function_exists('\\apc_clear_cache')) {
\apc_clear_cache('user');
} else {
parent::clear();
}
}
}