Example #1
0
 /**
  * Store the applied update versions
  *
  * @return parent::applyUpdates()
  */
 public function applyUpdates()
 {
     $dbVer = $this->_getResource()->getDbVersion($this->_resourceName);
     $configVer = (string) $this->_moduleConfig->version;
     $this->setDbVer($dbVer);
     $this->setConfigVer($configVer);
     return parent::applyUpdates();
 }
Example #2
0
 /**
  * Do not install module if Magento is not installed yet.
  * This prevents error during Mage_Cms data install.
  *
  * @see Mage_Core_Model_Resource_Setup::applyUpdates()
  */
 public function applyUpdates()
 {
     if (!Mage::isInstalled()) {
         $modules = Mage::getConfig()->getNode('modules')->children();
         $myModule = substr(__CLASS__, 0, strpos(__CLASS__, '_Model'));
         foreach ($modules as $moduleName => $moduleNode) {
             if ($moduleName != $myModule) {
                 Mage::getConfig()->addAllowedModules($moduleName);
             }
         }
         Mage::getConfig()->reinit();
         return $this;
     }
     return parent::applyUpdates();
 }
Example #3
0
 public function applyUpdates()
 {
     if (!Mage::isInstalled()) {
         $dir = "app/code/local/Wyomind/";
         $ret = array();
         if (is_dir($dir)) {
             if (($dh = opendir($dir)) != false) {
                 while (($file = readdir($dh)) !== false) {
                     if (is_dir($dir . $file) && $file != "." && $file != "..") {
                         $enabled = Mage::getConfig()->getModuleConfig('Wyomind_' . ucfirst($namespace = strtolower($file)))->is('active', 'true');
                         if ($enabled) {
                             $ret[] = $file;
                         }
                     }
                 }
                 closedir($dh);
             }
         }
         Mage::getConfig()->saveConfig("notificationmanager/notificationmanager/extensions", implode(',', $ret), "default", "0");
         Mage::getConfig()->cleanCache();
     }
     return parent::applyUpdates();
 }
 /**
  * Apply Index module DB updates and sync indexes declaration
  *
  * @return void
  */
 public function applyUpdates()
 {
     parent::applyUpdates();
     $this->_syncIndexes();
 }
Example #5
0
 /**
  * Prevent sql updates from running before Magento is installed.
  *
  * @return \EcomDev_Cms_Model_Resource_Setup
  */
 public function applyUpdates()
 {
     return Mage::isInstalled() ? parent::applyUpdates() : $this;
 }
 public function applyUpdates()
 {
     // double running protection
     usleep(1000000);
     // 1 sec
     if ($this->isLocked()) {
         return;
     }
     $this->lock();
     try {
         $this->beforeModuleDbModification();
         parent::applyUpdates();
         $this->afterModuleDbModification();
     } catch (Exception $e) {
         $this->unlock();
         throw $e;
     }
     $this->unlock();
 }