summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery.php
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2011-04-22 16:54:55 +0000
committerNathan Kinkade <nath@nkinka.de>2011-04-22 16:54:55 +0000
commit1f7c1f18c651c58048e92d615c71ac0fe6691c10 (patch)
tree4527c4bc08000a07c180cd1fe81792d71195d58b /modules/gallery/helpers/gallery.php
parentde6f3fce9110b777d61dec97f2a3a61d887a5ccd (diff)
parent55da59c942c0f7171b515f0718fea8506ed4b116 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/gallery.php')
-rw-r--r--modules/gallery/helpers/gallery.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php
index 1fafdef7..cbd9b33c 100644
--- a/modules/gallery/helpers/gallery.php
+++ b/modules/gallery/helpers/gallery.php
@@ -193,19 +193,25 @@ class gallery_Core {
*/
static function version_string() {
if (gallery::RELEASE_CHANNEL == "git") {
+ $build_number = gallery::build_number();
return sprintf(
- "%s (branch %s build %s)", gallery::VERSION, gallery::RELEASE_BRANCH,
- gallery::build_number());
+ "%s (branch %s, %s)", gallery::VERSION, gallery::RELEASE_BRANCH,
+ $build_number ? " build $build_number" : "unknown 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.
+ * Return the contents of the .build_number file, which should be a single integer
+ * or return null if the .build_number file is missing.
*/
static function build_number() {
- $result = parse_ini_file(DOCROOT . ".build_number");
- return $result["build_number"];
+ $build_file = DOCROOT . ".build_number";
+ if (file_exists($build_file)) {
+ $result = parse_ini_file(DOCROOT . ".build_number");
+ return $result["build_number"];
+ }
+ return null;
}
} \ No newline at end of file