mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/12100] Ensure enabled extensions are fresh in Twig environment
PHPBB3-12100
This commit is contained in:
parent
5553f33f3d
commit
75c54f7f5e
2 changed files with 7 additions and 7 deletions
|
@ -11,8 +11,8 @@ namespace phpbb\template\twig;
|
||||||
|
|
||||||
class environment extends \Twig_Environment
|
class environment extends \Twig_Environment
|
||||||
{
|
{
|
||||||
/** @var array */
|
/** @var \phpbb\extension\manager */
|
||||||
protected $phpbb_extensions;
|
protected $extension_manager;
|
||||||
|
|
||||||
/** @var \phpbb\config\config */
|
/** @var \phpbb\config\config */
|
||||||
protected $phpbb_config;
|
protected $phpbb_config;
|
||||||
|
@ -33,16 +33,16 @@ class environment extends \Twig_Environment
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param \phpbb\config\config $phpbb_config
|
* @param \phpbb\config\config $phpbb_config
|
||||||
* @param array $phpbb_extensions Array of enabled extensions (name => path)
|
* @param \phpbb\extension\manager
|
||||||
* @param \phpbb\path_helper
|
* @param \phpbb\path_helper
|
||||||
* @param string $phpbb_root_path
|
* @param string $phpbb_root_path
|
||||||
* @param Twig_LoaderInterface $loader
|
* @param Twig_LoaderInterface $loader
|
||||||
* @param array $options Array of options to pass to Twig
|
* @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\extension\manager $extension_manager = null, \phpbb\path_helper $path_helper, \Twig_LoaderInterface $loader = null, $options = array())
|
||||||
{
|
{
|
||||||
$this->phpbb_config = $phpbb_config;
|
$this->phpbb_config = $phpbb_config;
|
||||||
$this->phpbb_extensions = $phpbb_extensions;
|
$this->extension_manager = $extension_manager;
|
||||||
|
|
||||||
$this->phpbb_path_helper = $path_helper;
|
$this->phpbb_path_helper = $path_helper;
|
||||||
$this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
|
$this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
|
||||||
|
@ -60,7 +60,7 @@ class environment extends \Twig_Environment
|
||||||
*/
|
*/
|
||||||
public function get_phpbb_extensions()
|
public function get_phpbb_extensions()
|
||||||
{
|
{
|
||||||
return $this->phpbb_extensions;
|
return ($this->extension_manager) ? $this->extension_manager->all_enabled() : array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -94,7 +94,7 @@ class twig extends \phpbb\template\base
|
||||||
|
|
||||||
$this->twig = new \phpbb\template\twig\environment(
|
$this->twig = new \phpbb\template\twig\environment(
|
||||||
$this->config,
|
$this->config,
|
||||||
($this->extension_manager) ? $this->extension_manager->all_enabled() : array(),
|
$this->extension_manager,
|
||||||
$this->path_helper,
|
$this->path_helper,
|
||||||
$loader,
|
$loader,
|
||||||
array(
|
array(
|
||||||
|
|
Loading…
Add table
Reference in a new issue