1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-25 04:23:38 +01:00

[ticket/14434] Schema generator should ignore migration helpers

PHPBB3-14434
This commit is contained in:
Matt Friedman 2016-01-26 11:45:06 -08:00
parent ad914a6880
commit 7d2a58e271

View File

@ -77,8 +77,18 @@ class schema_generator
$check_dependencies = true; $check_dependencies = true;
while (!empty($migrations)) 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); $open_dependencies = array_diff($migration_class::depends_on(), $tree);
if (empty($open_dependencies)) if (empty($open_dependencies))