From 57adb83f4d65fc34bf938562bbc3806befa4b57b Mon Sep 17 00:00:00 2001
From: Philip Gatzka
Date: Tue, 21 Jun 2022 10:01:18 +0200
Subject: [PATCH 1/2] SW-26770 - Revert "SW-26770 - Extend version
compatibility of updater command"
This reverts commit 6f24d5a619ee7697ea786d13ddd656bd8d3a387b.
---
recovery/update/src/Command/UpdateCommand.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/recovery/update/src/Command/UpdateCommand.php b/recovery/update/src/Command/UpdateCommand.php
index 08ca86225e0..60ac3786286 100644
--- a/recovery/update/src/Command/UpdateCommand.php
+++ b/recovery/update/src/Command/UpdateCommand.php
@@ -80,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->getHelper('question')
);
- if (!is_dir(UPDATE_FILES_PATH ?? '') && !is_dir(UPDATE_ASSET_PATH ?? '')) {
+ if (!is_dir(UPDATE_FILES_PATH) && !is_dir(UPDATE_ASSET_PATH)) {
$ioService->writeln('No update files found.');
return 1;
From d7fa75a269c6a20a9d88d89213a00c2338154619 Mon Sep 17 00:00:00 2001
From: Philip Gatzka
Date: Tue, 21 Jun 2022 11:23:00 +0200
Subject: [PATCH 2/2] SW-26770 - Suppress deprecation warnings in
installer/updater
---
recovery/install/check.php | 2 +-
recovery/install/index.php | 2 +-
recovery/update/index.php | 3 ++-
recovery/update/src/Console/Application.php | 4 ++--
recovery/update/src/app.php | 2 +-
5 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/recovery/install/check.php b/recovery/install/check.php
index 2bbef0b5e0f..0db11b30a0f 100644
--- a/recovery/install/check.php
+++ b/recovery/install/check.php
@@ -22,7 +22,7 @@
* our trademarks remain entirely with us.
*/
-error_reporting(-1);
+error_reporting(E_ALL ^ E_DEPRECATED);
ini_set('display_errors', true);
$tokenFile = __DIR__ . '/tmp/token';
diff --git a/recovery/install/index.php b/recovery/install/index.php
index d725cffd68f..5e9d30cbdbe 100644
--- a/recovery/install/index.php
+++ b/recovery/install/index.php
@@ -42,7 +42,7 @@
require_once __DIR__ . '/../common/autoload.php';
-error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE ^ E_DEPRECATED);
ini_set('display_errors', 1);
date_default_timezone_set('UTC');
set_time_limit(0);
diff --git a/recovery/update/index.php b/recovery/update/index.php
index 959bf821015..65c7d8c5845 100644
--- a/recovery/update/index.php
+++ b/recovery/update/index.php
@@ -41,8 +41,9 @@
use Shopware\Recovery\Update\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE ^ E_DEPRECATED);
+
if (PHP_SAPI === 'cli') {
- error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', 1);
$input = new ArgvInput();
diff --git a/recovery/update/src/Console/Application.php b/recovery/update/src/Console/Application.php
index c36280ddc57..c5f5d2f175a 100644
--- a/recovery/update/src/Console/Application.php
+++ b/recovery/update/src/Console/Application.php
@@ -108,11 +108,11 @@ private function registerErrorHandler()
{
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
// error was suppressed with the @-operator
- if (error_reporting() === 0 || $errno === E_USER_DEPRECATED) {
+ if (error_reporting() === 0) {
return false;
}
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
- });
+ }, E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED);
}
}
diff --git a/recovery/update/src/app.php b/recovery/update/src/app.php
index 9e4fe1e4d2a..44424a5f451 100644
--- a/recovery/update/src/app.php
+++ b/recovery/update/src/app.php
@@ -33,7 +33,7 @@
date_default_timezone_set('Europe/Berlin');
ini_set('display_errors', 1);
-error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE ^ E_DEPRECATED);
$config = require __DIR__ . '/../config/config.php';
$container = new Container(new PimpleContainer(), $config);