summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes2
-rw-r--r--BUILD_NUMBER1
-rw-r--r--modules/gallery/helpers/gallery.php25
-rw-r--r--modules/gallery/helpers/gallery_theme.php2
-rw-r--r--modules/gallery/views/admin_block_stats.html.php2
5 files changed, 29 insertions, 3 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..9122eeb1
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+BUILD_NUMBER merge=merge-keep-ours
+
diff --git a/BUILD_NUMBER b/BUILD_NUMBER
new file mode 100644
index 00000000..e373ee69
--- /dev/null
+++ b/BUILD_NUMBER
@@ -0,0 +1 @@
+50
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",
diff --git a/modules/gallery/views/admin_block_stats.html.php b/modules/gallery/views/admin_block_stats.html.php
index 1dec8ccd..c8c54765 100644
--- a/modules/gallery/views/admin_block_stats.html.php
+++ b/modules/gallery/views/admin_block_stats.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul>
<li>
- <?= t("Version: %version", array("version" => gallery::VERSION)) ?>
+ <?= t("Version: %version", array("version" => gallery::version_string())) ?>
</li>
<li>
<?= t("Albums: %count", array("count" => $album_count)) ?>