You are here

public function Twig_Extension_Debug::getFunctions in Translation template extractor 6.3

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

Returns a list of global functions to add to the existing list.

Return value

array An array of global functions

Overrides Twig_Extension::getFunctions

File

vendor/Twig/Extension/Debug.php, line 18

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,
    )),
  );
}