Created
February 27, 2019 08:01
-
-
Save ananth-iyer/53ea7d802fa79f41e7578dc9776801e8 to your computer and use it in GitHub Desktop.
Know the Magento edition in codebase like Community or Enterprise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Magento\Framework\App\Bootstrap; | |
require __DIR__ . '/app/bootstrap.php'; | |
$params = $_SERVER; | |
$bootstrap = Bootstrap::create(BP, $params); | |
$obj = $bootstrap->getObjectManager(); | |
$state = $obj->get('Magento\Framework\App\State'); | |
$state->setAreaCode('frontend'); | |
/** @var \Magento\Framework\App\ProductMetadataInterface $productMetadata */ | |
$productMetadata = $obj->get('Magento\Framework\App\ProductMetadataInterface'); | |
$data = []; | |
$data[] = $productMetadata->getName(); //will return the magento name | |
$data[] = $productMetadata->getEdition(); //will return the magento edition - Community or Enterprise | |
$data[] = $productMetadata->getVersion(); //will return the magento version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment