Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Override CMSMain->CMSVersion() to check for cms/silverstripe_ve…

…rsion
  • Loading branch information...
commit 8e6a38559ebd258d564876eaa66521c525da8099 1 parent 593754b
@chillu chillu authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 code/CMSMain.php
View
17 code/CMSMain.php
@@ -1545,6 +1545,23 @@ function duplicatewithchildren($request) {
user_error("CMSMain::duplicate() Bad ID: '$id'", E_USER_WARNING);
}
}
+
+ /**
+ * Return the version number of this application.
+ * Uses the subversion path information in <mymodule>/silverstripe_version
+ * (automacially replaced $URL$ placeholder).
+ *
+ * @return string
+ */
+ public function CMSVersion() {
+ $sapphireVersionFile = file_get_contents(BASE_PATH . '/sapphire/silverstripe_version');
+ $cmsVersionFile = file_get_contents(BASE_PATH . '/cms/silverstripe_version');
+
+ $sapphireVersion = $this->versionFromVersionFile($sapphireVersionFile);
+ $cmsVersion = $this->versionFromVersionFile($cmsVersionFile);
+
+ return "cms: $cmsVersion, sapphire: $sapphireVersion";
+ }
/**
* Provide the permission codes used by LeftAndMain.
Please sign in to comment.
Something went wrong with that request. Please try again.