[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/phpbb/template/twig/ -> loader.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 176 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

loader:: (7 methods):
  __construct()
  setSafeDirectories()
  addSafeDirectory()
  getSafeDirectories()
  validateName()
  addPath()
  findTemplate()


Class: loader  - X-Ref

Twig Template loader

__construct(\phpbb\filesystem\filesystem_interface $filesystem, $paths = array()   X-Ref
Constructor

param: \phpbb\filesystem\filesystem_interface $filesystem
param: string|array    $paths

setSafeDirectories($directories = array()   X-Ref
Set safe directories

param: array $directories Array of directories that are safe (empty to clear)
return: \Twig\Loader\FilesystemLoader

addSafeDirectory($directory)   X-Ref
Add safe directory

param: string $directory Directory that should be added
return: \Twig\Loader\FilesystemLoader

getSafeDirectories()   X-Ref
Get current safe directories

return: array

validateName($name)   X-Ref
Override for parent::validateName()

This is done because we added support for safe directories, and when Twig
findTemplate() is called, validateName() is called first, which would
always throw an exception if the file is outside of the configured
template directories.

addPath($path, $namespace = self::MAIN_NAMESPACE)   X-Ref
Adds a realpath call to fix a BC break in Twig 1.26 (https://github.com/twigphp/Twig/issues/2145)

{@inheritdoc}

findTemplate($name, $throw = true)   X-Ref
Find the template

Override for \Twig\Loader\FilesystemLoader::findTemplate
to add support for loading from safe directories.



Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1