From 5183fe55bc7f0a846d8451680520c3edc232a91d Mon Sep 17 00:00:00 2001 From: Ben Robie Date: Thu, 26 Apr 2012 13:29:33 -0700 Subject: [PATCH] Adding dispatch of an event before and after applyAllUpdates(). This allows for the ability to put in a mechanism to prevent errors being displayed to users if more than one make a request in the same span of time that the install/upgrade scripts are running. This mechanism could be: waiting, sending to an seperate page, etc. Now, we would not have to turn on maintainence mode...potentially. --- app/code/core/Mage/Core/Model/Resource/Setup.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/core/Mage/Core/Model/Resource/Setup.php b/app/code/core/Mage/Core/Model/Resource/Setup.php index ad1cac9748017..bbae0be29b87b 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup.php @@ -218,6 +218,7 @@ protected function _getResource() */ static public function applyAllUpdates() { + Mage::dispatchEvent('apply_db_schema_updates_before'); Mage::app()->setUpdateMode(true); self::$_hadUpdates = false; @@ -243,6 +244,7 @@ static public function applyAllUpdates() } Mage::app()->setUpdateMode(false); + Mage::dispatchEvent('apply_db_schema_updates_after'); self::$_schemaUpdatesChecked = true; return true; }