首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何查找Magento1.x版本(社区、企业或.go)

如何查找Magento1.x版本(社区、企业或.go)
EN

Stack Overflow用户
提问于 2018-08-01 18:47:11
回答 1查看 418关注 0票数 1

如何找到magento (magento版本1)版本(社区、企业或.GO)

提前感谢!!

EN

回答 1

Stack Overflow用户

发布于 2018-08-02 04:24:07

在Magento 1中,只需打开下一个文件app/Mage.php并检查$_currentEdition variable value:

代码语言:javascript
复制
$ cat YOUR_MAGENTO_ROOT/app/Mage.php | grep _currentEdition

或者干脆深入源代码:

代码语言:javascript
复制
... 

static private $_isInstalled;

/**
 * Magento edition constants
 */
const EDITION_COMMUNITY    = 'Community';
const EDITION_ENTERPRISE   = 'Enterprise';
const EDITION_PROFESSIONAL = 'Professional';
const EDITION_GO           = 'Go';

/**
 * Current Magento edition.
 *
 * @var string
 * @static
 */
static private $_currentEdition = self::EDITION_COMMUNITY;

/**
 * Gets the current Magento version string
 * @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
 *
 * @return string
 */
public static function getVersion()
{
    $i = self::getVersionInfo();
    return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "")
                    . "-{$i['stability']}{$i['number']}", '.-');
}

...

快乐编码;)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51631374

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档