You are here

class Debug in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/debug/Debug.php \Symfony\Component\Debug\Debug
  2. 8 vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php \Doctrine\Common\Util\Debug
Same name and namespace in other branches
  1. 8.0 vendor/symfony/debug/Debug.php \Symfony\Component\Debug\Debug

Registers all the debug tools.

@author Fabien Potencier <fabien@symfony.com>

Hierarchy

  • class \Symfony\Component\Debug\Debug

Expanded class hierarchy of Debug

14 string references to 'Debug'
ConfigInstallProfileUnmetDependenciesTest::error in core/modules/config/src/Tests/ConfigInstallProfileUnmetDependenciesTest.php
Override the error method so we can test for the expected exception.
DefaultExceptionSubscriber::onHtml in core/lib/Drupal/Core/EventSubscriber/DefaultExceptionSubscriber.php
Handles any exception as a generic error page for HTML.
EntityCacheTagsTestBase::testReferencedEntity in core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
Tests cache tags presence and invalidation of the entity when referenced.
EntityWithUriCacheTagsTestBase::testEntityUri in core/modules/system/src/Tests/Entity/EntityWithUriCacheTagsTestBase.php
Tests cache tags presence and invalidation of the entity at its URI.
Kernel::getContainerClass in vendor/symfony/http-kernel/Kernel.php
Gets the container class.

... See full list

File

vendor/symfony/debug/Debug.php, line 19

Namespace

Symfony\Component\Debug
View source
class Debug {
  private static $enabled = false;

  /**
   * Enables the debug tools.
   *
   * This method registers an error handler and an exception handler.
   *
   * If the Symfony ClassLoader component is available, a special
   * class loader is also registered.
   *
   * @param int  $errorReportingLevel The level of error reporting you want
   * @param bool $displayErrors       Whether to display errors (for development) or just log them (for production)
   */
  public static function enable($errorReportingLevel = null, $displayErrors = true) {
    if (static::$enabled) {
      return;
    }
    static::$enabled = true;
    if (null !== $errorReportingLevel) {
      error_reporting($errorReportingLevel);
    }
    else {
      error_reporting(-1);
    }
    if ('cli' !== php_sapi_name()) {
      ini_set('display_errors', 0);
      ExceptionHandler::register();
    }
    elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {

      // CLI - display errors only if they're not already logged to STDERR
      ini_set('display_errors', 1);
    }
    $handler = ErrorHandler::register();
    if (!$displayErrors) {
      $handler
        ->throwAt(0, true);
    }
    DebugClassLoader::enable();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Debug::$enabled private static property
Debug::enable public static function Enables the debug tools.