mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/14306] Doesn't try to build a "safe" container in the dev env
PHPBB3-14306
This commit is contained in:
parent
78349ed80f
commit
761fa9da52
1 changed files with 21 additions and 9 deletions
|
@ -113,7 +113,7 @@ class container_builder
|
||||||
* @param string $phpbb_root_path Path to the phpbb includes directory.
|
* @param string $phpbb_root_path Path to the phpbb includes directory.
|
||||||
* @param string $php_ext php file extension
|
* @param string $php_ext php file extension
|
||||||
*/
|
*/
|
||||||
function __construct($phpbb_root_path, $php_ext)
|
public function __construct($phpbb_root_path, $php_ext)
|
||||||
{
|
{
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->php_ext = $php_ext;
|
$this->php_ext = $php_ext;
|
||||||
|
@ -191,14 +191,26 @@ class container_builder
|
||||||
}
|
}
|
||||||
catch (\Exception $e)
|
catch (\Exception $e)
|
||||||
{
|
{
|
||||||
return $this
|
// Don't try to recover if we are in the development environment
|
||||||
->without_extensions()
|
if ($this->get_environment() === 'development') {
|
||||||
->without_cache()
|
throw $e;
|
||||||
->with_custom_parameters(array_merge($this->custom_parameters, [
|
}
|
||||||
'container_exception' => $e,
|
|
||||||
]))
|
try
|
||||||
->get_container()
|
{
|
||||||
;
|
return $this
|
||||||
|
->without_extensions()
|
||||||
|
->without_cache()
|
||||||
|
->with_custom_parameters(array_merge($this->custom_parameters, [
|
||||||
|
'container_exception' => $e,
|
||||||
|
]))
|
||||||
|
->get_container();
|
||||||
|
}
|
||||||
|
catch (\Exception $_)
|
||||||
|
{
|
||||||
|
// Rethrow the original exception if it's still failing
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue