diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2013-02-27 00:12:51 +0100 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2013-02-27 00:12:51 +0100 |
| commit | f76f36c6693d8c4545d45f1454db102b1b313d07 (patch) | |
| tree | f28782ba502d833e5f95491a420dd0f8c31b04a9 /phpBB/includes/db/migrator.php | |
| parent | d61eb95b4868377cfc2a7a98b03a7d908418b1af (diff) | |
| parent | 80bd78a5e5e1069773c05073cd47662a311bda79 (diff) | |
| download | forums-f76f36c6693d8c4545d45f1454db102b1b313d07.tar forums-f76f36c6693d8c4545d45f1454db102b1b313d07.tar.gz forums-f76f36c6693d8c4545d45f1454db102b1b313d07.tar.bz2 forums-f76f36c6693d8c4545d45f1454db102b1b313d07.tar.xz forums-f76f36c6693d8c4545d45f1454db102b1b313d07.zip | |
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into ticket/10411-2
* 'develop' of https://github.com/phpbb/phpbb3:
[ticket/11367] Always freeresult
[ticket/11367] Migrator throws error if migrations table does not exist
[feature/migrations] Inject migrator rather than the container.
[feature/migrations] Use the user class for language handling
[feature/migrations] Fully revert the removal of the user_msnm field
[feature/migrations] Revert unrelated change to schema_data.sql
[feature/migrations] Remove user_msnm migration
[feature/migrations] Correct depends_on
[feature/migrations] Subdirectories for migration data
[feature/migrations] Reports table schema changes in recent develop
[feature/migrations] Automatically populate migrations table on install
[feature/migrations] effectively installed check for migration data
[feature/migrations] Comments for the return in the custom functions
[feature/migrations] Order the migrations schema in schema_data.sql
[feature/migrations] Fix migrations installer, schema for schema_data.sql
[feature/migrations] Make depends_on static to call it without dependencies
[feature/migrations] Remove hardcoded language, use lang instead.
[feature/migrations] Revert schema for migration data
[feature/migrations] Replace database_update.php with migrations updater
[feature/migrations] Rebuilding migrations data on develop
Diffstat (limited to 'phpBB/includes/db/migrator.php')
| -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); } /** |
