From 47d8aeebde6f763ec7247daf0df16dd2388b25b6 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 27 Jan 2016 10:50:22 -0800 Subject: [ticket/14434] Extract migration check to a reusable method PHPBB3-14434 --- phpBB/phpbb/db/migration/schema_generator.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php index 55ab4452ed..dc685bb161 100644 --- a/phpBB/phpbb/db/migration/schema_generator.php +++ b/phpBB/phpbb/db/migration/schema_generator.php @@ -79,14 +79,12 @@ class schema_generator { foreach ($migrations as $key => $migration_class) { - if (class_exists($migration_class)) + // Unset classes that do not exist or do not extend the + // abstract class phpbb\db\migration\migration + if (\phpbb\db\migrator::is_migration($migration_class) === false) { - $reflector = new \ReflectionClass($migration_class); - if (!$reflector->implementsInterface('\phpbb\db\migration\migration_interface') || !$reflector->isInstantiable()) - { - unset($migrations[$key]); - continue; - } + unset($migrations[$key]); + continue; } $open_dependencies = array_diff($migration_class::depends_on(), $tree); -- cgit v1.2.1