Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the 'edition' parameter to getVersion() and getVersionInfo() #112

Closed
wants to merge 1 commit into from
Closed

Conversation

peterjaap
Copy link
Contributor

Add the 'edition' parameter to getVersion() and getVersionInfo() to make it easier for developers to distinguish between Community and Enterprise editions.

Right now we have to do something like this;

$enterprise = Mage::getConfig()->getNode('modules/Enterprise_PageCache/active');
$checkForVersion = ($enterprise ? '1.12' : '1.7.0.0');
if(version_compare(Mage::getVersion(), $checkForVersion, '<')) {
    // do stuff for CE < 1.7.0.0 & EE < 1.12
} else {
    // do stuff for CE > 1.7.0.0 & EE > 1.12
}

Which is not 100% safe since the PageCache extension can be deactivated in an EE installation.

… make it easier for developers to distinguish between Community and Enterprise editions
@magento-team
Copy link
Contributor

Hello. Can you provide a clear use case for getting this information? From what we saw it promotes bad code practices. What would you do in a different way for CE and EE?

@peterjaap
Copy link
Contributor Author

What do you mean by 'bad code practices'? We build & maintain numerous
Magento extensions and sometimes I need to be able to differentiate between
EE and CE, specifically for checking the version. Over time, the templates
change and if I want to rewrite a template by choosing a different template
file through a custom block, I need to be able to accurately differentiate
between versions.

If I use getVersion() now, I get '1.7.0.0', which can both be EE 1.7 (old
version) and CE 1.7 (current version); some template files will differ.

Peter Jaap Blaakmeer
Blaakmeer Webdevelopment
[@] [email protected]
[W] www.blaakmeer.com
[T] +31 (0)50 7001 320

On Thu, Nov 1, 2012 at 5:35 PM, mage2-team [email protected] wrote:

Hello. Can you provide a clear use case for getting this information? From
what we saw it promotes bad code practices. What would you do in a
different way for CE and EE?


Reply to this email directly or view it on GitHubhttps://github.com//pull/112#issuecomment-9986547.

@amenk
Copy link
Contributor

amenk commented Nov 5, 2012

One nice solution for this would be to equalize the versioning schema for EE and CE. So Magento EE 2.0 and Magento CE 2.0 should use the same code base.

@magento-team
Copy link
Contributor

Hello. We will have a getEdition method implemented/refactored. As for the equalization of versioning - this is a good idea but it is still too early for us to take final decision. Thanks for the tip.

vpelipenko added a commit to vpelipenko/magento2 that referenced this pull request Mar 5, 2015
MomotenkoNatalia pushed a commit that referenced this pull request Nov 4, 2015
[WebDev+MPI+FearlessKiwis] Bugfixes
@peterjaap
Copy link
Contributor Author

For future reference, almost 2 years later (already 3 years ago), it was added in Magento\Framework\App\ProductMetadata; see here.

magento-engcom-team pushed a commit that referenced this pull request Apr 13, 2018
MAGETWO-89914: Magento\Quote\Api\CartItemRepositoryTest::testGetList …
magento-engcom-team added a commit that referenced this pull request Jul 18, 2018
…id on import product category initialization to 0 #112

 - Merge Pull Request magento-engcom/import-export-improvements#112 from pogster/import-export-improvements:product-category-import-storeid-fix
 - Merged commits:
   1. b49d2ff
   2. 2e04d50
magento-engcom-team pushed a commit that referenced this pull request Jul 18, 2018
…id on import product category initialization to 0 #112
magento-engcom-team added a commit that referenced this pull request Jul 20, 2018
 - Merge Pull Request magento/graphql-ce#112 from magento/graphql-ce:19-add-breadcrumbs-support
 - Merged commits:
   1. 34ed6d1
   2. 78a67c3
   3. 3d973af
   4. cfd7502
magento-engcom-team pushed a commit to okorshenko/magento2 that referenced this pull request May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants