diff --git a/.github/workflows/static-code-analyses.yml b/.github/workflows/static-code-analyses.yml index 67768a292b6..2b022d40cfc 100644 --- a/.github/workflows/static-code-analyses.yml +++ b/.github/workflows/static-code-analyses.yml @@ -12,7 +12,7 @@ jobs: max-parallel: 5 matrix: operating-system: [ubuntu-latest] - php-versions: ['7.0', '7.4'] + php-versions: ['7.3', '8.1'] steps: - uses: actions/checkout@v3 - name: Setup PHP @@ -61,7 +61,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['8.0','8.1'] + php-versions: ['8.2'] steps: - uses: actions/checkout@v3 - name: Setup PHP diff --git a/README.md b/README.md index 2d101bdb4c3..100c137ac8d 100644 --- a/README.md +++ b/README.md @@ -19,21 +19,26 @@ level of backwards compatibility to the official releases. **Pull requests with unofficial bug fixes and security patches from the community are encouraged and welcome!** -Though Magento does not follow [Semantic Versioning](http://semver.org/) we aim to provide a workable system for +### Versioning + +Though Magento does __not__ follow [Semantic Versioning](http://semver.org/) we aim to provide a workable system for dependency definition. Each Magento `1..` release will get its own branch (named `1...x`) that will be independently maintained with upstream patches and community bug fixes for as long as it makes sense -to do so (based on available resources). For example, Magento version `1.9.3.4` was merged into the `1.9.3.x` branch. +to do so (based on available resources). For example, Magento version `1.9.4.5` was merged into the `1.9.4.x` branch. ## Requirements -- PHP 7.0+ (PHP 7.3 with OpenSSL extension strongly recommended and verified compatible) (PHP 7.4 and 8.0 are supported) -- MySQL 5.6+ (8.0+ recommended) -- (optional) Redis 5+ (7.x recommended, latest verified compatible 7.0.4 with 20.x) +- PHP 7.3+ (PHP 8.0 is supported) +- MySQL 5.6+ (8.0+ recommended) or MariaDB + +__Please be aware that although OpenMage is compatible that one or more extensions may not be__ + +### Optional -- PHP 7.4 and 8.0 are supported -- Please be aware that although OpenMage is compatible that 1 or more extensions may not be +- Redis 5+ (6.x recommended, latest verified compatible 6.0.7 with 20.x) -If using php 7.2+ then mcrypt needs to be disabled in php.ini or pecl to fallback on mcryptcompat and phpseclib. mcrypt is deprecated from 7.2+ onwards. +### PHP 7.2+ +If using php 7.2+ then `mcrypt` needs to be disabled in `php.ini` or pecl to fallback on `mcryptcompat` and `phpseclib`. `mcrypt` is deprecated from 7.2+ onwards. ## Installation @@ -60,7 +65,7 @@ If you want to contribute to the project: ```bash git init git remote add origin https://github.com//magento-lts -git pull origin master +git pull origin main git remote add upstream https://github.com/OpenMage/magento-lts git pull upstream 1.9.4.x git add -A && git commit @@ -153,14 +158,22 @@ To find which files need the modification you can run `grep -rn 'urn:Magento' -- ## Development Environment with ddev - Install [ddev](https://ddev.com/get-started/) -- Clone the repository as described in Installation -> Using Git -- Create a ddev config using ```$ ddev config``` the defaults should be good for you -- Open .ddev/config.yaml and change the php version to 7.2 -- Type ```$ ddev start``` to download and start the containers -- Navigate to https://magento-lts.ddev.site -- When you are done you can stop the test system by typing ```$ ddev stop``` - -### PhpStorm Factory Helper +- Clone the repository as described in installation ([Using Git](https://github.com/OpenMage/magento-lts#using-git)) +- Create a ddev config, defaults should be good for you + ```bash + $ ddev config + ``` +- Open `.ddev/config.yaml` and change the php version to your needs +- Download and start the containers + ```bash + $ ddev start + ``` +- Open your site in browser + ```bash + $ ddev launch + ``` + +## PhpStorm Factory Helper This repo includes class maps for the core Magento files in `.phpstorm.meta.php`. To add class maps for installed extensions, you have to install [N98-magerun](https://github.com/netz98/n98-magerun) diff --git a/api.php b/api.php index 7b5b4976351..02ee4c9e85d 100644 --- a/api.php +++ b/api.php @@ -18,8 +18,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -if (version_compare(phpversion(), '7.0.0', '<')===true) { - echo 'It looks like you have an invalid PHP version. OpenMage supports PHP 7.0.0 or newer'; +if (version_compare(phpversion(), '7.3.0', '<')===true) { + echo 'It looks like you have an invalid PHP version. OpenMage supports PHP 7.3.0 or newer'; exit; } diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index 7b90fe47309..5e05bde7ecb 100644 --- a/app/code/core/Mage/Core/functions.php +++ b/app/code/core/Mage/Core/functions.php @@ -392,22 +392,6 @@ function hash_equals($known_string, $user_string) } } -if (version_compare(PHP_VERSION, '7.0.0', '<') && !function_exists('random_int')) { - /** - * Generates pseudo-random integers - * - * @param int $min - * @param int $max - * @return int Returns random integer in the range $min to $max, inclusive. - */ - function random_int($min, $max) - { - mt_srand(); - - return mt_rand($min, $max); - } -} - /** * polyfill for PHP 8.0 function "str_contains" */ @@ -453,15 +437,3 @@ function str_ends_with($haystack, $needle) } } -/** - * polyfill for PHP 7.3 function "is_countable" - */ -if (!function_exists('is_countable')) { - /** - * @param mixed $value - * @return bool - */ - function is_countable($value) { - return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXMLElement; - } -} diff --git a/composer.json b/composer.json index 3d01fa10ade..3f5d757dcf2 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "type": "magento-source", "require": { - "php": ">=7.0 <8.2", + "php": ">=7.3 <8.2", "ext-curl": "*", "ext-dom": "*", "ext-gd": "*", diff --git a/composer.lock b/composer.lock index ed893ad3ffc..4ddefdd583c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f4b990cce5d01312488099f97ebbf22b", + "content-hash": "187bf9a396ea203777cd05ab2129a9f4", "packages": [ { "name": "eloquent/enumeration", @@ -3034,7 +3034,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0 <8.2", + "php": ">=7.3 <8.2", "ext-curl": "*", "ext-dom": "*", "ext-gd": "*", diff --git a/get.php b/get.php index 3dca09e9271..aa769c525fc 100644 --- a/get.php +++ b/get.php @@ -17,12 +17,12 @@ * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -if (version_compare(phpversion(), '7.0.0', '<')===true) { +if (version_compare(phpversion(), '7.3.0', '<')===true) { echo '

Whoops, it looks like you have an invalid PHP version.' - . '

OpenMage supports PHP 7.0.0 or newer.

OpenMage supports PHP 7.3.0 or newer. Find out how to install OpenMage using PHP-CGI as a work-around.

'; exit; } diff --git a/index.php b/index.php index 5e9425537f1..eb1a5671094 100644 --- a/index.php +++ b/index.php @@ -18,11 +18,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -if (version_compare(phpversion(), '7.0.0', '<')===true) { +if (version_compare(phpversion(), '7.3.0', '<')===true) { echo '

-Whoops, it looks like you have an invalid PHP version.

OpenMage supports PHP 7.0.0 or newer. +Whoops, it looks like you have an invalid PHP version.

OpenMage supports PHP 7.3.0 or newer. Find out how to install OpenMage using PHP-CGI as a work-around.

'; exit; diff --git a/install.php b/install.php index f4e178450c6..5a899c4091e 100644 --- a/install.php +++ b/install.php @@ -112,8 +112,8 @@ * */ -if (version_compare(phpversion(), '7.0.0', '<')===true) { - die('ERROR: Whoops, it looks like you have an invalid PHP version. OpenMage supports PHP 7.0.0 or newer.'); +if (version_compare(phpversion(), '7.3.0', '<')===true) { + die('ERROR: Whoops, it looks like you have an invalid PHP version. OpenMage supports PHP 7.3.0 or newer.'); } set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path()); require 'app/bootstrap.php';