public function checkUpdate() { if ($this->getFrequency() + $this->getLastUpdate() > time()) { return $this; } $this->setLastUpdate(); if (!extension_loaded('curl')) { return $this; } if ($this->_isPromoSubscribed()) { // load all new and relevant updates into inbox $feedData = array(); $feedXml = $this->getFeedData(); $wasInstalled = gmdate('Y-m-d H:i:s', Amasty_Base_Helper_Module::baseModuleInstalled()); if ($feedXml && $feedXml->channel && $feedXml->channel->item) { foreach ($feedXml->channel->item as $item) { $date = $this->getDate((string) $item->pubDate); // compare strings, but they are well-formmatted if ($date < $wasInstalled) { continue; } $feedData[] = array('severity' => 3, 'date_added' => $this->getDate($date), 'title' => (string) $item->title, 'description' => (string) $item->description, 'url' => (string) $item->link); } if ($feedData) { $inbox = Mage::getModel('adminnotification/inbox'); if ($inbox) { $inbox->parse($feedData); } } } } //load all available extensions in the cache Amasty_Base_Helper_Module::reload(); return $this; }