diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 20:45:58 +0200 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 20:45:58 +0200 |
commit | a7f61b91b7feec80cd9d544502aef937f036ae7c (patch) | |
tree | ec1302b1f0e4880f1c9df9fe8812baf11a68d5e0 /phpBB/install | |
parent | 873630f04e6502cc69e6b208f596414f240bc923 (diff) | |
download | forums-a7f61b91b7feec80cd9d544502aef937f036ae7c.tar forums-a7f61b91b7feec80cd9d544502aef937f036ae7c.tar.gz forums-a7f61b91b7feec80cd9d544502aef937f036ae7c.tar.bz2 forums-a7f61b91b7feec80cd9d544502aef937f036ae7c.tar.xz forums-a7f61b91b7feec80cd9d544502aef937f036ae7c.zip |
[feature/dic] Use DIC in download/file and install/index
PHPBB3-10739
Diffstat (limited to 'phpBB/install')
-rw-r--r-- | phpBB/install/index.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 13ab30a9fa..36c10c3ca6 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -79,19 +79,27 @@ include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); require($phpbb_root_path . 'includes/functions_install.' . $phpEx); -$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".$phpEx"); +$container = new ContainerBuilder(); +$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../config')); +$loader->load('parameters.yml'); +$loader->load('services.yml'); + +$container->setParameter('core.root_path', $phpbb_root_path); +$container->setParameter('core.php_ext', $phpEx); +$container->setAlias('cache.driver.install', 'cache.driver'); + +$phpbb_class_loader_ext = $container->get('class_loader.ext'); $phpbb_class_loader_ext->register(); -$phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".$phpEx"); +$phpbb_class_loader = $container->get('class_loader'); $phpbb_class_loader->register(); // set up caching -$cache_factory = new phpbb_cache_factory('file'); -$cache = $cache_factory->get_service(); -$phpbb_class_loader_ext->set_cache($cache->get_driver()); -$phpbb_class_loader->set_cache($cache->get_driver()); +$cache = $container->get('cache'); +$phpbb_class_loader_ext->set_cache($container->get('cache.driver')); +$phpbb_class_loader->set_cache($container->get('cache.driver')); -$phpbb_dispatcher = new phpbb_event_dispatcher(); -$request = new phpbb_request(); +$phpbb_dispatcher = $container->get('dispatcher'); +$request = $container->get('request'); // make sure request_var uses this request instance request_var('', 0, false, false, $request); // "dependency injection" for a function |