Skip to content
Browse files

added compatibility mode

  • Loading branch information...
1 parent c755929 commit 1d8136b9ec6e1fd528df72dce3cc6c61c2893189 @leesbian leesbian committed Nov 18, 2012
Showing with 53 additions and 17 deletions.
  1. +5 −0 RELEASE_NOTES.txt
  2. +31 −11 app/Mage.php
  3. +17 −6 app/etc/local.xml.template
View
5 RELEASE_NOTES.txt
@@ -1,4 +1,9 @@
==== Mage+ 1.0.0.8 ===
+
+=== Changes ===
+Added compatibility mode to Mage::getVersionInfo to allow for returning Magento version Mage+ is based on - Lee Bolding [leesbian]
+
+=== Fixes ===
Fixed issue where object was set as category ID - Simon Sprankel [sprankhub]
Fixed issue where customer view's shopping cart container is always empty - Roland Schilter [rndstr]
Fixed issue with PHP 5.4 compatibility - Lars Strojny [lstrojny]
View
42 app/Mage.php
@@ -154,27 +154,47 @@
*/
public static function getVersion()
{
- $i = self::getVersionInfo();
+ $i = self::getVersionInfo(TRUE);
@lstrojny
lstrojny added a note Nov 19, 2012

Shouldn’t this be lowercase?

@tux-rampage
tux-rampage added a note Dec 7, 2012

Agree, this should be lower case to meet coding standards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "")
. "-{$i['stability']}{$i['number']}", '.-');
}
/**
* Gets the detailed Magento version information
+ * Returns the detailed Magento version information specified in configuration if
+ * compatibility mode has been enabled
* @link http://www.magentocommerce.com/blog/new-community-edition-release-process/
*
+ * @static
+ * @param bool $compatibiltiy
* @return array
*/
- public static function getVersionInfo()
- {
- return array(
- 'major' => '1',
- 'minor' => '0',
- 'revision' => '0',
- 'patch' => '8',
- 'stability' => '',
- 'number' => '',
- );
+ public static function getVersionInfo($compatibility = false)
+ {
+ $enabled = (string) Mage::getConfig()->getNode('global/compatibility')->enable;
+
+ if ((!empty($enabled) && 'false' !== $enabled ) || $compatibility)
+ {
+ $info = array(
+ 'major' => Mage::getConfig()->getNode('global/compatibility/version/major'),
+ 'minor' => Mage::getConfig()->getNode('global/compatibility/version/minor'),
+ 'revision' => Mage::getConfig()->getNode('global/compatibility/version/revision'),
+ 'patch' => Mage::getConfig()->getNode('global/compatibility/version/patch'),
+ 'stability' => Mage::getConfig()->getNode('global/compatibility/version/stability'),
+ 'number' => Mage::getConfig()->getNode('global/compatibility/version/number'),
+ );
+ } else {
+ $info = array(
+ 'major' => '1',
+ 'minor' => '1',
+ 'revision' => '0',
+ 'patch' => '0',
+ 'stability' => '',
+ 'number' => '',
+ );
+ }
+
+ return $info;
}
/**
View
23 app/etc/local.xml.template
@@ -27,12 +27,23 @@
-->
<config>
<global>
- <environment>
- <name>production</name>
- <banner_color>#FF0000</banner_color>
- <show_banner_in_frontend>0</show_banner_in_frontend>
- <show_banner_in_backend>1</show_banner_in_backend>
- </environment>
+ <environment>
+ <name>production</name>
+ <banner_color>#FF0000</banner_color>
+ <show_banner_in_frontend>0</show_banner_in_frontend>
+ <show_banner_in_backend>1</show_banner_in_backend>
+ </environment>
+ <compatibility>
+ <enable>false</enable>
+ <version>
+ <major>1</major>
+ <minor>7</minor>
+ <revision>0</revision>
+ <patch>0</patch>
+ <stability>COMPATIBILITY</stability>
+ <number></number>
+ </version>
+ </compatibility>
<install>
<date>{{date}}</date>
</install>

0 comments on commit 1d8136b

Please sign in to comment.
Something went wrong with that request. Please try again.