Skip to content

Commit

Permalink
SW-26770 - Suppress deprecation warnings in installer/updater
Browse files Browse the repository at this point in the history
  • Loading branch information
philipreinken committed Jun 21, 2022
1 parent 57adb83 commit d7fa75a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion recovery/install/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion recovery/install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion recovery/update/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions recovery/update/src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion recovery/update/src/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d7fa75a

Please sign in to comment.