aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/db')
-rw-r--r--phpBB/phpbb/db/migrator.php24
1 files changed, 21 insertions, 3 deletions
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
index 8f3b860b93..a1e93942cd 100644
--- a/phpBB/phpbb/db/migrator.php
+++ b/phpBB/phpbb/db/migrator.php
@@ -170,10 +170,28 @@ class migrator
*/
public function set_migrations($class_names)
{
+ foreach ($class_names as $key => $class)
+ {
+ if (!self::is_migration($class))
+ {
+ unset($class_names[$key]);
+ }
+ }
+
$this->migrations = $class_names;
}
/**
+ * Get the list of available migration class names
+ *
+ * @return array Array of all migrations available to be run
+ */
+ public function get_migrations()
+ {
+ return $this->migrations;
+ }
+
+ /**
* Runs a single update step from the next migration to be applied.
*
* The update step can either be a schema or a (partial) data update. To
@@ -226,7 +244,7 @@ class migrator
*/
protected function try_apply($name)
{
- if (!self::is_migration($name))
+ if (!class_exists($name))
{
$this->output_handler->write(array('MIGRATION_NOT_VALID', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
return false;
@@ -401,7 +419,7 @@ class migrator
*/
protected function try_revert($name)
{
- if (!self::is_migration($name))
+ if (!class_exists($name))
{
return false;
}
@@ -719,7 +737,7 @@ class migrator
return false;
}
- if (!self::is_migration($name))
+ if (!class_exists($name))
{
return $name;
}