mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
* new hooks: LOGIN, LOGIN_ATTEMPT, LOGOUT
* fixed bug with uninstalling some plugin dirs * updated TODO
This commit is contained in:
@@ -180,6 +180,10 @@ class OTS_DB_MySQL extends OTS_Base_DB
|
||||
return $this->has_table_cache[$name];
|
||||
}
|
||||
|
||||
return $this->hasTableInternal($name);
|
||||
}
|
||||
|
||||
private function hasTableInternal($name) {
|
||||
global $config;
|
||||
return ($this->has_table_cache[$name] = $this->query("SELECT `TABLE_NAME` FROM `information_schema`.`tables` WHERE `TABLE_SCHEMA` = " . $this->quote($config['database_name']) . " AND `TABLE_NAME` = " . $this->quote($name) . " LIMIT 1;")->rowCount() > 0);
|
||||
}
|
||||
@@ -189,8 +193,25 @@ class OTS_DB_MySQL extends OTS_Base_DB
|
||||
return $this->has_column_cache[$table . '.' . $column];
|
||||
}
|
||||
|
||||
return $this->hasColumnInternal($table, $column);
|
||||
}
|
||||
|
||||
private function hasColumnInternal($table, $column) {
|
||||
return ($this->has_column_cache[$table . '.' . $column] = count($this->query("SHOW COLUMNS FROM `" . $table . "` LIKE '" . $column . "'")->fetchAll()) > 0);
|
||||
}
|
||||
|
||||
public function revalidateCache() {
|
||||
foreach($this->has_table_cache as $key => $value) {
|
||||
$this->hasTableInternal($key);
|
||||
}
|
||||
|
||||
foreach($this->has_column_cache as $key => $value) {
|
||||
$explode = explode('.', $key);
|
||||
if(isset($this->has_table_cache[$explode[0]]) && $this->has_table_cache[$explode[0]]) {// first check if table exist
|
||||
$this->hasColumnInternal($explode[0], $explode[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**#@-*/
|
||||
|
Reference in New Issue
Block a user