aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/download
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2012-11-11 09:05:15 -0800
committerNils Adermann <naderman@naderman.de>2012-11-11 09:05:15 -0800
commit69845585a2bc6720e6c512227f436782c7bf5d29 (patch)
tree70fc24b25612a99f2c3ac8664e1df7561d69f680 /phpBB/download
parent504158ceaba18bb8bc61d54504a2c870d0eb0407 (diff)
parent1bf7f0bde73a8528f77b5f9cfffd6f113afcf63d (diff)
downloadforums-69845585a2bc6720e6c512227f436782c7bf5d29.tar
forums-69845585a2bc6720e6c512227f436782c7bf5d29.tar.gz
forums-69845585a2bc6720e6c512227f436782c7bf5d29.tar.bz2
forums-69845585a2bc6720e6c512227f436782c7bf5d29.tar.xz
forums-69845585a2bc6720e6c512227f436782c7bf5d29.zip
Merge pull request #1056 from igorw/feature/compiled-dic
[feature/compiled-dic] Compile the DI Container into a cached class
Diffstat (limited to 'phpBB/download')
-rw-r--r--phpBB/download/file.php40
1 files changed, 23 insertions, 17 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index 7ed53d54b6..95b20a88d2 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -48,18 +48,31 @@ if (isset($_GET['avatar']))
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
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('cron.task_collection', 'cron.task'),
+ ),
+ $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');
@@ -85,13 +98,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'));
@@ -392,7 +398,7 @@ else
$disallowed[$attach['extension']] = $attach['extension'];
continue;
}
-
+
$prefix = '';
if ($topic_id)
{