ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Loads template from the filesystem. More...
Public Member Functions | |
__construct ($paths=array(), $rootPath=null) | |
getPaths ($namespace=self::MAIN_NAMESPACE) | |
Returns the paths to the templates. More... | |
getNamespaces () | |
Returns the path namespaces. More... | |
setPaths ($paths, $namespace=self::MAIN_NAMESPACE) | |
Sets the paths where templates are stored. More... | |
addPath ($path, $namespace=self::MAIN_NAMESPACE) | |
Adds a path where templates are stored. More... | |
prependPath ($path, $namespace=self::MAIN_NAMESPACE) | |
Prepends a path where templates are stored. More... | |
getSource ($name) | |
Gets the source code of a template, given its name. More... | |
getSourceContext ($name) | |
Returns the source context for a given template logical name. More... | |
getCacheKey ($name) | |
Gets the cache key to use for the cache for a given template name. More... | |
exists ($name) | |
Check if we have the source code of a template, given its name. More... | |
isFresh ($name, $time) | |
Returns true if the template is still fresh. More... | |
Data Fields | |
const | MAIN_NAMESPACE = '__main__' |
Identifier of the main namespace. More... | |
Protected Member Functions | |
findTemplate ($name) | |
parseName ($name, $default=self::MAIN_NAMESPACE) | |
normalizeName ($name) | |
validateName ($name) | |
Protected Attributes | |
$paths = array() | |
$cache = array() | |
$errorCache = array() | |
Private Member Functions | |
isAbsolutePath ($file) | |
Private Attributes | |
$rootPath | |
Loads template from the filesystem.
Definition at line 17 of file Filesystem.php.
Twig_Loader_Filesystem::__construct | ( | $paths = array() , |
|
$rootPath = null |
|||
) |
string | array | $paths | A path or an array of paths where to look for templates |
string | null | $rootPath | The root path common to all relative paths (null for getcwd()) |
Definition at line 32 of file Filesystem.php.
References $paths, $rootPath, and setPaths().
Twig_Loader_Filesystem::addPath | ( | $path, | |
$namespace = self::MAIN_NAMESPACE |
|||
) |
Adds a path where templates are stored.
string | $path | A path where to look for templates |
string | $namespace | A path namespace |
Twig_Error_Loader |
Definition at line 94 of file Filesystem.php.
References $namespace, $path, and isAbsolutePath().
Referenced by setPaths().
Twig_Loader_Filesystem::exists | ( | $name | ) |
Check if we have the source code of a template, given its name.
string | $name | The name of the template to check if we can load |
Implements Twig_ExistsLoaderInterface.
Definition at line 159 of file Filesystem.php.
References $name, findTemplate(), and normalizeName().
|
protected |
Definition at line 181 of file Filesystem.php.
References $name, $namespace, $path, isAbsolutePath(), normalizeName(), parseName(), and validateName().
Referenced by exists(), getCacheKey(), getSource(), getSourceContext(), and isFresh().
Twig_Loader_Filesystem::getCacheKey | ( | $name | ) |
Gets the cache key to use for the cache for a given template name.
string | $name | The name of the template to load |
Twig_Error_Loader | When $name is not found |
Implements Twig_LoaderInterface.
Definition at line 148 of file Filesystem.php.
References $name, $path, and findTemplate().
Twig_Loader_Filesystem::getNamespaces | ( | ) |
Returns the path namespaces.
The main namespace is always defined.
Definition at line 63 of file Filesystem.php.
Twig_Loader_Filesystem::getPaths | ( | $namespace = self::MAIN_NAMESPACE | ) |
Returns the paths to the templates.
string | $namespace | A path namespace |
Definition at line 51 of file Filesystem.php.
References $namespace.
Twig_Loader_Filesystem::getSource | ( | $name | ) |
Gets the source code of a template, given its name.
string | $name | The name of the template to load |
Twig_Error_Loader | When $name is not found |
Implements Twig_LoaderInterface.
Definition at line 134 of file Filesystem.php.
References $name, and findTemplate().
Twig_Loader_Filesystem::getSourceContext | ( | $name | ) |
Returns the source context for a given template logical name.
string | $name | The template logical name |
Twig_Error_Loader | When $name is not found |
Implements Twig_SourceContextLoaderInterface.
Definition at line 141 of file Filesystem.php.
References $name, $path, and findTemplate().
|
private |
Definition at line 278 of file Filesystem.php.
Referenced by addPath(), findTemplate(), and prependPath().
Twig_Loader_Filesystem::isFresh | ( | $name, | |
$time | |||
) |
Returns true if the template is still fresh.
string | $name | The template name |
int | $time | Timestamp of the last modification time of the cached template |
Twig_Error_Loader | When $name is not found |
Implements Twig_LoaderInterface.
Definition at line 176 of file Filesystem.php.
References $name, $time, and findTemplate().
|
protected |
Definition at line 251 of file Filesystem.php.
References $name.
Referenced by exists(), and findTemplate().
|
protected |
Definition at line 235 of file Filesystem.php.
References $default, $name, and $namespace.
Referenced by findTemplate().
Twig_Loader_Filesystem::prependPath | ( | $path, | |
$namespace = self::MAIN_NAMESPACE |
|||
) |
Prepends a path where templates are stored.
string | $path | A path where to look for templates |
string | $namespace | A path namespace |
Twig_Error_Loader |
Definition at line 115 of file Filesystem.php.
References $namespace, $path, and isAbsolutePath().
Twig_Loader_Filesystem::setPaths | ( | $paths, | |
$namespace = self::MAIN_NAMESPACE |
|||
) |
Sets the paths where templates are stored.
string | array | $paths | A path or an array of paths where to look for templates |
string | $namespace | A path namespace |
Definition at line 74 of file Filesystem.php.
References $namespace, $path, $paths, and addPath().
Referenced by __construct().
|
protected |
Definition at line 256 of file Filesystem.php.
References $name.
Referenced by findTemplate().
|
protected |
Definition at line 23 of file Filesystem.php.
|
protected |
Definition at line 24 of file Filesystem.php.
|
protected |
Definition at line 22 of file Filesystem.php.
Referenced by __construct(), and setPaths().
|
private |
Definition at line 26 of file Filesystem.php.
Referenced by __construct().
const Twig_Loader_Filesystem::MAIN_NAMESPACE = '__main__' |
Identifier of the main namespace.
Definition at line 20 of file Filesystem.php.
Referenced by SimpleSAML_XHTML_Template\findThemeTemplateDirs(), SimpleSAML_XHTML_Template\setupTwigTemplatepaths(), and Twig_Tests_Loader_FilesystemTest\testGetNamespaces().