cacheyness

git-svn-id: file:///home/shish/svn/shimmie2/trunk@451 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish
2007-08-08 05:47:23 +00:00
parent ad283be35f
commit ea65ce6605
2 changed files with 326 additions and 1 deletions

View File

@@ -74,7 +74,20 @@ class Database {
}
public function execute($query, $args=array()) {
$result = $this->db->Execute($query, $args);
return $this->error_check($this->db->Execute($query, $args));
}
public function cache_execute($time, $query, $args=array()) {
global $config;
if($config->get_bool('db_cache')) {
return $this->db->CacheExecute($time, $query, $args);
}
else {
return $this->error_check($this->db->Execute($query, $args));
}
}
private function error_check($result) {
if($result === False) {
print "SQL Error: " . $this->db->ErrorMsg() . "<br>";
print "Query: $query";