While urgently patching dozens of Magento Commerce installations for the latest security alert, I needed a quick way to determine the version without logging into the admin.
I found the answer in a note on the bottom of this wiki page:
http://www.magentocommerce.com/wiki/groups/227/check_magento_version
Just open app/Mage.php and look for the getVersionInfo() function. You’ll see something like this:
1 2 3 4 5 6 7 8 9 10 11 |
public static function getVersionInfo() { return array( 'major' => '1', 'minor' => '7', 'revision' => '0', 'patch' => '0', 'stability' => '', 'number' => '', ); } |
Here’s a Perl one liner to extract the version:
1 |
perl -ne 'print if /function\ getVersionInfo/../\}/' app/Mage.php |
Thanks to Peteris Krumins for a great blog full of Perl one-liners. The one above
was derived from this article:
http://www.catonmat.net/blog/perl-one-liners-explained-part-six/
BTW … here’s the security alert:
http://www.magentocommerce.com/blog/comments/important-security-update-zend-platform-vulnerability/
If you’ve not already patched then you should really get it done right away or contact Reliable Penguin for assistance.