diff options
author | David King <imkingdavid@gmail.com> | 2013-02-26 15:46:08 -0500 |
---|---|---|
committer | David King <imkingdavid@gmail.com> | 2013-02-26 15:46:08 -0500 |
commit | 80bd78a5e5e1069773c05073cd47662a311bda79 (patch) | |
tree | ec86f04512c281ba2d8150cd95004ca629539978 | |
parent | 82b20cc2579f8109e2d3370866699c21a1b658bf (diff) | |
parent | 9a319fefb2ffed58da1d3339d59e53de09521e03 (diff) | |
download | forums-80bd78a5e5e1069773c05073cd47662a311bda79.tar forums-80bd78a5e5e1069773c05073cd47662a311bda79.tar.gz forums-80bd78a5e5e1069773c05073cd47662a311bda79.tar.bz2 forums-80bd78a5e5e1069773c05073cd47662a311bda79.tar.xz forums-80bd78a5e5e1069773c05073cd47662a311bda79.zip |
Merge remote-tracking branch 'EXreaction/ticket/11367' into develop
# By Nathan Guse (1) and Nathaniel Guse (1)
# Via Nathan Guse
* EXreaction/ticket/11367:
[ticket/11367] Always freeresult
[ticket/11367] Migrator throws error if migrations table does not exist
-rw-r--r-- | phpBB/includes/db/migrator.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/phpBB/includes/db/migrator.php b/phpBB/includes/db/migrator.php index 41d996b1e3..74f71775f3 100644 --- a/phpBB/includes/db/migrator.php +++ b/phpBB/includes/db/migrator.php @@ -99,18 +99,26 @@ class phpbb_db_migrator { $this->migration_state = array(); + // prevent errors in case the table does not exist yet + $this->db->sql_return_on_error(true); + $sql = "SELECT * FROM " . $this->migrations_table; $result = $this->db->sql_query($sql); - while ($migration = $this->db->sql_fetchrow($result)) + if (!$this->db->sql_error_triggered) { - $this->migration_state[$migration['migration_name']] = $migration; + while ($migration = $this->db->sql_fetchrow($result)) + { + $this->migration_state[$migration['migration_name']] = $migration; - $this->migration_state[$migration['migration_name']]['migration_depends_on'] = unserialize($migration['migration_depends_on']); + $this->migration_state[$migration['migration_name']]['migration_depends_on'] = unserialize($migration['migration_depends_on']); + } } $this->db->sql_freeresult($result); + + $this->db->sql_return_on_error(false); } /** |