From 1fbb61e277f1fbea34d3d16e70f3a6409becf80d Mon Sep 17 00:00:00 2001 From: Eugene Lamskoy Date: Wed, 22 Dec 2021 00:20:23 +0200 Subject: [PATCH 1/9] Config cache for system.xml loader --- app/code/core/Mage/Adminhtml/Model/Config.php | 61 ++++++++++++++++++- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Model/Config.php b/app/code/core/Mage/Adminhtml/Model/Config.php index e4f77ff0650..eb1288983e1 100644 --- a/app/code/core/Mage/Adminhtml/Model/Config.php +++ b/app/code/core/Mage/Adminhtml/Model/Config.php @@ -34,6 +34,15 @@ */ class Mage_Adminhtml_Model_Config extends Varien_Simplexml_Config { + /** + * @var string + */ + protected $_cacheId = 'mage_adminhtml_config_system_xml'; + + /** + * @var Mage_Core_Model_Config_Base + */ + protected $_config; /** * Enter description here... @@ -80,6 +89,54 @@ public function getTabs() return $this->_tabs; } + /** + * @param array $params + */ + public function __construct(array $params = array()) + { + $this->_cacheChecksum = null; + $this->setCache(Mage::app()->getCache()); + $this->setCacheTags([Mage_Core_Model_Config::CACHE_TAG]); + if (!$this->loadCache()) { + /** @var Mage_Core_Model_Config_Base $config */ + $this->_config = Mage::getConfig()->loadModulesConfiguration('system.xml') + ->applyExtends(); + $this->saveCache(); + } + } + + /** + * @param $tags + * @return $this|Mage_Adminhtml_Model_Config + */ + public function saveCache($tags=null) + { + if ($this->getCacheSaved()) { + return $this; + } + if (is_null($tags)) { + $tags = $this->_cacheTags; + } + $xmlString = $this->_config->getXmlString(); + $this->_saveCache($xmlString, $this->getCacheId(), $tags, $this->getCacheLifetime()); + $this->setCacheSaved(true); + return $this; + } + + /** + * @return bool + */ + public function loadCache() + { + $xmlString = $this->_loadCache($this->getCacheId()); + $class = Mage::getConfig()->getModelClassName('core/config_base'); + $this->_config = new $class(); + if ($this->_config->loadString($xmlString)) { + return true; + } + return false; + } + /** * Init modules configuration * @@ -87,9 +144,7 @@ public function getTabs() */ protected function _initSectionsAndTabs() { - $config = Mage::getConfig()->loadModulesConfiguration('system.xml') - ->applyExtends(); - + $config = $this->_config; Mage::dispatchEvent('adminhtml_init_system_config', array('config' => $config)); $this->_sections = $config->getNode('sections'); $this->_tabs = $config->getNode('tabs'); From 9fb0b70fa80e5280b7c6ddb059083cbbaf8edb12 Mon Sep 17 00:00:00 2001 From: Eugene Lamskoy Date: Fri, 31 Dec 2021 13:00:00 +0200 Subject: [PATCH 2/9] Uses cache added, libxml internal errors for loading cache string --- app/code/core/Mage/Adminhtml/Model/Config.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Model/Config.php b/app/code/core/Mage/Adminhtml/Model/Config.php index eb1288983e1..6a3cc7c5aaa 100644 --- a/app/code/core/Mage/Adminhtml/Model/Config.php +++ b/app/code/core/Mage/Adminhtml/Model/Config.php @@ -97,11 +97,14 @@ public function __construct(array $params = array()) $this->_cacheChecksum = null; $this->setCache(Mage::app()->getCache()); $this->setCacheTags([Mage_Core_Model_Config::CACHE_TAG]); - if (!$this->loadCache()) { + $usesCache = Mage::app()->useCache('config'); + if (!$usesCache || !$this->loadCache()) { /** @var Mage_Core_Model_Config_Base $config */ $this->_config = Mage::getConfig()->loadModulesConfiguration('system.xml') ->applyExtends(); - $this->saveCache(); + if ($usesCache) { + $this->saveCache(); + } } } @@ -131,9 +134,11 @@ public function loadCache() $xmlString = $this->_loadCache($this->getCacheId()); $class = Mage::getConfig()->getModelClassName('core/config_base'); $this->_config = new $class(); + libxml_use_internal_errors(true); if ($this->_config->loadString($xmlString)) { return true; } + libxml_clear_errors(); return false; } From a6297b0e875ce8ab5234c1fb14608b7072b741a4 Mon Sep 17 00:00:00 2001 From: Eugene Lamskoy Date: Tue, 4 Jan 2022 20:49:27 +0000 Subject: [PATCH 3/9] Cache description for system.xml cache --- app/code/core/Mage/Core/etc/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml index 630fd978cfb..110599fa210 100644 --- a/app/code/core/Mage/Core/etc/config.xml +++ b/app/code/core/Mage/Core/etc/config.xml @@ -122,7 +122,7 @@ - System(config.xml, local.xml) and modules configuration files(config.xml). + System(config.xml, local.xml) and modules configuration files(config.xml, system.xml). CONFIG From 1ba7c3414d3f53f8ab12c86e2d051a651fca0f52 Mon Sep 17 00:00:00 2001 From: Eugene Lamskoy Date: Thu, 27 Jan 2022 20:43:36 +0200 Subject: [PATCH 4/9] Whitespaces --- app/code/core/Mage/Core/etc/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml index 110599fa210..f13dad58fbc 100644 --- a/app/code/core/Mage/Core/etc/config.xml +++ b/app/code/core/Mage/Core/etc/config.xml @@ -122,7 +122,7 @@ - System(config.xml, local.xml) and modules configuration files(config.xml, system.xml). + System (config.xml, local.xml) and modules configuration files (config.xml, system.xml). CONFIG From b08860505aad2caf89b4b4396250bd383c547fe0 Mon Sep 17 00:00:00 2001 From: luigifab <31816829+luigifab@users.noreply.github.com> Date: Wed, 25 May 2022 09:40:51 +0200 Subject: [PATCH 5/9] Check if $xmlString is not empty --- app/code/core/Mage/Adminhtml/Model/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Model/Config.php b/app/code/core/Mage/Adminhtml/Model/Config.php index 6a3cc7c5aaa..1635a1e6629 100644 --- a/app/code/core/Mage/Adminhtml/Model/Config.php +++ b/app/code/core/Mage/Adminhtml/Model/Config.php @@ -135,7 +135,7 @@ public function loadCache() $class = Mage::getConfig()->getModelClassName('core/config_base'); $this->_config = new $class(); libxml_use_internal_errors(true); - if ($this->_config->loadString($xmlString)) { + if (!empty($xmlString) && $this->_config->loadString($xmlString)) { return true; } libxml_clear_errors(); From 6afcb3e2ca524f9f269d8180ec3fc3cb47f4f6a0 Mon Sep 17 00:00:00 2001 From: luigifab <31816829+luigifab@users.noreply.github.com> Date: Wed, 25 May 2022 09:43:57 +0200 Subject: [PATCH 6/9] Add text to CSV --- app/locale/en_US/Mage_Core.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/app/locale/en_US/Mage_Core.csv b/app/locale/en_US/Mage_Core.csv index 0f0bfc66135..8d263ba747a 100644 --- a/app/locale/en_US/Mage_Core.csv +++ b/app/locale/en_US/Mage_Core.csv @@ -431,3 +431,4 @@ "You will have to log in after you save your custom admin path.","You will have to log in after you save your custom admin path." "Your design change for the specified store intersects with another one, please specify another date range.","Your design change for the specified store intersects with another one, please specify another date range." "database ""%s""","database ""%s""" +"System (config.xml, local.xml) and modules configuration files (config.xml, system.xml).","System (config.xml, local.xml) and modules configuration files (config.xml, system.xml)." From ac001132ae2eee4191028ce524ea4dcad879dc82 Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano Date: Wed, 8 Jun 2022 11:38:58 +0100 Subject: [PATCH 7/9] Removed unused parameter --- app/code/core/Mage/Adminhtml/Model/Config.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Model/Config.php b/app/code/core/Mage/Adminhtml/Model/Config.php index 1635a1e6629..f9268240d7d 100644 --- a/app/code/core/Mage/Adminhtml/Model/Config.php +++ b/app/code/core/Mage/Adminhtml/Model/Config.php @@ -89,10 +89,7 @@ public function getTabs() return $this->_tabs; } - /** - * @param array $params - */ - public function __construct(array $params = array()) + public function __construct() { $this->_cacheChecksum = null; $this->setCache(Mage::app()->getCache()); From 0fba5a3996333c01e7c86b5d1d8e767fee1a94a8 Mon Sep 17 00:00:00 2001 From: Mohamed ELIDRISSI <67818913+elidrissidev@users.noreply.github.com> Date: Wed, 8 Jun 2022 12:53:12 +0100 Subject: [PATCH 8/9] Resolve phpstan doc block issues --- app/code/core/Mage/Adminhtml/Model/Config.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Model/Config.php b/app/code/core/Mage/Adminhtml/Model/Config.php index f9268240d7d..68deefd43c0 100644 --- a/app/code/core/Mage/Adminhtml/Model/Config.php +++ b/app/code/core/Mage/Adminhtml/Model/Config.php @@ -96,7 +96,6 @@ public function __construct() $this->setCacheTags([Mage_Core_Model_Config::CACHE_TAG]); $usesCache = Mage::app()->useCache('config'); if (!$usesCache || !$this->loadCache()) { - /** @var Mage_Core_Model_Config_Base $config */ $this->_config = Mage::getConfig()->loadModulesConfiguration('system.xml') ->applyExtends(); if ($usesCache) { @@ -106,7 +105,7 @@ public function __construct() } /** - * @param $tags + * @param array|null $tags * @return $this|Mage_Adminhtml_Model_Config */ public function saveCache($tags=null) From 90dfd4c7848d42c86111c04094f0a9615ea358c2 Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano Date: Wed, 8 Jun 2022 13:53:31 +0100 Subject: [PATCH 9/9] Added info about this PR to README --- README.md | 337 +++++++++++++++++++++++++++++------------------------- 1 file changed, 182 insertions(+), 155 deletions(-) diff --git a/README.md b/README.md index b5fccbfcfe0..8b7c7c1dd32 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@

-All Contributors +All Contributors -Build Status Total Downloads License +
+PHP workflow Badge +Sonar workflow badge +Static Code Analyses workflow badge +Unit Tests workflow badge

# Magento - Long Term Support @@ -28,11 +32,9 @@ Note, the branches older than `1.9.4.x` and that were created before this strate - MySQL 5.6+ (8.0+ recommended) - (optional) Redis 5+ (6.x recommended, latest verified compatible 6.0.7 with 20.x) - - PHP 7.4 and 8.0 are supported - Please be aware that although OpenMage is compatible that 1 or more extensions may not be - Installation on PHP 7.2.33 (7.2.x), MySQL 5.7.31-34 (5.7.x) Percona Server and Redis 6.x should work fine and confirmed by users. 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. @@ -40,16 +42,17 @@ If using php 7.2+ then mcrypt needs to be disabled in php.ini or pecl to fallbac ## Installation ### Using Composer + Download the latest archive and extract it, clone the repo, or add a composer dependency to your existing project like so: -``` -composer require openmage/magento-lts":"^19.4.0" +```bash +composer require "openmage/magento-lts":"^19.4.0" ``` To get the latest changes use: -``` -composer require openmage/magento-lts":"dev-main" +```bash +composer require "openmage/magento-lts":"dev-main" ``` Note: `dev-main` is just an alias for current `1.9.4.x` branch and may change @@ -58,7 +61,7 @@ composer require openmage/magento-lts":"dev-main" If you want to contribute to the project: -``` +```bash git init git remote add origin https://github.com//magento-lts git pull origin master @@ -74,15 +77,35 @@ git add -A && git commit Most important changes will be listed here, all other changes since `19.4.0` can be found in [release](https://github.com/OpenMage/magento-lts/releases) notes. -### Performance -ToDo: Please add performance related changes as run-time cache, ... +### Between Magento 1.9.4.5 and OpenMage 19.x + +- bug fixes and PHP 7.x and 8.0 compatibility +- added config cache for system.xml #1916 + +### Between OpenMage 19.x and 20.x + +Do not use 20.x.x if you need IE support. + +- removed IE conditional comments, IE styles, IE scripts and IE eot files #1073 +- removed frontend default themes (default, modern, iphone, german, french, blank, blue) #1600 +- fixed incorrect datetime in customer block (`$useTimezone` parameter) #1525 +- add redis as a valid option for `global/session_save` #1513 +- possibility to disable global search in backend #1532 + +For full list of changes, you can [compare tags](https://github.com/OpenMage/magento-lts/compare/1.9.4.x...20.0). ### New Config Options + - `admin/design/use_legacy_theme` +- `admin/global_search/enable` - `admin/emails/admin_notification_email_template` - `catalog/product_image/progressive_threshold` +- `catalog/search/search_separator` +- `dev/log/max_level` +- `newsletter/security/enable_form_key` ### New Events + - `adminhtml_block_widget_form_init_form_values_after` - `adminhtml_block_widget_tabs_html_before` - `adminhtml_sales_order_create_save_before` @@ -101,12 +124,14 @@ There are some new or changed translations, if you want add them to your locale - `app/locale/en_US/Sales_LTS.csv` ### Removed Modules + - `Mage_Compiler` - `Mage_GoogleBase` - `Mage_Xmlconnect` - `Phoenix_Moneybookers` ## 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 @@ -155,190 +180,192 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - + + + + + +

sv3n

💻

Lee Saferite

💻

Colin Mollenhour

💻

David Robinson

💻

Tymoteusz Motylewski

💻

Daniel Fahlke

💻

SNH_NL

💻

sv3n

Lee Saferite

Colin Mollenhour

David Robinson

Tymoteusz Motylewski

Daniel Fahlke

SNH_NL

Marc Romano

💻

Fabian Blechschmidt

💻

Luboš Hubáček

💻

Erik Dannenberg

💻

Jeroen Boersma

💻

Leandro F. L.

💻

Kevin Krieger

💻 📖

Marc Romano

Fabian Blechschmidt

Luboš Hubáček

Erik Dannenberg

Jeroen Boersma

Leandro F. L.

Kevin Krieger

Ng Kiat Siong

💻

bob2021

💻

Bastien Lamamy

💻

Dmitry Furs

💻

Robert Coleman

💻

Milan Davídek

💻

Matt Davenport

💻

Ng Kiat Siong

bob2021

Bastien Lamamy

Dmitry Furs

Robert Coleman

Milan Davídek

Matt Davenport

elfling

💻

henrykb

💻

Tony

💻

Mark Lewis

💻

Eric Sean Turner

💻

Eric Seastrand

💻

Tobias Schifftner

💻

elfling

henrykb

Tony

Mark Lewis

Eric Sean Turner

Eric Seastrand

Tobias Schifftner

Simon Sprankel

💻

Tom Lankhorst

💻

shirtsofholland

💻

sebastianwagner

💻

Maxime Huran

💻

Pepijn

💻

manuperezgo

💻

Simon Sprankel

Tom Lankhorst

shirtsofholland

sebastianwagner

Maxime Huran

Pepijn

manuperezgo

luigifab

💻

Loek van Gool

💻

kpitn

💻

kalenjordan

💻

IOWEB TECHNOLOGIES

💻

Florent

💻

dvdsndr

💻

luigifab

Loek van Gool

kpitn

kalenjordan

IOWEB TECHNOLOGIES

Florent

dvdsndr

Vincent MARMIESSE

💻

Lucas van Staden

💻

zamoroka

💻

wpdevteam

💻

Wouter Samaey

💻

Vova Yatsyuk

💻

Trevor Hartman

💻

Vincent MARMIESSE

Lucas van Staden

zamoroka

wpdevteam

Wouter Samaey

Vova Yatsyuk

Trevor Hartman

Somewhere

💻

Fabian Schmengler />

💻

Roman Hutterer

💻

Sergei Filippov

💻

Sam Steele

💻

Ricardo Velhote

💻

Roy Duineveld

💻

Somewhere

Fabian Schmengler />

Roman Hutterer

Sergei Filippov

Sam Steele

Ricardo Velhote

Roy Duineveld

Roberto Sarmiento Pérez

💻

Pierre Martin

💻

Rafał Dołgopoł

💻

Rafael Patro

💻

Andreas Pointner

💻

Paul Rodriguez

💻

ollb

💻

Roberto Sarmiento Pérez

Pierre Martin

Rafał Dołgopoł

Rafael Patro

Andreas Pointner

Paul Rodriguez

ollb

Nicholas Graham

💻

Makis Palasis

💻

Miguel Balparda

💻

Mark van der Sanden

💻

Micky Socaci

💻

Marvin Sengera

💻

Kostadin A.

💻

Nicholas Graham

Makis Palasis

Miguel Balparda

Mark van der Sanden

Micky Socaci

Marvin Sengera

Kostadin A.

Julien Loizelet

💻

Jonas Hünig

💻

Stefan Jaroschek

💻

Jacques Bodin-Hullin

💻

Wilhelm Ellmann

💻

Edwin.

💻

drago-aca

💻

Julien Loizelet

Jonas Hünig

Stefan Jaroschek

Jacques Bodin-Hullin

Wilhelm Ellmann

Edwin.

drago-aca

Daniel Niedergesäß

💻

J Davis

💻

Damien Biasotto

💻

Daniel Corn

💻

Paweł Cieślik

💻

André Herrn

💻

Pablo Benmaman

💻

Daniel Niedergesäß

J Davis

Damien Biasotto

Daniel Corn

Paweł Cieślik

André Herrn

Pablo Benmaman

aterjung

💻

altdovydas

💻

Alisson Júnior

💻

Alex Kirsch

💻

Branden

💻

Pof Magicfingers

💻

Michael Thessel

💻

aterjung

altdovydas

Alisson Júnior

Alex Kirsch

Branden

Pof Magicfingers

Michael Thessel

Jonathan Laliberte

💻

Ivan Chepurnyi

💻

Igor

💻

Elias Kotlyar

💻

Hejty1

💻

Gaelle

💻

Frédéric MARTINEZ

💻

Jonathan Laliberte

Ivan Chepurnyi

Igor

Elias Kotlyar

Hejty1

Gaelle

Frédéric MARTINEZ

Tobias Faust

💻

AndresInSpace

💻

Francesco Boes

💻

Daniel Bachmann

💻

Damian Luszczymak

💻

Fabrizio Balliano

💻 📖

Jouriy

💻

Tobias Faust

AndresInSpace

Francesco Boes

Daniel Bachmann

Damian Luszczymak

Fabrizio Balliano

Jouriy

Digital Pianism

💻

Justin Beaty

💻

ADDISON

💻 📖

Aria Stewart

💻

Dean Williams

💻

Henry Hirsch

💻

kdckrs

💻

Digital Pianism

Justin Beaty

ADDISON

Aria Stewart

Dean Williams

Henry Hirsch

kdckrs

Martin René Sørensen

💻

Frank Rochlitzer

💻

AlterWeb

💻

Caprico

💻

David Windell

💻

Dragan Atanasov

💻

Eugene Lamskoy

💻

Martin René Sørensen

Frank Rochlitzer

AlterWeb

Caprico

David Windell

Dragan Atanasov

Eugene Lamskoy

Ferdinand

💻

Himanshu

💻

Jakub Idziak

💻

Joseph Maxwell

💻

Joshua Dickerson

💻

Kevin Bortnick

💻

Mehdi Chaouch

💻

Ferdinand

Himanshu

Jakub Idziak

Joseph Maxwell

Joshua Dickerson

Kevin Bortnick

Mehdi Chaouch

Mohamed ELIDRISSI

💻

Justin van Elst

💻

Nicholas Graham

💻

Patrick Schnell

💻

Patrick Cronin

💻

Petr Švamberg

💻

Rafael Corrêa Gomes

💻

Mohamed ELIDRISSI

Justin van Elst

Nicholas Graham

Patrick Schnell

Patrick Cronin

Petr Švamberg

Rafael Corrêa Gomes

Ralf Siepker

💻

Sunel Tr

💻

Tom Klingenberg

💻

Toon

💻

WEXO team

💻

Wilfried Wolf

💻

akrzemianowski

💻

Ralf Siepker

Sunel Tr

Tom Klingenberg

Toon

WEXO team

Wilfried Wolf

akrzemianowski

andthink

💻

eetzen

💻

lemundo-team

💻

mdlonline

💻

andthink

eetzen

lemundo-team

mdlonline

Benjamin MARROT

Tino Mewes