Skip to content

Instantly share code, notes, and snippets.

@Vinai
Forked from colinmollenhour/cleanCache.php
Created November 8, 2013 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Vinai/7370127 to your computer and use it in GitHub Desktop.
Save Vinai/7370127 to your computer and use it in GitHub Desktop.
<?php
umask(0);
ini_set('memory_limit','512M');
set_time_limit(0);
if(file_exists('app/Mage.php')) require 'app/Mage.php';
else require '../../app/Mage.php';
// Init without cache so we get a fresh version
Mage::app('admin','store', array('global_ban_use_cache' => TRUE));
echo "Applying updates...\n";
Mage_Core_Model_Resource_Setup::applyAllUpdates();
Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
echo "Done.\n";
// Now enable caching and save
Mage::getConfig()->getOptions()->setData('global_ban_use_cache', FALSE);
Mage::app()->baseInit(array()); // Re-init cache
Mage::getConfig()->loadModules()->loadDb()->saveCache();
echo "Saved config cache.\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment