Twig update to latest Twig 1.x legacy as per vichan

This commit is contained in:
Benjamin Southall 2019-02-26 10:11:12 +10:00
parent 4ecd84f81d
commit e6c07544da
198 changed files with 6150 additions and 2506 deletions

View file

@ -3,18 +3,17 @@
/*
* This file is part of Twig.
*
* (c) 2011 Fabien Potencier
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* @final
*/
class Twig_Extension_Debug extends Twig_Extension
{
/**
* Returns a list of global functions to add to the existing list.
*
* @return array An array of global functions
*/
public function getFunctions()
{
// dump is safe if var_dump is overridden by xdebug
@ -24,7 +23,7 @@ class Twig_Extension_Debug extends Twig_Extension
// false means that it was not set (and the default is on) or it explicitly enabled
// xdebug.overload_var_dump produces HTML only when html_errors is also enabled
&& (false === ini_get('html_errors') || ini_get('html_errors'))
|| 'cli' === php_sapi_name()
|| 'cli' === PHP_SAPI
;
return array(
@ -32,11 +31,6 @@ class Twig_Extension_Debug extends Twig_Extension
);
}
/**
* Returns the name of the extension.
*
* @return string The extension name
*/
public function getName()
{
return 'debug';
@ -62,10 +56,12 @@ function twig_var_dump(Twig_Environment $env, $context)
var_dump($vars);
} else {
for ($i = 2; $i < $count; $i++) {
for ($i = 2; $i < $count; ++$i) {
var_dump(func_get_arg($i));
}
}
return ob_get_clean();
}
class_alias('Twig_Extension_Debug', 'Twig\Extension\DebugExtension', false);