diff options
author | David King <imkingdavid@gmail.com> | 2015-05-23 21:13:30 -0400 |
---|---|---|
committer | David King <imkingdavid@gmail.com> | 2015-05-23 21:13:30 -0400 |
commit | 65316cffafead1b0529dca50f4c110489615438a (patch) | |
tree | 12a15cc4dae89a762d02404d4a3211a98cb96077 /phpBB/phpbb/extension | |
parent | 4ecc13af83718e26e02afc9b8516a506ca5a26e1 (diff) | |
download | forums-65316cffafead1b0529dca50f4c110489615438a.tar forums-65316cffafead1b0529dca50f4c110489615438a.tar.gz forums-65316cffafead1b0529dca50f4c110489615438a.tar.bz2 forums-65316cffafead1b0529dca50f4c110489615438a.tar.xz forums-65316cffafead1b0529dca50f4c110489615438a.zip |
[ticket/13733] Allow tests the skip class validation
PHPBB3-13733
Diffstat (limited to 'phpBB/phpbb/extension')
-rw-r--r-- | phpBB/phpbb/extension/base.php | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/phpBB/phpbb/extension/base.php b/phpBB/phpbb/extension/base.php index 8e717e1beb..ed190f6aa5 100644 --- a/phpBB/phpbb/extension/base.php +++ b/phpBB/phpbb/extension/base.php @@ -121,9 +121,11 @@ class base implements \phpbb\extension\extension_interface /** * Get the list of migration files from this extension * + * @var bool $validate_classes Whether or not to check that the migration + * class exists and extends the base migration class. * @return array */ - protected function get_migration_file_list() + protected function get_migration_file_list($validate_classes = true) { if ($this->migrations !== false) { @@ -137,23 +139,26 @@ class base implements \phpbb\extension\extension_interface $migrations = $this->extension_finder->get_classes_from_files($migrations); - foreach ($migrations as $key => $migration) + if ($validate_classes) { - // If the class exists and is a subclass of the - // \phpbb\db\migration\migration abstract class - // we skip it. - - // Otherwise, i.e. if it doesn't exist or it is - // not an extend the abstract class, we unset it - if (class_exists($migration)) { - $reflector = new \ReflectionClass($migration); - if ($reflector->isSubclassOf('\phpbb\db\migration\migration')) { - continue; + foreach ($migrations as $key => $migration) + { + // If the class exists and is a subclass of the + // \phpbb\db\migration\migration abstract class + // we skip it. + + // Otherwise, i.e. if it doesn't exist or it is + // not an extend the abstract class, we unset it + if (class_exists($migration)) { + $reflector = new \ReflectionClass($migration); + if ($reflector->isSubclassOf('\phpbb\db\migration\migration')) { + continue; + } + } + unset($migrations[$key]); } - - unset($migrations[$key]); } return $migrations; |