[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/symfony/error-handler/ -> Debug.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of the Symfony package.
   5   *
   6   * (c) Fabien Potencier <[email protected]>
   7   *
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  namespace Symfony\Component\ErrorHandler;
  13  
  14  /**
  15   * Registers all the debug tools.
  16   *
  17   * @author Fabien Potencier <[email protected]>
  18   */
  19  class Debug
  20  {
  21      public static function enable(): ErrorHandler
  22      {
  23          error_reporting(-1);
  24  
  25          if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
  26              ini_set('display_errors', 0);
  27          } elseif (!filter_var(ini_get('log_errors'), \FILTER_VALIDATE_BOOLEAN) || ini_get('error_log')) {
  28              // CLI - display errors only if they're not already logged to STDERR
  29              ini_set('display_errors', 1);
  30          }
  31  
  32          @ini_set('zend.assertions', 1);
  33          ini_set('assert.active', 1);
  34          ini_set('assert.warning', 0);
  35          ini_set('assert.exception', 1);
  36  
  37          DebugClassLoader::enable();
  38  
  39          return ErrorHandler::register(new ErrorHandler(new BufferingLogger(), true));
  40      }
  41  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer