mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 23:37:39 +02:00
[ticket/13733] Properly handle nonexistent classes as well
PHPBB3-13733
This commit is contained in:
@@ -139,11 +139,21 @@ class base implements \phpbb\extension\extension_interface
|
|||||||
|
|
||||||
foreach ($migrations as $key => $migration)
|
foreach ($migrations as $key => $migration)
|
||||||
{
|
{
|
||||||
// If the class doesn't exist OR the class does not extend the migration class
|
// If the class exists and is a subclass of the
|
||||||
// we need to skip it.
|
// \phpbb\db\migration\migration abstract class
|
||||||
if (!class_exists($migration) || ($reflector = new \ReflectionClass($migration) && !$reflector->isSubclassOf('\phpbb\db\migration\migration'))) {
|
// we skip it.
|
||||||
unset($migrations[$key]);
|
|
||||||
|
// 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]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $migrations;
|
return $migrations;
|
||||||
|
Reference in New Issue
Block a user