Skip to content

Commit

Permalink
set error reporting based on PHP version
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Oct 21, 2024
1 parent 45388d4 commit e2f16b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@
define('PIWIK_USER_PATH', PIWIK_DOCUMENT_ROOT);
}

error_reporting(E_ALL);
$errorLevel = E_ALL;

// We cannot enable deprecations for PHP 8.4 until we were able to update php-di/php-di to a version compatible
// with PHP 8.4. Otherwise deprecation notices would be triggered at a point, where they break Matomo
if (version_compare(PHP_VERSION, '8.4.0-dev', '>=')) {
$errorLevel = E_ALL & ~E_DEPRECATED;
}

error_reporting($errorLevel);
@ini_set('display_errors', defined('PIWIK_DISPLAY_ERRORS') ? PIWIK_DISPLAY_ERRORS : @ini_get('display_errors'));
@ini_set('xdebug.show_exception_trace', 0);

Expand Down

0 comments on commit e2f16b0

Please sign in to comment.