From ca15648de0f658d1778ccdaacc838804c9c3bacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Mon, 11 Dec 2023 14:40:35 +0100 Subject: [PATCH] PHP 8.2: Add custom error handler if needed (#80) * PHP 8.2: Add custom error handler if needed * Added dump-autoload --- bin/4.5.x-dev/prepare_project_edition.sh | 6 ++++++ bin/4.6.x-dev/prepare_project_edition.sh | 6 ++++++ bin/^3.3.x-dev/prepare_project_edition.sh | 6 ++++++ bin/stable/prepare_project_edition.sh | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/bin/4.5.x-dev/prepare_project_edition.sh b/bin/4.5.x-dev/prepare_project_edition.sh index b3a7256..9348306 100755 --- a/bin/4.5.x-dev/prepare_project_edition.sh +++ b/bin/4.5.x-dev/prepare_project_edition.sh @@ -134,6 +134,12 @@ docker exec install_dependencies composer recipes:install ${DEPENDENCY_PACKAGE_N # Enable FriendsOfBehat SymfonyExtension in the Behat env sudo sed -i "s/\['test' => true\]/\['test' => true, 'behat' => true\]/g" config/bundles.php +if [[ $PHP_IMAGE == *"8.2"* ]]; then + echo "> Set PHP 8.2 Ibexa error handler to avoid deprecations" + docker exec install_dependencies composer config extra.runtime.error_handler "\\Ibexa\\Contracts\\Core\\MVC\\Symfony\\ErrorHandler\\Php82HideDeprecationsErrorHandler" + docker exec install_dependencies composer dump-autoload +fi + echo "> Display composer.json for debugging" cat composer.json diff --git a/bin/4.6.x-dev/prepare_project_edition.sh b/bin/4.6.x-dev/prepare_project_edition.sh index 7d11d33..f2baffc 100755 --- a/bin/4.6.x-dev/prepare_project_edition.sh +++ b/bin/4.6.x-dev/prepare_project_edition.sh @@ -136,6 +136,12 @@ docker exec install_dependencies composer update --no-scripts # Enable FriendsOfBehat SymfonyExtension in the Behat env sudo sed -i "s/\['test' => true\]/\['test' => true, 'behat' => true\]/g" config/bundles.php +if [[ $PHP_IMAGE == *"8.2"* ]]; then + echo "> Set PHP 8.2 Ibexa error handler to avoid deprecations" + docker exec install_dependencies composer config extra.runtime.error_handler "\\Ibexa\\Contracts\\Core\\MVC\\Symfony\\ErrorHandler\\Php82HideDeprecationsErrorHandler" + docker exec install_dependencies composer dump-autoload +fi + echo "> Display composer.json for debugging" cat composer.json diff --git a/bin/^3.3.x-dev/prepare_project_edition.sh b/bin/^3.3.x-dev/prepare_project_edition.sh index 1c8ab8d..e815e3d 100644 --- a/bin/^3.3.x-dev/prepare_project_edition.sh +++ b/bin/^3.3.x-dev/prepare_project_edition.sh @@ -135,6 +135,12 @@ sudo sed -i "s/\['test' => true\]/\['test' => true, 'behat' => true\]/g" config/ # Create a default Behat configuration file cp "behat_ibexa_${PROJECT_EDITION}.yaml" behat.yaml +if [[ $PHP_IMAGE == *"8.2"* ]]; then + echo "> Set PHP 8.2 Ibexa error handler to avoid deprecations" + docker exec install_dependencies composer config extra.runtime.error_handler "\\Ibexa\\Contracts\\Core\\MVC\\Symfony\\ErrorHandler\\Php82HideDeprecationsErrorHandler" + docker exec install_dependencies composer dump-autoload +fi + echo "> Display composer.json for debugging" cat composer.json diff --git a/bin/stable/prepare_project_edition.sh b/bin/stable/prepare_project_edition.sh index 3d48d83..0e468f0 100755 --- a/bin/stable/prepare_project_edition.sh +++ b/bin/stable/prepare_project_edition.sh @@ -56,6 +56,12 @@ sudo sed -i "s/\['test' => true\]/\['test' => true, 'behat' => true\]/g" config/ # Create a default Behat configuration file cp "behat_ibexa_${PROJECT_EDITION}.yaml" behat.yaml +if [[ $PHP_IMAGE == *"8.2"* ]]; then + echo "> Set PHP 8.2 Ibexa error handler to avoid deprecations" + docker exec install_dependencies composer config extra.runtime.error_handler "\\Ibexa\\Contracts\\Core\\MVC\\Symfony\\ErrorHandler\\Php82HideDeprecationsErrorHandler" + docker exec install_dependencies composer dump-autoload +fi + # Depenencies are installed and container can be removed docker container stop install_dependencies docker container rm install_dependencies