protected function load_extensions()
{
if ($this->config_php_file !== null) {
// Build an intermediate container to load the ext list from the database
$container_builder = new container_builder($this->phpbb_root_path, $this->php_ext);
$ext_container = $container_builder->without_cache()->without_extensions()->with_config($this->config_php_file)->with_environment('production')->without_compiled_container()->get_container();
$ext_container->register('cache.driver', '\\phpbb\\cache\\driver\\dummy');
$ext_container->compile();
$extensions = $ext_container->get('ext.manager')->all_enabled();
// Load each extension found
foreach ($extensions as $ext_name => $path) {
$extension_class = '\\' . str_replace('/', '\\', $ext_name) . '\\di\\extension';
if (!class_exists($extension_class)) {
$extension_class = '\\phpbb\\extension\\di\\extension_base';
}
$this->container_extensions[] = new $extension_class($ext_name, $path);
// Load extension autoloader
$filename = $path . 'vendor/autoload.php';
if (file_exists($filename)) {
require $filename;
}
}
} else {
// To load the extensions we need the database credentials.
// Automatically disable the extensions if we don't have them.
$this->use_extensions = false;
}
}