mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: recache tables if cache is empty
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@103606 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
7f0677cb1d
commit
907f6f7ead
@ -35,7 +35,7 @@ class ClassInfo {
|
||||
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) {
|
||||
if(empty(self::$_cache_all_tables)) {
|
||||
self::$_cache_all_tables = array();
|
||||
$tables = DB::query(DB::getConn()->allTablesSQL())->column();
|
||||
foreach($tables as $table) self::$_cache_all_tables[strtolower($table)] = true;
|
||||
|
Loading…
Reference in New Issue
Block a user