Skip to content

Commit

Permalink
Merge branch 'sw-26770/updater-php-compatibility' into '5.7'
Browse files Browse the repository at this point in the history
SW-26770 - Revert "SW-26770 - Extend version compatibility of updater command" and add deprecation warning suppression

See merge request shopware/5/product/shopware!841
  • Loading branch information
philipreinken committed Jun 21, 2022
2 parents 97792c7 + d7fa75a commit 103e437
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 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
2 changes: 1 addition & 1 deletion recovery/update/src/Command/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
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 103e437

Please sign in to comment.