diff options
| author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2016-02-02 13:12:25 +0100 |
|---|---|---|
| committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2016-02-02 13:12:25 +0100 |
| commit | 8e100f000ed5f67f329e597851d81652b4055a53 (patch) | |
| tree | d49b061d43a0549904d75027a85a9e85faaa394d /phpBB/phpbb/extension/base.php | |
| parent | 15e9367b5b9add3197ea13658499d60de14baa54 (diff) | |
| parent | 27027deb9ce2076f64dbfdecba494efe1aa523dc (diff) | |
| download | forums-8e100f000ed5f67f329e597851d81652b4055a53.tar forums-8e100f000ed5f67f329e597851d81652b4055a53.tar.gz forums-8e100f000ed5f67f329e597851d81652b4055a53.tar.bz2 forums-8e100f000ed5f67f329e597851d81652b4055a53.tar.xz forums-8e100f000ed5f67f329e597851d81652b4055a53.zip | |
Merge pull request #4144 from VSEphpbb/ticket/14434
[ticket/14434] Allow non-migration files inside migrations folder (continued)
* VSEphpbb/ticket/14434:
[ticket/14434] Refactored to check migrations when setting them
[ticket/14434] Check migrations in the database updater task
[ticket/14434] Do not include non-migrations in CLI list
[ticket/14434] Remove redundant conditional
[ticket/14434] Fix whitespace mistakes
[ticket/14434] Remove recursion to simplify is_migration method
[ticket/14434] Extract migration check to a reusable method
[ticket/14434] Schema generator should ignore migration helpers
Diffstat (limited to 'phpBB/phpbb/extension/base.php')
| -rw-r--r-- | phpBB/phpbb/extension/base.php | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/phpBB/phpbb/extension/base.php b/phpBB/phpbb/extension/base.php index b647242b98..c7778cfed1 100644 --- a/phpBB/phpbb/extension/base.php +++ b/phpBB/phpbb/extension/base.php @@ -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,21 +133,9 @@ class base implements \phpbb\extension\extension_interface $migrations = $this->extension_finder->get_classes_from_files($migrations); - // Unset classes that do not exist or do not extend the - // abstract class phpbb\db\migration\migration - foreach ($migrations as $key => $migration) - { - if (class_exists($migration)) - { - $reflector = new \ReflectionClass($migration); - if ($reflector->implementsInterface('\phpbb\db\migration\migration_interface') && $reflector->isInstantiable()) - { - continue; - } - } + $this->migrator->set_migrations($migrations); - unset($migrations[$key]); - } + $migrations = $this->migrator->get_migrations(); return $migrations; } |
