diff options
| author | David King <imkingdavid@gmail.com> | 2012-10-19 19:53:29 -0400 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2012-11-10 11:40:09 +0100 |
| commit | f48709f5bb8fb1b916d308e3b4bb06bc96d08611 (patch) | |
| tree | dc662d3c6f42e2fe1cba86fce7608a84521c0143 /phpBB/download/file.php | |
| parent | 957508c8b1a71c603c31728dfab79640554c541e (diff) | |
| download | forums-f48709f5bb8fb1b916d308e3b4bb06bc96d08611.tar forums-f48709f5bb8fb1b916d308e3b4bb06bc96d08611.tar.gz forums-f48709f5bb8fb1b916d308e3b4bb06bc96d08611.tar.bz2 forums-f48709f5bb8fb1b916d308e3b4bb06bc96d08611.tar.xz forums-f48709f5bb8fb1b916d308e3b4bb06bc96d08611.zip | |
[feature/compiled-dic] Compile the DI Container into a cached class
PHPBB3-11152
Diffstat (limited to 'phpBB/download/file.php')
| -rw-r--r-- | phpBB/download/file.php | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 7ed53d54b6..85dc8acb81 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -51,15 +51,28 @@ if (isset($_GET['avatar'])) 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_compiled_container( + array( + new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx), + new phpbb_di_extension_core($phpbb_root_path), + ), + array( + new phpbb_event_kernel_compiler_pass(), + ), + $phpbb_root_path . 'config.' . $phpEx, + $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'); |
