aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_container.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2013-01-02 04:04:01 +0100
committerIgor Wiedler <igor@wiedler.ch>2013-01-02 06:41:35 +0100
commitea24de8de3e4f451aa4394f0f46d6955ccb671c2 (patch)
tree383da1a1e3b825315c41c57e38b9648dcd720f1b /phpBB/includes/functions_container.php
parent53c4257bfa68ca3962c2b47a6ba15a060861124b (diff)
downloadforums-ea24de8de3e4f451aa4394f0f46d6955ccb671c2.tar
forums-ea24de8de3e4f451aa4394f0f46d6955ccb671c2.tar.gz
forums-ea24de8de3e4f451aa4394f0f46d6955ccb671c2.tar.bz2
forums-ea24de8de3e4f451aa4394f0f46d6955ccb671c2.tar.xz
forums-ea24de8de3e4f451aa4394f0f46d6955ccb671c2.zip
[ticket/11306] Introduce phpbb_create_default_container
Extracts default container construction to factory function, removing boilerplate duplication for container construction. PHPBB3-11306
Diffstat (limited to 'phpBB/includes/functions_container.php')
-rw-r--r--phpBB/includes/functions_container.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php
index 8014574443..0634948002 100644
--- a/phpBB/includes/functions_container.php
+++ b/phpBB/includes/functions_container.php
@@ -135,6 +135,22 @@ function phpbb_create_dumped_container_unless_debug(array $extensions, array $pa
return $container_factory($extensions, $passes, $phpbb_root_path, $php_ext);
}
+function phpbb_create_default_container($phpbb_root_path, $php_ext)
+{
+ return phpbb_create_dumped_container_unless_debug(
+ array(
+ new phpbb_di_extension_config($phpbb_root_path . 'config.' . $php_ext),
+ new phpbb_di_extension_core($phpbb_root_path),
+ ),
+ array(
+ new phpbb_di_pass_collection_pass(),
+ new phpbb_di_pass_kernel_pass(),
+ ),
+ $phpbb_root_path,
+ $php_ext
+ );
+}
+
function phpbb_container_filename($phpbb_root_path, $php_ext)
{
$filename = str_replace(array('/', '.'), array('slash', 'dot'), $phpbb_root_path);