Skip to content

Commit

Permalink
Added DEV_PHP_STRICT env variable (#2882)
Browse files Browse the repository at this point in the history
* Show all errors

* Update

* Revert "Update"

This reverts commit 7909795.

* Added comment

* Updated README.md

* Typo
  • Loading branch information
sreichel authored Jan 3, 2023
1 parent aff70df commit 1c7bb20
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
38 changes: 35 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,35 @@ level of backwards compatibility to the official releases.

**Pull requests with bug fixes and security patches from the community are encouraged and welcome!**

---

## Table of contents

- [Requirements](#requirements)
- [Optional](#optional)
- [Installation](#installation)
- [Composer](#composer)
- [Git](#git)
- [Secure your installation](#secure-your-installation)
- [Changes](#changes)
- [Between Magento 1.9.4.5 and OpenMage 19.x](#between-magento-1945-and-openmage-19x)
- [Between OpenMage 19.4.18 / 20.0.16 and 19.4.19 / 20.0.17](#between-openmage-19418--20016-and-19419--20017)
- [Since OpenMage 19.5.0 / 20.1.0](#since-openmage-1950--2010)
- [New Config Options](#new-config-options)
- [New Events](#new-events)
- [Changes to SOAP/WSDL](#changes-to-soapwsdl)
- [Development Environment with ddev](#development-environment-with-ddev)
- [Development with PHP 8.1](#development-with-php-81)
- [PhpStorm Factory Helper](#phpstorm-factory-helper)
- [Versioning](#versioning)
- [Public Communication](#public-communication)
- [Maintainers](#maintainers)
- [License](#license)
- [Contributors](#contributors-)

## Requirements

- PHP 7.3+ (PHP 8.0 is supported)
- PHP 7.3+ (PHP 8.0 is supported, PHP 8.1 is work in progress)
- MySQL 5.6+ (8.0+ recommended) or MariaDB


Expand All @@ -33,7 +59,7 @@ __Please be aware that although OpenMage is compatible that one or more extensio

## Installation

### Using Composer
### Composer

Download the latest archive and extract it, clone the repo, or add a composer dependency to your existing project like so:

Expand All @@ -49,7 +75,7 @@ composer require "openmage/magento-lts":"dev-main"

<small>Note: `dev-main` is just an alias for current `1.9.4.x` branch and may change</small>

### Using Git
### Git

If you want to contribute to the project:

Expand Down Expand Up @@ -211,6 +237,12 @@ grep -rn 'urn:Magento' --include \*.xml
$ ddev launch
```

## Development with PHP 8.1

Deprecation errors are supressed by default.

If you want to work on PHP 8.1 support, set environment variable `DEV_PHP_STRICT` to `1`, to show all errors.

## PhpStorm Factory Helper

This repo includes class maps for the core Magento files in `.phpstorm.meta.php`.
Expand Down
6 changes: 5 additions & 1 deletion app/code/core/Mage/Core/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline)
}

// Suppress deprecation warnings on PHP 7.x
if ($errno == E_DEPRECATED && version_compare(PHP_VERSION, '7.0.0', '>=')) {
// set environment variable DEV_PHP_STRICT to 1 will show E_DEPRECATED errors
if ((!isset($_ENV['DEV_PHP_STRICT']) || $_ENV['DEV_PHP_STRICT'] != '1')
&& $errno == E_DEPRECATED
&& version_compare(PHP_VERSION, '7.0.0', '>=')
) {
return true;
}

Expand Down

0 comments on commit 1c7bb20

Please sign in to comment.