diff --git a/CHANGELOG.md b/CHANGELOG.md index 81cb8ba0..a15e880e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] +### Added +* *Nothing* + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* [#2373](https://github.com/shlinkio/shlink/issues/2373) Ensure deprecation warnings do not end up escalated to `ErrorException`s by `ProblemDetailsMiddleware`. + + In order to do this, Shlink will entirely ignore deprecation warnings when running in production, as those do not mean something is not working, but only that something will break in future versions. + + ## [4.4.4] - 2025-02-19 ### Added * *Nothing* diff --git a/config/container.php b/config/container.php index 6ac07896..31e406a3 100644 --- a/config/container.php +++ b/config/container.php @@ -11,6 +11,7 @@ use function Shlinkio\Shlink\Core\enumValues; use const Shlinkio\Shlink\LOCAL_LOCK_FACTORY; +// Set current directory to the project's root directory chdir(dirname(__DIR__)); require 'vendor/autoload.php'; @@ -21,7 +22,11 @@ loadEnvVarsFromConfig( enumValues(EnvVars::class), ); -// This is one of the first files loaded. Configure the timezone and memory limit here +// This is one of the first files loaded. Set global configuration here +error_reporting( + // Set a less strict error reporting for prod, where deprecation warnings should be ignored + EnvVars::isProdEnv() ? E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED : E_ALL, +); ini_set('memory_limit', EnvVars::MEMORY_LIMIT->loadFromEnv()); date_default_timezone_set(EnvVars::TIMEZONE->loadFromEnv()); diff --git a/data/infra/php.ini b/data/infra/php.ini index ba8b1620..12b6a3c0 100644 --- a/data/infra/php.ini +++ b/data/infra/php.ini @@ -1,5 +1,4 @@ display_errors=On -error_reporting=-1 log_errors_max_len=0 zend.assertions=1 assert.exception=1