Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use no cache in update script to avoid scheme caching

  • Loading branch information...
commit 734f23cbb4331fcc9a4577f35abb45e37896e979 1 parent 04acc27
@fabian fabian authored
Showing with 17 additions and 11 deletions.
  1. +8 −1 shell/abstract.php
  2. +9 −10 shell/apply-updates.php
View
9 shell/abstract.php
@@ -62,6 +62,13 @@
protected $_appType = 'store';
/**
+ * Initialize application options
+ *
+ * @var array
+ */
+ protected $_appOptions = array();
+
+ /**
* Input arguments
*
* @var array
@@ -76,7 +83,7 @@ public function __construct()
{
if ($this->_includeMage) {
require_once $this->_getRootPath() . 'app' . DIRECTORY_SEPARATOR . 'Mage.php';
- Mage::app($this->_appCode, $this->_appType);
+ Mage::app($this->_appCode, $this->_appType, $this->_appOptions);
}
$this->_applyPhpVariables();
View
19 shell/apply-updates.php
@@ -30,6 +30,8 @@ class Mage_Shell_Updates extends Mage_Shell_Abstract
{
protected $_includeMage = true;
+ protected $_appOptions = array('global_ban_use_cache' => true);
+
/**
* Run script
*
@@ -42,19 +44,16 @@ public function run()
} else {
- // re-initialize Admin store
- Mage::app()->getCacheInstance()->cleanType(Mage_Core_Model_Config::CACHE_TAG);
- Mage::app()->init('admin', 'store');
-
- // schema updates
+ // apply updates
Mage_Core_Model_Resource_Setup::applyAllUpdates();
+ Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
- // flush cache for schema changes
- Mage::app()->cleanCache();
- Mage::app()->getCacheInstance()->flush();
+ // now enable caching and save
+ Mage::getConfig()->getOptions()->setData('global_ban_use_cache', false);
- // data updates
- Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
+ // re-init cache
+ Mage::app()->baseInit(array());
+ Mage::getConfig()->loadModules()->loadDb()->saveCache();
echo "All updates successfully applied\n";
}
Please sign in to comment.
Something went wrong with that request. Please try again.