summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers/gallery.php')
-rw-r--r--modules/gallery/helpers/gallery.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php
index 282289b5..c4a6286c 100644
--- a/modules/gallery/helpers/gallery.php
+++ b/modules/gallery/helpers/gallery.php
@@ -18,7 +18,10 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class gallery_Core {
- const VERSION = "3.0+ (git)";
+ const VERSION = "3.0+";
+ const CODE_NAME = "";
+ const RELEASE_CHANNEL = "git";
+ const RELEASE_BRANCH = "master";
/**
* If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is
@@ -184,4 +187,24 @@ class gallery_Core {
}
putenv("PATH=" . implode(":", $path_env));
}
+
+ /**
+ * Return a string describing this version of Gallery and the type of release.
+ */
+ static function version_string() {
+ if (gallery::RELEASE_CHANNEL == "git") {
+ return sprintf(
+ "%s (branch %s build %s)", gallery::VERSION, gallery::RELEASE_BRANCH, gallery::build_number());
+ } else {
+ return sprintf("%s (%s)", gallery::VERSION, gallery::CODE_NAME);
+ }
+ }
+
+ /**
+ * Return the contents of the BUILD_NUMBER file, which should be a single integer.
+ */
+ static function build_number() {
+ $lines = file(DOCROOT . "BUILD_NUMBER", FILE_IGNORE_NEW_LINES);
+ return $lines[0];
+ }
} \ No newline at end of file