diff options
Diffstat (limited to 'modules/gallery')
| -rw-r--r-- | modules/gallery/helpers/gallery.php | 25 | ||||
| -rw-r--r-- | modules/gallery/helpers/gallery_theme.php | 2 | ||||
| -rw-r--r-- | modules/gallery/views/admin_block_stats.html.php | 2 | 
3 files changed, 26 insertions, 3 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", 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)) ?> | 
