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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user