mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 20:06:31 +00:00
added the environment as an argument to initRuntime
This commit is contained in:
@@ -208,8 +208,6 @@ class Twig_Environment
|
||||
|
||||
if (!$this->runtimeInitialized) {
|
||||
$this->initRuntime();
|
||||
|
||||
$this->runtimeInitialized = true;
|
||||
}
|
||||
|
||||
return $this->loadedTemplates[$cls] = new $cls($this);
|
||||
@@ -295,8 +293,10 @@ class Twig_Environment
|
||||
|
||||
public function initRuntime()
|
||||
{
|
||||
$this->runtimeInitialized = true;
|
||||
|
||||
foreach ($this->getExtensions() as $extension) {
|
||||
$extension->initRuntime();
|
||||
$extension->initRuntime($this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,10 @@ abstract class Twig_Extension implements Twig_ExtensionInterface
|
||||
* Initializes the runtime environment.
|
||||
*
|
||||
* This is where you can load some file that contains filter functions for instance.
|
||||
*
|
||||
* @param Twig_Environment $environement The current Twig_Environment instance
|
||||
*/
|
||||
public function initRuntime()
|
||||
public function initRuntime(Twig_Environment $environement)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,10 @@ interface Twig_ExtensionInterface
|
||||
* Initializes the runtime environment.
|
||||
*
|
||||
* This is where you can load some file that contains filter functions for instance.
|
||||
*
|
||||
* @param Twig_Environment $environement The current Twig_Environment instance
|
||||
*/
|
||||
public function initRuntime();
|
||||
public function initRuntime(Twig_Environment $environement);
|
||||
|
||||
/**
|
||||
* Returns the token parser instances to add to the existing list.
|
||||
|
||||
Reference in New Issue
Block a user