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/common.php | |
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/common.php')
-rw-r--r-- | phpBB/common.php | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index 72b938a5bf..ffae88d0d4 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -69,11 +69,10 @@ if (!defined('PHPBB_INSTALLED')) // Include files require($phpbb_root_path . 'includes/class_loader.' . $phpEx); -require($phpbb_root_path . 'includes/di/processor/interface.' . $phpEx); -require($phpbb_root_path . 'includes/di/processor/config.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions_content.' . $phpEx); +require($phpbb_root_path . 'includes/functions_container.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); @@ -81,16 +80,27 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Set PHP error handler to ours set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); -$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); - // Setup class loader first -$phpbb_class_loader = $phpbb_container->get('class_loader'); -$phpbb_class_loader_ext = $phpbb_container->get('class_loader.ext'); +$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'); @@ -117,13 +127,6 @@ $phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader'); $template = $phpbb_container->get('template'); $phpbb_style = $phpbb_container->get('style'); -$ids = array_keys($phpbb_container->findTaggedServiceIds('container.processor')); -foreach ($ids as $id) -{ - $processor = $phpbb_container->get($id); - $processor->process($phpbb_container); -} - // Add own hook handler require($phpbb_root_path . 'includes/hooks/index.' . $phpEx); $phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('phpbb_template', 'display'))); |