aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/extension/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/extension/base.php')
-rw-r--r--phpBB/phpbb/extension/base.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/phpBB/phpbb/extension/base.php b/phpBB/phpbb/extension/base.php
index 5bb530bad4..b647242b98 100644
--- a/phpBB/phpbb/extension/base.php
+++ b/phpBB/phpbb/extension/base.php
@@ -24,7 +24,7 @@ class base implements \phpbb\extension\extension_interface
protected $container;
/** @var \phpbb\finder */
- protected $finder;
+ protected $extension_finder;
/** @var \phpbb\db\migrator */
protected $migrator;
@@ -137,6 +137,22 @@ 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;
+ }
+ }
+
+ unset($migrations[$key]);
+ }
+
return $migrations;
}
}