BUGFIX Fallback to sapphire/silverstripe_version if there is no CMS (framework only)

This commit is contained in:
Simon Welsh 2012-02-23 20:46:34 +13:00
parent 8790ba3c4f
commit df82dac334

View File

@ -1216,7 +1216,11 @@ class LeftAndMain extends Controller {
* @return string
*/
public function CMSVersion() {
$sapphireVersion = file_get_contents(BASE_PATH . '/cms/silverstripe_version');
if(file_exists(CMS_PATH . '/silverstripe_version')) {
$sapphireVersion = file_get_contents(CMS_PATH . '/silverstripe_version');
} else {
$sapphireVersion = file_get_contents(SAPPHIRE_PATH . '/silverstripe_version');
}
if(!$sapphireVersion) $sapphireVersion = _t('LeftAndMain.VersionUnknown', 'unknown');
return sprintf(
"sapphire: %s",