make use of this

This commit is contained in:
Shish 2009-01-21 23:21:03 -08:00
parent 2c37ce9a8d
commit 0ff11d71ed

View file

@ -124,13 +124,13 @@ class DatabaseConfig extends BaseConfig {
public function DatabaseConfig($database) { public function DatabaseConfig($database) {
$this->database = $database; $this->database = $database;
$cached = $database->cache->get("config"); $cached = $this->database->cache->get("config");
if($cached) { if($cached) {
$this->values = $cached; $this->values = $cached;
} }
else { else {
$this->values = $this->database->db->GetAssoc("SELECT name, value FROM config"); $this->values = $this->database->db->GetAssoc("SELECT name, value FROM config");
$database->cache->set("config", $this->values); $this->database->cache->set("config", $this->values);
} }
} }
@ -147,7 +147,7 @@ class DatabaseConfig extends BaseConfig {
$this->database->Execute("DELETE FROM config WHERE name = ?", array($name)); $this->database->Execute("DELETE FROM config WHERE name = ?", array($name));
$this->database->Execute("INSERT INTO config VALUES (?, ?)", array($name, $this->values[$name])); $this->database->Execute("INSERT INTO config VALUES (?, ?)", array($name, $this->values[$name]));
} }
$database->cache->delete("config"); $this->database->cache->delete("config");
} }
} }
?> ?>