clear() public method

public clear ( $key )
 /**
  * @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;
 }
Beispiel #2
0
<?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');
Beispiel #3
0
 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();
         }
     }
 }