From 7d2a58e27100e5c776b44223e2cc6837c293db02 Mon Sep 17 00:00:00 2001
From: Matt Friedman <maf675@gmail.com>
Date: Tue, 26 Jan 2016 11:45:06 -0800
Subject: [ticket/14434] Schema generator should ignore migration helpers

PHPBB3-14434
---
 phpBB/phpbb/db/migration/schema_generator.php | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(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 7003844bc4..55ab4452ed 100644
--- a/phpBB/phpbb/db/migration/schema_generator.php
+++ b/phpBB/phpbb/db/migration/schema_generator.php
@@ -77,8 +77,18 @@ class schema_generator
 		$check_dependencies = true;
 		while (!empty($migrations))
 		{
-			foreach ($migrations as $migration_class)
+			foreach ($migrations as $key => $migration_class)
 			{
+				if (class_exists($migration_class))
+				{
+					$reflector = new \ReflectionClass($migration_class);
+					if (!$reflector->implementsInterface('\phpbb\db\migration\migration_interface') || !$reflector->isInstantiable())
+					{
+						unset($migrations[$key]);
+						continue;
+					}
+				}
+
 				$open_dependencies = array_diff($migration_class::depends_on(), $tree);
 
 				if (empty($open_dependencies))
-- 
cgit v1.2.1