public static function ErrorHandler::register

Registers the error handler.

Parameters

integer $level The level at which the conversion to Exception is done (null to use the error_reporting() value and 0 to disable):

Boolean $displayErrors Display errors (for dev environment) or just log they (production usage):

Return value

The registered error handler

3 calls to ErrorHandler::register()
Debug::enable in drupal/core/vendor/symfony/debug/Symfony/Component/Debug/Debug.php
Enables the debug tools.
ErrorHandlerTest::testConstruct in drupal/core/vendor/symfony/debug/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
ErrorHandlerTest::testHandle in drupal/core/vendor/symfony/debug/Symfony/Component/Debug/Tests/ErrorHandlerTest.php

File

drupal/core/vendor/symfony/debug/Symfony/Component/Debug/ErrorHandler.php, line 63

Class

ErrorHandler
ErrorHandler.

Namespace

Symfony\Component\Debug

Code

public static function register($level = null, $displayErrors = true) {
  $handler = new static();
  $handler
    ->setLevel($level);
  $handler
    ->setDisplayErrors($displayErrors);
  ini_set('display_errors', 0);
  set_error_handler(array(
    $handler,
    'handle',
  ));
  register_shutdown_function(array(
    $handler,
    'handleFatal',
  ));
  $handler->reservedMemory = str_repeat('x', 10240);
  return $handler;
}