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:
Just open app/Mage.php and look for the getVersionInfo() function. You’ll see something like this:
public static function getVersionInfo()
'major' => '1',
'minor' => '7',
'revision' => '0',
'patch' => '0',
'stability' => '',
'number' => '',
Here’s a Perl one liner to extract the version:
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:
BTW … here’s the security alert:
If you’ve not already patched then you should really get it done right away or contact Reliable Penguin for assistance.