diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-02-02 14:48:14 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-02-02 14:48:14 +0100 |
commit | cb04252fbd17ac718c09ecc44dab4c7627a98b35 (patch) | |
tree | ae7b5af431cbb29a2402d70623aa5f9c4b59754c | |
parent | dfe1761c95c0f108d95f013cdef0fd2c75f87e24 (diff) | |
parent | d3ce584dc785cb033fb2b4f0808a62c51af4791e (diff) | |
download | forums-cb04252fbd17ac718c09ecc44dab4c7627a98b35.tar forums-cb04252fbd17ac718c09ecc44dab4c7627a98b35.tar.gz forums-cb04252fbd17ac718c09ecc44dab4c7627a98b35.tar.bz2 forums-cb04252fbd17ac718c09ecc44dab4c7627a98b35.tar.xz forums-cb04252fbd17ac718c09ecc44dab4c7627a98b35.zip |
Merge remote-tracking branch 'vsephpbb/ticket/12100' into develop
-rw-r--r-- | phpBB/phpbb/template/twig/environment.php | 15 | ||||
-rw-r--r-- | phpBB/phpbb/template/twig/twig.php | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index 24bd55b3c5..aa55f1e011 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -11,15 +11,15 @@ namespace phpbb\template\twig; class environment extends \Twig_Environment { - /** @var array */ - protected $phpbb_extensions; - /** @var \phpbb\config\config */ protected $phpbb_config; /** @var \phpbb\path_helper */ protected $phpbb_path_helper; + /** @var \phpbb\extension\manager */ + protected $extension_manager; + /** @var string */ protected $phpbb_root_path; @@ -33,18 +33,19 @@ class environment extends \Twig_Environment * Constructor * * @param \phpbb\config\config $phpbb_config - * @param array $phpbb_extensions Array of enabled extensions (name => path) * @param \phpbb\path_helper + * @param \phpbb\extension\manager * @param string $phpbb_root_path * @param Twig_LoaderInterface $loader * @param array $options Array of options to pass to Twig */ - public function __construct($phpbb_config, $phpbb_extensions, \phpbb\path_helper $path_helper, \Twig_LoaderInterface $loader = null, $options = array()) + public function __construct($phpbb_config, \phpbb\path_helper $path_helper, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array()) { $this->phpbb_config = $phpbb_config; - $this->phpbb_extensions = $phpbb_extensions; $this->phpbb_path_helper = $path_helper; + $this->extension_manager = $extension_manager; + $this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path(); $this->web_root_path = $this->phpbb_path_helper->get_web_root_path(); @@ -60,7 +61,7 @@ class environment extends \Twig_Environment */ public function get_phpbb_extensions() { - return $this->phpbb_extensions; + return ($this->extension_manager) ? $this->extension_manager->all_enabled() : array(); } /** diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index ddadcfd89a..83630f5992 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -94,8 +94,8 @@ class twig extends \phpbb\template\base $this->twig = new \phpbb\template\twig\environment( $this->config, - ($this->extension_manager) ? $this->extension_manager->all_enabled() : array(), $this->path_helper, + $this->extension_manager, $loader, array( 'cache' => (defined('IN_INSTALL')) ? false : $this->cachepath, |