当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage::getEdition方法代码示例

本文整理汇总了PHP中Mage::getEdition方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage::getEdition方法的具体用法?PHP Mage::getEdition怎么用?PHP Mage::getEdition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage的用法示例。


在下文中一共展示了Mage::getEdition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: info

 /**
  * Retrieve information about current Magento installation
  *
  * @return array
  */
 public function info()
 {
     $result = array();
     $result['magento_edition'] = Mage::getEdition();
     $result['magento_version'] = Mage::getVersion();
     return $result;
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:12,代码来源:Api.php

示例2: getMagentoEdition

 /**
  * Retrieve Magento edition
  *
  * @return string
  */
 public function getMagentoEdition()
 {
     if (method_exists('Mage', 'getEdition')) {
         // getEdition is only available after Magento CE Version 1.7.0.0
         $edition = Mage::getEdition();
         switch ($edition) {
             case Mage::EDITION_COMMUNITY:
                 $edition = 'CE';
                 break;
             case Mage::EDITION_ENTERPRISE:
                 $edition = 'EE';
                 break;
             case Mage::EDITION_PROFESSIONAL:
                 $edition = 'PE';
                 break;
             case Mage::EDITION_GO:
                 $edition = 'GO';
                 break;
         }
     } else {
         // Check for different Licensetypes to get Magento-Edition
         $path = Mage::getBaseDir();
         if (file_exists($path . DS . 'LICENSE_EE.txt')) {
             $edition = 'EE';
         } elseif (file_exists($path . DS . 'LICENSE_PRO.html')) {
             $edition = 'PE';
         } else {
             $edition = 'CE';
         }
     }
     return $edition;
 }
开发者ID:artwells,项目名称:ext.magento.noovias.extensions,代码行数:37,代码来源:Database.php

示例3: _createOrUpdateAttribute

 private function _createOrUpdateAttribute($code, $data)
 {
     $attribute = $this->_getAttribute($code);
     $canSave = false;
     if (!$attribute) {
         $this->log($this->__('Creating Attribute %s', $code));
         $attribute = Mage::getModel('catalog/resource_eav_attribute');
         $attribute->setData('attribute_code', $code);
         $canSave = true;
         $data = array_replace_recursive($this->_getAttributeDefaultSettings(), $data);
         $data['backend_type'] = $attribute->getBackendTypeByInput($data['frontend_input']);
         $data['source_model'] = Mage::helper('catalog/product')->getAttributeSourceModelByInputType($data['frontend_input']);
         $data['backend_model'] = Mage::helper('catalog/product')->getAttributeBackendModelByInputType($data['frontend_input']);
     }
     foreach ($data as $key => $value) {
         // Skip store labels to be processed after
         if ($key == 'store_labels') {
             continue;
         }
         // YAML will pass product types as an array which needs to be imploded
         if ($key == "product_types") {
             $key = "apply_to";
             $value = implode(",", $value);
         }
         // YAML will pass options as an array which will require to be added differently
         if ($key == "options") {
             continue;
         }
         // Skip setting search_weight if not enterprise
         if ($key == "search_weight" && Mage::getEdition() != Mage::EDITION_ENTERPRISE) {
             continue;
         }
         if ($attribute->getId() && $attribute->getData($key) == $value) {
             continue;
         }
         $attribute->setData($key, $value);
         $this->log($this->__('Setting attribute "%s" %s with %s', $code, $key, $value));
         $canSave = true;
     }
     unset($key);
     unset($value);
     if (!$attribute->getEntityTypeId()) {
         $attribute->setEntityTypeId(Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId());
         $attribute->setIsUserDefined(1);
     }
     try {
         if ($canSave) {
             $attribute->save();
             $this->log($this->__('Saved Attribute %s', $code));
         }
         if ($data['options']) {
             $this->_maintainAttributeOptions($attribute, $data['options']);
         }
         if ($data['store_labels']) {
             $this->_maintainAttributeStoreLabels($attribute, $data['store_labels']);
         }
     } catch (Exception $e) {
         throw $e;
     }
 }
开发者ID:ctidigital,项目名称:magento-configurator,代码行数:60,代码来源:Attributes.php

示例4: nodeToArray

 private function nodeToArray(Varien_Data_Tree_Node $node, $mediaUrl, $baseUrl)
 {
     $result = array();
     $thumbnail = '';
     try {
         $thumbImg = $node->getThumbnail();
         if ($thumbImg != null) {
             $thumbnail = $mediaUrl . 'catalog/category/' . $node->getThumbnail();
         }
     } catch (Exception $e) {
     }
     $result['category_id'] = $node->getId();
     $result['image'] = $mediaUrl . 'catalog/category/' . $node->getImage();
     $result['thumbnail'] = $thumbnail;
     $result['description'] = strip_tags($node->getDescription());
     $result['parent_id'] = $node->getParentId();
     $result['name'] = $node->getName();
     $result['is_active'] = $node->getIsActive();
     $result['children'] = array();
     if (method_exists('Mage', 'getEdition') && Mage::getEdition() == Mage::EDITION_COMMUNITY) {
         $result['url_path'] = $baseUrl . $node->getData('url_path');
     } else {
         $category = Mage::getModel('catalog/category')->load($node->getId());
         $result['url_path'] = $category->getUrl();
     }
     foreach ($node->getChildren() as $child) {
         $result['children'][] = $this->nodeToArray($child, $mediaUrl, $baseUrl);
     }
     return $result;
 }
开发者ID:xiaoguizhidao,项目名称:mydigibits,代码行数:30,代码来源:CategoriesController.php

示例5: getEdition

 public static function getEdition()
 {
     if (!self::$_edition) {
         $configEE = BP . "/app/code/core/Enterprise/Enterprise/etc/config.xml";
         if (!file_exists($configEE)) {
             self::$_edition = 'ce';
         } else {
             $xml = @simplexml_load_file($configEE, 'SimpleXMLElement', LIBXML_NOCDATA);
             if ($xml !== false) {
                 $package = (string) $xml->default->design->package->name;
                 if (!$package) {
                     $package = strtolower(Mage::getEdition());
                 }
                 if ($package == 'enterprise') {
                     self::$_edition = 'ee';
                 } else {
                     self::$_edition = 'pe';
                 }
             } else {
                 self::$_edition = 'unknown';
             }
         }
     }
     return self::$_edition;
 }
开发者ID:technomagegithub,项目名称:olgo.nl,代码行数:25,代码来源:Version.php

示例6: getMageVersion

 /**
  * get Magento version
  *
  * @return string
  */
 public function getMageVersion()
 {
     $mageVersion = Mage::getVersion();
     if (is_callable('Mage::getEdition')) {
         $mageVersion = Mage::getEdition() . ' ' . $mageVersion;
     }
     return $mageVersion;
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:13,代码来源:Support.php

示例7: getFeedUrl

 /**
  * Get Feed URL
  * @return string
  * @throws Zend_Uri_Exception
  */
 public function getFeedUrl()
 {
     $version = Mage::getConfig()->getModuleConfig('PayEx_MasterPass')->version->asArray();
     $params = array('site_url' => Mage::getStoreConfig('web/unsecure/base_url'), 'installed_version' => $version, 'mage_ver' => Mage::getVersion(), 'edition' => Mage::getEdition());
     $uri = Zend_Uri::factory(self::URL_NEWS);
     $uri->addReplaceQueryParameters($params);
     return $uri->getUri();
 }
开发者ID:AndreKlang,项目名称:Payex-Modules-Test,代码行数:13,代码来源:Feed.php

示例8: indexAction

 /**
  * Display search result
  */
 public function indexAction()
 {
     $query = Mage::helper('catalogsearch')->getQuery();
     /* @var $query Mage_CatalogSearch_Model_Query */
     $query->setStoreId(Mage::app()->getStore()->getId());
     if ($query->getQueryText() != '') {
         if (Mage::helper('catalogsearch')->isMinQueryLength()) {
             $query->setId(0)->setIsActive(1)->setIsProcessed(1);
         } else {
             if ($query->getId()) {
                 $query->setPopularity($query->getPopularity() + 1);
             } else {
                 $query->setPopularity(1);
             }
             if ($query->getRedirect()) {
                 $query->save();
                 $this->getResponse()->setRedirect($query->getRedirect());
                 return;
             } else {
                 $query->prepare();
             }
         }
         Mage::helper('catalogsearch')->checkNotes();
         $this->loadLayout();
         // apply custom ajax layout
         if ($this->getRequest()->isAjax()) {
             $update = $this->getLayout()->getUpdate();
             $update->addHandle('catalog_category_layered_ajax_layer');
         }
         $this->_initLayoutMessages('catalog/session');
         $this->_initLayoutMessages('checkout/session');
         // return json formatted response for ajax
         if ($this->getRequest()->isAjax()) {
             $listing = $this->getLayout()->getBlock('search_result_list')->toHtml();
             if (Mage::getEdition() == Mage::EDITION_ENTERPRISE) {
                 $block = $this->getLayout()->getBlock('enterprisesearch.leftnav');
             } else {
                 $block = $this->getLayout()->getBlock('catalogsearch.leftnav');
             }
             $layer = $block->toHtml();
             // Fix urls that contain '___SID=U'
             $urlModel = Mage::getSingleton('core/url');
             $listing = $urlModel->sessionUrlVar($listing);
             $layer = $urlModel->sessionUrlVar($layer);
             $response = array('listing' => $listing, 'layer' => $layer);
             $this->getResponse()->setHeader('Content-Type', 'application/json', true);
             $this->getResponse()->setBody(json_encode($response));
         } else {
             $this->renderLayout();
         }
         if (!Mage::helper('catalogsearch')->isMinQueryLength()) {
             $query->save();
         }
     } else {
         $this->_redirectReferer();
     }
 }
开发者ID:santhosh400,项目名称:ecart,代码行数:60,代码来源:ResultController.php

示例9: getEdition

 /**
  * Retrieves Magento Edition
  *
  * @return string
  */
 public function getEdition()
 {
     if (method_exists('Mage', 'getEdition')) {
         $systemEdition = Mage::getEdition();
         if (isset($this->_editionMapping[$systemEdition])) {
             return $this->_editionMapping[$systemEdition];
         }
     }
     return $this->getBehaviourEdition();
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:15,代码来源:Magento.php

示例10: _verifyMagento

 /**
  * Define magento version and edition
  */
 protected function _verifyMagento()
 {
     include $this->_magentoDir . 'app/Mage.php';
     $this->_version = Mage::getVersion();
     if (method_exists('Mage', 'getEdition')) {
         $this->_edition = Mage::getEdition();
     } else {
         $this->_edition = file_exists($this->_magentoDir . 'app/etc/modules/Enterprise_Enterprise.xml') ? 'Enterprise' : 'Community';
     }
 }
开发者ID:djnewtown,项目名称:judge,代码行数:13,代码来源:generateTags.php

示例11: getCoreVersionInfo

 /**
  * @return array
  */
 public function getCoreVersionInfo()
 {
     $core = array();
     $core['store_id'] = $this->getStoreId();
     $core['mage_version'] = Mage::getVersion();
     if (method_exists('Mage', 'getEdition')) {
         $core['mage_edition'] = Mage::getEdition();
     }
     return $core;
 }
开发者ID:vstorm83,项目名称:ausport,代码行数:13,代码来源:Info.php

示例12: validateDesignConfig

 private function validateDesignConfig()
 {
     if (method_exists('Mage', 'getEdition')) {
         $editionVersion = [Mage::EDITION_ENTERPRISE => '1.14.0', Mage::EDITION_PROFESSIONAL => '1.14.0', Mage::EDITION_COMMUNITY => '1.9.0'];
         if (!version_compare(Mage::getVersion(), $editionVersion[Mage::getEdition()], '>=')) {
             $this->markTestSkipped('Does not supported in this Magento version');
         }
     }
     return false;
 }
开发者ID:albertobraschi,项目名称:EcomDev_LayoutCompiler,代码行数:10,代码来源:FilesTest.php

示例13: _toHtml

 /**
  * Render block HTML
  *
  * @return string
  */
 protected function _toHtml()
 {
     $configHelper = $this->getConfigHelper();
     // Module disabled
     if (!$configHelper->extensionEnabled()) {
         return '';
     }
     if (Mage::getEdition() === Mage::EDITION_ENTERPRISE) {
         // Recreate the widget parameter cache on FPC cleared or just created
         if (!$this->getFullPageCacheEnvironment() && $this->getUniqueId()) {
             $id = RapidCampaign_Promotions_Model_Fpc_Placeholder::CACHE_PREFIX . $this->getUniqueId() . '_params';
             Enterprise_PageCache_Model_Cache::getCacheInstance()->save(serialize($this->getData()), $id);
         }
     }
     if (!$this->validateRules()) {
         return '';
     }
     /** @var RapidCampaign_Promotions_Model_Storage $promotionsStorage */
     $promotionsStorage = Mage::getModel('rapidcampaign_promotions/storage');
     try {
         $promotionModel = $promotionsStorage->getPromotionsModel();
     } catch (Exception $e) {
         $promotionModel = $promotionsStorage->getCachedPromotionsModel();
     }
     $promotion = $promotionModel->load($this->getData('promotion'));
     // Promotion does not exist
     if ($promotion->isEmpty()) {
         return '';
     }
     $urlParams = $this->getUrlParams($promotion);
     $promotionData = $promotion->getData();
     $iframeUrl = $promotionData['embed_url'] . '?' . http_build_query($urlParams);
     $iframeWidth = $promotionData['width'] ?: self::IFRAME_WIDTH;
     $iframeHeight = $promotionData['height'] ?: self::IFRAME_HEIGHT;
     if ($configHelper->testModeEnabled()) {
         $embedScript = self::IFRAME_JS_TEST_BASE_URL;
     } else {
         $embedScript = self::IFRAME_JS_BASE_URL;
     }
     $isModalEnabled = $this->getData('modal_enabled');
     $hideDiv = $isModalEnabled ? "display:none" : "";
     if (preg_match('/sales/i', $promotionData['promotion_category'])) {
         $embedScript .= self::IFRAME_SALES_EMBED;
         $iframeString = sprintf('<div class="_rc_iframe %s" style="%s" data-url="%s" data-width="%s" data-height="%s"></div>', $this->getIframeClass($this->getUniqueId()), $hideDiv, $iframeUrl, $iframeWidth, $iframeHeight);
     } else {
         $embedScript .= self::IFRAME_MARKETING_EMBED;
         $iframeString = sprintf('<div class="_rc_miframe %s" style="%s" data-url="%s"></div>', $this->getIframeClass($this->getUniqueId()), $hideDiv, $iframeUrl);
     }
     $jsString = sprintf('<script type="text/javascript" src="%s"></script>', $embedScript);
     $html = $iframeString . $jsString;
     if ($isModalEnabled) {
         $html .= $this->getPromotionModalJs($promotion);
     }
     return $html;
 }
开发者ID:RapidCampaign,项目名称:rapid-magento-extension,代码行数:60,代码来源:Promotion.php

示例14: _verifyMagento

 protected function _verifyMagento($pathToMagentoBaseDir)
 {
     include $pathToMagentoBaseDir . 'app/Mage.php';
     $this->_version = \Mage::getVersion();
     if (method_exists('Mage', 'getEdition')) {
         $this->_edition = \Mage::getEdition();
     } else {
         preg_match('/^1\\.(\\d+)\\./', $this->_version, $matches);
         $majorRelease = $matches[1];
         $this->_edition = $majorRelease < 7 ? 'Community' : 'Enterprise';
     }
     echo 'Analyzing Magento ' . $this->_version . ' (' . $this->_edition . ' Edition)...' . PHP_EOL;
 }
开发者ID:djnewtown,项目名称:judge,代码行数:13,代码来源:parseDatabaseSchema.php

示例15: isAvailableVersion

 public function isAvailableVersion()
 {
     $mage = new Mage();
     if (!is_callable(array($mage, 'getEdition'))) {
         $edition = 'Community';
     } else {
         $edition = Mage::getEdition();
     }
     unset($mage);
     if ($edition == 'Enterprise' && $this->_version == 'CE') {
         return false;
     }
     return true;
 }
开发者ID:dragontheme1235,项目名称:project-1,代码行数:14,代码来源:Data.php


注:本文中的Mage::getEdition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。