diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-02-09 20:56:42 -0600 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-02-09 20:56:42 -0600 |
commit | cacaffee6e013e43b75212d49960922f88f9f69a (patch) | |
tree | a5bd9ded0a93bd68f9bb7e4ac9cd729d95fdab9e /phpBB/includes/db/migrator.php | |
parent | fa33eae556c248ef6b2d41d9c9203b29e23dfb3a (diff) | |
download | forums-cacaffee6e013e43b75212d49960922f88f9f69a.tar forums-cacaffee6e013e43b75212d49960922f88f9f69a.tar.gz forums-cacaffee6e013e43b75212d49960922f88f9f69a.tar.bz2 forums-cacaffee6e013e43b75212d49960922f88f9f69a.tar.xz forums-cacaffee6e013e43b75212d49960922f88f9f69a.zip |
[feature/migrations] Add language strings for migrations errors
Unfulfillable returns string of the missing dependency name now if
the migration is unfulfillable (this is significantly more helpful).
PHPBB3-11351
Diffstat (limited to 'phpBB/includes/db/migrator.php')
-rw-r--r-- | phpBB/includes/db/migrator.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/phpBB/includes/db/migrator.php b/phpBB/includes/db/migrator.php index 4456600b0a..3c311e96d7 100644 --- a/phpBB/includes/db/migrator.php +++ b/phpBB/includes/db/migrator.php @@ -228,9 +228,10 @@ class phpbb_db_migrator { foreach ($this->migrations as $name) { - if ($this->unfulfillable($name)) + $unfulfillable = $this->unfulfillable($name); + if ($unfulfillable !== false) { - throw new phpbb_db_migration_exception('MIGRATION NOT FULFILLABLE', $name); + throw new phpbb_db_migration_exception('MIGRATION_NOT_FULFILLABLE', $name, $unfulfillable); } } } @@ -674,13 +675,13 @@ class phpbb_db_migrator * Checks if a migration's dependencies can even theoretically be satisfied. * * @param string $name The class name of the migration - * @return bool Whether the migration cannot be fulfilled + * @return bool|string False if fulfillable, string of missing migration name if unfulfillable */ public function unfulfillable($name) { if (isset($this->migration_state[$name])) { - return false; + return $name; } if (!class_exists($name)) @@ -693,9 +694,10 @@ class phpbb_db_migrator foreach ($depends as $depend) { - if ($this->unfulfillable($depend)) + $unfulfillable = $this->unfulfillable($depend); + if ($unfulfillable !== false) { - return true; + return $unfulfillable; } } @@ -715,7 +717,7 @@ class phpbb_db_migrator { // skip unfulfillable migrations, but fulfillables mean we // are not finished yet - if ($this->unfulfillable($name)) + if ($this->unfulfillable($name) !== false) { continue; } |