[ticket/12784] Shearch the "vendor" folders and then the autoload.php files

PHPBB3-12784
This commit is contained in:
Tristan Darricau 2014-07-03 11:26:07 +02:00
parent fbc15407a2
commit 520f3b3bd6

View file

@ -36,13 +36,17 @@ function phpbb_load_extensions_autoloaders($phpbb_root_path)
), ),
\RecursiveIteratorIterator::SELF_FIRST \RecursiveIteratorIterator::SELF_FIRST
); );
$iterator->setMaxDepth(3); $iterator->setMaxDepth(2);
foreach ($iterator as $file_info) foreach ($iterator as $file_info)
{ {
if ($file_info->getFilename() === 'autoload.php' && $file_info->getPathInfo()->getFilename() === 'vendor') if ($file_info->getFilename() === 'vendor' && $iterator->getDepth() === 2)
{ {
require $file_info->getRealPath(); $filename = $file_info->getRealPath() . '/autoload.php';
if (file_exists($filename))
{
require $filename;
}
} }
} }
} }