/** * @todo Move this to Database or DB */ static function hasTable($class) { if (DB::isActive()) { // Cache the list of all table names to reduce on DB traffic if (self::$_cache_all_tables === null) { self::$_cache_all_tables = array(); $tables = DB::query("SHOW TABLES")->column(); foreach ($tables as $table) { self::$_cache_all_tables[strtolower($table)] = true; } } return isset(self::$_cache_all_tables[strtolower($class)]); } else { return false; } }
static function reset_db_cache() { self::$_cache_all_tables = null; }
public static function reset_db_cache() { self::$_cache_all_tables = null; self::$_cache_ancestry = array(); }