ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
String.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) Fabien Potencier
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12@trigger_error('The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use Twig_Loader_Array instead or Twig_Environment::createTemplate().', E_USER_DEPRECATED);
13
31{
32 public function getSource($name)
33 {
34 @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
35
36 return $name;
37 }
38
39 public function getSourceContext($name)
40 {
41 return new Twig_Source($name, $name);
42 }
43
44 public function exists($name)
45 {
46 return true;
47 }
48
49 public function getCacheKey($name)
50 {
51 return $name;
52 }
53
54 public function isFresh($name, $time)
55 {
56 return true;
57 }
58}
An exception for terminatinating execution or to throw for unit testing.
Loads a template from a string.
Definition: String.php:31
getCacheKey($name)
Gets the cache key to use for the cache for a given template name.
Definition: String.php:49
getSourceContext($name)
Returns the source context for a given template logical name.
Definition: String.php:39
exists($name)
Check if we have the source code of a template, given its name.
Definition: String.php:44
isFresh($name, $time)
Returns true if the template is still fresh.
Definition: String.php:54
getSource($name)
Gets the source code of a template, given its name.
Definition: String.php:32
Holds information about a non-compiled Twig template.
Definition: Source.php:20
Adds an exists() method for loaders.
Interface all loaders must implement.
Adds a getSourceContext() method for loaders.
$time
Definition: cron.php:21