You are here

public function Twig_Extension_Debug::getFunctions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/Extension/Debug.php \Twig_Extension_Debug::getFunctions()

File

vendor/twig/twig/lib/Twig/Extension/Debug.php, line 13

Class

Twig_Extension_Debug

Code

public function getFunctions() {

  // dump is safe if var_dump is overridden by xdebug
  $isDumpOutputHtmlSafe = extension_loaded('xdebug') && (false === ini_get('xdebug.overload_var_dump') || ini_get('xdebug.overload_var_dump')) && (false === ini_get('html_errors') || ini_get('html_errors')) || 'cli' === php_sapi_name();
  return array(
    new Twig_SimpleFunction('dump', 'twig_var_dump', array(
      'is_safe' => $isDumpOutputHtmlSafe ? array(
        'html',
      ) : array(),
      'needs_context' => true,
      'needs_environment' => true,
    )),
  );
}