1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/14434] Refactored to check migrations when setting them

PHPBB3-14434
This commit is contained in:
Matt Friedman
2016-01-28 11:22:30 -08:00
parent fb1acb0ef4
commit 27027deb9c
6 changed files with 26 additions and 38 deletions

View File

@@ -73,9 +73,7 @@ class base implements \phpbb\extension\extension_interface
*/
public function enable_step($old_state)
{
$migrations = $this->get_migration_file_list();
$this->migrator->set_migrations($migrations);
$this->get_migration_file_list();
$this->migrator->update();
@@ -103,8 +101,6 @@ class base implements \phpbb\extension\extension_interface
{
$migrations = $this->get_migration_file_list();
$this->migrator->set_migrations($migrations);
foreach ($migrations as $migration)
{
while ($this->migrator->migration_state($migration) !== false)
@@ -137,16 +133,9 @@ class base implements \phpbb\extension\extension_interface
$migrations = $this->extension_finder->get_classes_from_files($migrations);
// Unset classes that are not a valid migration
foreach ($migrations as $key => $migration)
{
if (\phpbb\db\migrator::is_migration($migration) === true)
{
continue;
}
$this->migrator->set_migrations($migrations);
unset($migrations[$key]);
}
$migrations = $this->migrator->get_migrations();
return $migrations;
}