CoreFiles by mySites.guru
Debug.php40 lines, 1,119 bytes, from Joomla_6.1.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 6.1.0-alpha2
md5
68bfd6ec66205d0b4679f7bad0b71d61
sha1
a3056b66fb3c0f06aa6dd9bb31c68a38ead71933
sha256
f4d2655da432a87a69e56bbc9a6b603252fdaeaf0e54b0602885ade4a514bb78
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\ErrorHandler;

/**
 * Registers all the debug tools.
 *
 * @author Fabien Potencier <[email protected]>
 */
class Debug
{
    public static function enable(): ErrorHandler
    {
        error_reporting(\E_ALL & ~\E_DEPRECATED & ~\E_USER_DEPRECATED);

        if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
            ini_set('display_errors', 0);
        } elseif (!filter_var(\ini_get('log_errors'), \FILTER_VALIDATE_BOOL) || \ini_get('error_log')) {
            // CLI - display errors only if they're not already logged to STDERR
            ini_set('display_errors', 1);
        }

        @ini_set('zend.assertions', 1);
        ini_set('assert.active', 1);
        ini_set('assert.exception', 1);

        DebugClassLoader::enable();

        return ErrorHandler::register(new ErrorHandler(new BufferingLogger(), true));
    }
}

The same content is in 73 releases, Joomla 5.4.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.