mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 03:16:34 +00:00
removed obsolete code
This commit is contained in:
@@ -325,17 +325,8 @@ class Twig_Environment
|
||||
}
|
||||
|
||||
if (!class_exists($cls, false)) {
|
||||
$loader = $this->getLoader();
|
||||
if (!$loader instanceof Twig_SourceContextLoaderInterface) {
|
||||
$source = new Twig_Source($loader->getSource($name), $name);
|
||||
} else {
|
||||
$source = $loader->getSourceContext($name);
|
||||
}
|
||||
|
||||
$content = $this->compileSource($source);
|
||||
|
||||
$content = $this->compileSource($this->getLoader()->getSourceContext($name));
|
||||
$this->cache->write($key, $content);
|
||||
|
||||
eval('?>'.$content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1304,11 +1304,7 @@ function twig_source(Twig_Environment $env, $name, $ignoreMissing = false)
|
||||
{
|
||||
$loader = $env->getLoader();
|
||||
try {
|
||||
if (!$loader instanceof Twig_SourceContextLoaderInterface) {
|
||||
return $loader->getSource($name);
|
||||
} else {
|
||||
return $loader->getSourceContext($name)->getCode();
|
||||
}
|
||||
return $loader->getSourceContext($name)->getCode();
|
||||
} catch (Twig_Error_Loader $e) {
|
||||
if (!$ignoreMissing) {
|
||||
throw $e;
|
||||
|
||||
@@ -209,13 +209,7 @@ abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase
|
||||
|
||||
foreach (array_keys($templates) as $name) {
|
||||
echo "Template: $name\n";
|
||||
$loader = $twig->getLoader();
|
||||
if (!$loader instanceof Twig_SourceContextLoaderInterface) {
|
||||
$source = new Twig_Source($loader->getSource($name), $name);
|
||||
} else {
|
||||
$source = $loader->getSourceContext($name);
|
||||
}
|
||||
echo $twig->compile($twig->parse($twig->tokenize($source)));
|
||||
echo $twig->compile($twig->parse($twig->tokenize($twig->getLoader()->getSourceContext($name))));
|
||||
}
|
||||
}
|
||||
$this->assertEquals($expected, $output, $message.' (in '.$file.')');
|
||||
|
||||
Reference in New Issue
Block a user