aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_container.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2013-01-02 06:41:20 +0100
committerIgor Wiedler <igor@wiedler.ch>2013-01-02 06:41:40 +0100
commit21eb8d842bc634a92f04c37e5de22c4c5692052d (patch)
treebc63376c5ab01203cdbdbb0ed44d1af511a1afd1 /phpBB/includes/functions_container.php
parentea24de8de3e4f451aa4394f0f46d6955ccb671c2 (diff)
downloadforums-21eb8d842bc634a92f04c37e5de22c4c5692052d.tar
forums-21eb8d842bc634a92f04c37e5de22c4c5692052d.tar.gz
forums-21eb8d842bc634a92f04c37e5de22c4c5692052d.tar.bz2
forums-21eb8d842bc634a92f04c37e5de22c4c5692052d.tar.xz
forums-21eb8d842bc634a92f04c37e5de22c4c5692052d.zip
[ticket/11306] Add docblocks to all container related functions
PHPBB3-11306
Diffstat (limited to 'phpBB/includes/functions_container.php')
-rw-r--r--phpBB/includes/functions_container.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php
index 0634948002..a3ed21c35b 100644
--- a/phpBB/includes/functions_container.php
+++ b/phpBB/includes/functions_container.php
@@ -105,6 +105,15 @@ function phpbb_create_compiled_container(array $extensions, array $passes, $phpb
return $container;
}
+/**
+* Create a compiled and dumped ContainerBuilder object
+*
+* @param array $extensions Array of Container extension objects
+* @param array $passes Array of Compiler Pass objects
+* @param string $phpbb_root_path Root path
+* @param string $php_ext PHP Extension
+* @return ContainerBuilder object (compiled)
+*/
function phpbb_create_dumped_container(array $extensions, array $passes, $phpbb_root_path, $php_ext)
{
// Check for our cached container; if it exists, use it
@@ -129,12 +138,37 @@ function phpbb_create_dumped_container(array $extensions, array $passes, $phpbb_
return $container;
}
+/**
+* Create an environment-specific ContainerBuilder object
+*
+* If debug is enabled, the container is re-compiled every time.
+* This ensures that the latest changes will always be reflected
+* during development.
+*
+* Otherwise it will get the existing dumped container and use
+* that one instead.
+*
+* @param array $extensions Array of Container extension objects
+* @param array $passes Array of Compiler Pass objects
+* @param string $phpbb_root_path Root path
+* @param string $php_ext PHP Extension
+* @return ContainerBuilder object (compiled)
+*/
function phpbb_create_dumped_container_unless_debug(array $extensions, array $passes, $phpbb_root_path, $php_ext)
{
$container_factory = defined('DEBUG') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container';
return $container_factory($extensions, $passes, $phpbb_root_path, $php_ext);
}
+/**
+* Create a default ContainerBuilder object
+*
+* Contains the default configuration of the phpBB container.
+*
+* @param array $extensions Array of Container extension objects
+* @param array $passes Array of Compiler Pass objects
+* @return ContainerBuilder object (compiled)
+*/
function phpbb_create_default_container($phpbb_root_path, $php_ext)
{
return phpbb_create_dumped_container_unless_debug(
@@ -151,6 +185,13 @@ function phpbb_create_default_container($phpbb_root_path, $php_ext)
);
}
+/**
+* Get the filename under which the dumped container will be stored.
+*
+* @param string $phpbb_root_path Root path
+* @param string $php_ext PHP Extension
+* @return Path for dumped container
+*/
function phpbb_container_filename($phpbb_root_path, $php_ext)
{
$filename = str_replace(array('/', '.'), array('slash', 'dot'), $phpbb_root_path);