Example #1
0
 protected function _initExtensions()
 {
     $extensions = array();
     $modules = array_keys((array) Mage::getConfig()->getNode('modules')->children());
     sort($modules);
     foreach ($modules as $moduleName) {
         if (strstr($moduleName, 'AW_') === false) {
             continue;
         }
         if ($moduleName == 'AW_Core' || $moduleName == 'AW_All') {
             continue;
         }
         // Detect extension platform
         try {
             if ($platform = Mage::getConfig()->getNode("modules/{$moduleName}/platform")) {
                 $platform = strtolower($platform);
                 $ignore_platform = false;
             } else {
                 throw new Exception();
             }
         } catch (Exception $e) {
             $platform = "ce";
             $ignore_platform = true;
         }
         $platform = AW_All_Helper_Versions::convertPlatform($platform);
         // Detect installed version
         $ver = Mage::getConfig()->getModuleConfig($moduleName)->version;
         $isPlatformValid = $platform >= $this->getPlatform();
         $feedInfo = $this->getExtensionInfo($moduleName);
         $upgradeAvailable = $this->_convertVersion($feedInfo->getLatestVersion()) - $this->_convertVersion($ver) > 0;
         $extensions[] = new Varien_Object(array('version' => $ver, 'name' => $moduleName, 'is_platform_valid' => $isPlatformValid, 'platform' => $platform, 'feed_info' => $feedInfo, 'upgrade_available' => $upgradeAvailable));
     }
     return $extensions;
 }
Example #2
0
 protected function _initExtensions()
 {
     $extensions = array();
     $modules = array_keys((array) Mage::getConfig()->getNode('modules')->children());
     sort($modules);
     foreach ($modules as $moduleName) {
         if (strstr($moduleName, 'AW_') === false) {
             continue;
         }
         if ($moduleName == 'AW_Core' || $moduleName == 'AW_All') {
             continue;
         }
         // Detect extension platform
         try {
             if ($platform = Mage::getConfig()->getNode("modules/{$moduleName}/platform")) {
                 $platform = strtolower($platform);
                 $ignore_platform = false;
             } else {
                 throw new Exception();
             }
         } catch (Exception $e) {
             $platform = "ce";
             $ignore_platform = true;
         }
         $platform = AW_All_Helper_Versions::convertPlatform($platform);
         // Detect installed version
         $ver = Mage::getConfig()->getModuleConfig($moduleName)->version;
         if ((bool) $ver === false) {
             $_moduleConfigFilePath = Mage::getConfig()->getModuleDir('etc', $moduleName) . DS . 'config.xml';
             if (file_exists($_moduleConfigFilePath)) {
                 $_configXml = new SimpleXMLElement(file_get_contents($_moduleConfigFilePath));
                 $ver = (string) $_configXml->modules->{$moduleName}->version;
             }
         }
         $isPlatformValid = $platform >= $this->getPlatform();
         $feedInfo = $this->getExtensionInfo($moduleName);
         $upgradeAvailable = $this->_convertVersion($feedInfo->getLatestVersion()) - $this->_convertVersion($ver) > 0;
         if (null !== $feedInfo->getDisplayName()) {
             $moduleName = $feedInfo->getDisplayName();
         }
         $extensions[] = new Varien_Object(array('version' => $ver, 'name' => $moduleName, 'is_platform_valid' => $isPlatformValid, 'platform' => $platform, 'feed_info' => $feedInfo, 'upgrade_available' => $upgradeAvailable));
     }
     return $extensions;
 }
 public function checkExtensions()
 {
     $modules = array_keys((array) Mage::getConfig()->getNode('modules')->children());
     sort($modules);
     $magentoPlatform = AW_All_Helper_Versions::getPlatform();
     foreach ($modules as $extensionName) {
         if (strstr($extensionName, 'AW_') === false) {
             continue;
         }
         if ($extensionName == 'AW_Core' || $extensionName == 'AW_All') {
             continue;
         }
         if ($platformNode = $this->getExtensionPlatform($extensionName)) {
             $extensionPlatform = AW_All_Helper_Versions::convertPlatform($platformNode);
             if ($extensionPlatform < $magentoPlatform) {
                 $this->disableExtensionOutput($extensionName);
             }
         }
     }
     return $this;
 }