summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery.php25
-rw-r--r--modules/gallery/helpers/gallery_theme.php2
2 files changed, 25 insertions, 2 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
diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php
index ebf8f38e..d75c6fc6 100644
--- a/modules/gallery/helpers/gallery_theme.php
+++ b/modules/gallery/helpers/gallery_theme.php
@@ -115,7 +115,7 @@ class gallery_theme_Core {
static function credits() {
$version_string = SafeString::of_safe_html(
- '<bdo dir="ltr">Gallery ' . gallery::VERSION . '</bdo>');
+ '<bdo dir="ltr">Gallery ' . gallery::version_string() . '</bdo>');
return "<li class=\"g-first\">" .
t(module::get_var("gallery", "credits"),
array("url" => "http://gallery.menalto.com",