diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-11-12 10:46:21 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-11-12 10:46:21 +0100 |
commit | bf641a7f31f87eb7b88437214315872bff36ae84 (patch) | |
tree | 6e850dff6caf7e939ee614a1dbeb5ba4f1deb002 /phpBB/download | |
parent | 9bc9ac281af9f194d73160ae3545105f24db5395 (diff) | |
parent | 5a5e507a14084b08e41c4d2f86f2fb6700e68eb5 (diff) | |
download | forums-bf641a7f31f87eb7b88437214315872bff36ae84.tar forums-bf641a7f31f87eb7b88437214315872bff36ae84.tar.gz forums-bf641a7f31f87eb7b88437214315872bff36ae84.tar.bz2 forums-bf641a7f31f87eb7b88437214315872bff36ae84.tar.xz forums-bf641a7f31f87eb7b88437214315872bff36ae84.zip |
Merge remote-tracking branch 'upstream/develop' into ticket/11015
* upstream/develop: (31 commits)
[ticket/11194] Service tag data is stored in an array so access it correctly
[ticket/11193] Instantiate a single collection_pass for all collections
[ticket/11152] Basic tests for the container functions
[ticket/11152] Compile the install container
[ticket/11152] Throw error if services.yml is missing
[ticket/11152] Remove old container processor calls
[ticket/11152] Use realpath in container extensions consistently
[ticket/11152] Rename collection to collection_pass
[ticket/11152] Remove @api docblocks
[ticket/11152] Create separate function for debug-dependent container
[ticket/11152] Change phpbb_di_pass_cron to generic phpbb_di_pass_collection
[ticket/11152] Convert cron_task_collection to generic di_service_collection
[ticket/11152] Use relative root path in container, one dumped container per path
[ticket/11152] Move container functions to a separate function file
[feature/compiled-dic] Rename $phpEx to $php_ext in new code
[feature/compiled-dic] Use an absolute path for core.root_path parameter
[feature/compiled-dic] Update the composer.lock file
[feature/compiled-dic] Purge cache to make ext services available right away
[feature/compiled-dic] Fix root path when container is created after install
[feature/compiled-dic] Remove old test
...
Diffstat (limited to 'phpBB/download')
-rw-r--r-- | phpBB/download/file.php | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php index b581af7ce3..1168a943af 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -45,18 +45,31 @@ if (isset($_GET['avatar'])) require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); + require($phpbb_root_path . 'includes/functions_container.' . $phpEx); require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); - $phpbb_container = new ContainerBuilder(); - $loader = new YamlFileLoader($phpbb_container, new FileLocator(__DIR__.'/../config')); - $loader->load('services.yml'); - - $processor = new phpbb_di_processor_config($phpbb_root_path . 'config.' . $phpEx, $phpbb_root_path, $phpEx); - $processor->process($phpbb_container); - - $phpbb_class_loader = $phpbb_container->get('class_loader'); - $phpbb_class_loader_ext = $phpbb_container->get('class_loader.ext'); + // Setup class loader first + $phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx"); + $phpbb_class_loader->register(); + $phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", ".$phpEx"); + $phpbb_class_loader_ext->register(); + + // Set up container + $phpbb_container = phpbb_create_dumped_container_unless_debug( + array( + new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx), + new phpbb_di_extension_core($phpbb_root_path), + ), + array( + new phpbb_di_pass_collection_pass(), + ), + $phpbb_root_path, + $phpEx + ); + + $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver')); + $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); // set up caching $cache = $phpbb_container->get('cache'); @@ -82,13 +95,6 @@ if (isset($_GET['avatar'])) $phpbb_extension_manager = $phpbb_container->get('ext.manager'); $phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader'); - $ids = array_keys($phpbb_container->findTaggedServiceIds('container.processor')); - foreach ($ids as $id) - { - $processor = $phpbb_container->get($id); - $processor->process($phpbb_container); - } - // worst-case default $browser = strtolower($request->header('User-Agent', 'msie 6.0')); |