Line 15 | Line 15 |
---|
use phpbb\template\assets_bag;
|
use phpbb\template\assets_bag;
|
class environment extends \Twig_Environment
| class environment extends \Twig\Environment
|
{ /** @var \phpbb\config\config */ protected $phpbb_config;
| { /** @var \phpbb\config\config */ protected $phpbb_config;
|
Line 55 | Line 55 |
---|
* @param \phpbb\path_helper $path_helper phpBB path helper * @param string $cache_path The path to the cache directory * @param \phpbb\extension\manager $extension_manager phpBB extension manager
|
* @param \phpbb\path_helper $path_helper phpBB path helper * @param string $cache_path The path to the cache directory * @param \phpbb\extension\manager $extension_manager phpBB extension manager
|
* @param \Twig_LoaderInterface $loader Twig loader interface
| * @param \Twig\Loader\LoaderInterface $loader Twig loader interface
|
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object * @param array $options Array of options to pass to Twig */
|
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object * @param array $options Array of options to pass to Twig */
|
public function __construct(\phpbb\config\config $phpbb_config, \phpbb\filesystem\filesystem $filesystem, \phpbb\path_helper $path_helper, $cache_path, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, \phpbb\event\dispatcher_interface $phpbb_dispatcher = null, $options = array())
| public function __construct(\phpbb\config\config $phpbb_config, \phpbb\filesystem\filesystem $filesystem, \phpbb\path_helper $path_helper, $cache_path, \phpbb\extension\manager $extension_manager = null, \Twig\Loader\LoaderInterface $loader = null, \phpbb\event\dispatcher_interface $phpbb_dispatcher = null, $options = array())
|
{ $this->phpbb_config = $phpbb_config;
| { $this->phpbb_config = $phpbb_config;
|
Line 69 | Line 69 |
---|
$this->phpbb_dispatcher = $phpbb_dispatcher;
$this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
|
$this->phpbb_dispatcher = $phpbb_dispatcher;
$this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
|
$this->web_root_path = $this->phpbb_path_helper->get_web_root_path();
| |
$this->assets_bag = new assets_bag();
| $this->assets_bag = new assets_bag();
|
Line 132 | Line 131 |
---|
*/ public function get_web_root_path() {
|
*/ public function get_web_root_path() {
|
return $this->web_root_path;
| return $this->web_root_path ?? $this->web_root_path = $this->phpbb_path_helper->get_web_root_path();
|
}
/**
| }
/**
|
Line 169 | Line 168 |
---|
* Set the namespace look up order to load templates from * * @param array $namespace
|
* Set the namespace look up order to load templates from * * @param array $namespace
|
* @return \Twig_Environment
| * @return \Twig\Environment
|
*/ public function setNamespaceLookUpOrder($namespace) {
| */ public function setNamespaceLookUpOrder($namespace) {
|
Line 261 | Line 260 |
---|
* * @param string $name The template name * @param integer $index The index if it is an embedded template
|
* * @param string $name The template name * @param integer $index The index if it is an embedded template
|
* @return \Twig_TemplateInterface A template instance representing the given template name * @throws \Twig_Error_Loader
| * @return \Twig\Template A template instance representing the given template name * @throws \Twig\Error\LoaderError
|
*/ public function loadTemplate($name, $index = null) {
| */ public function loadTemplate($name, $index = null) {
|
Line 279 | Line 278 |
---|
return parent::loadTemplate('@' . $namespace . '/' . $name, $index); }
|
return parent::loadTemplate('@' . $namespace . '/' . $name, $index); }
|
catch (\Twig_Error_Loader $e)
| catch (\Twig\Error\LoaderError $e)
|
{ } }
| { } }
|
Line 298 | Line 297 |
---|
* * @param string $name The template name * @return string
|
* * @param string $name The template name * @return string
|
* @throws \Twig_Error_Loader
| * @throws \Twig\Error\LoaderError
|
*/ public function findTemplate($name) {
| */ public function findTemplate($name) {
|
Line 315 | Line 314 |
---|
return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name); }
|
return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name); }
|
catch (\Twig_Error_Loader $e)
| catch (\Twig\Error\LoaderError $e)
|
{ } }
| { } }
|