Split version into separate file
Split version into separate file

--- /dev/null
+++ b/include/version.php
@@ -1,1 +1,28 @@
+<?php
+/*
+ *  version.php
+ *  gitphp: A PHP git repository browser
+ *  Component: Version
+ *
+ *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
 
+ $gitphp_version = "v01d";
+ $gitphp_appstring = "gitphp $gitphp_version";
+
+?>
+

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -1,7 +1,5 @@
 <?php
  ob_start();
- $version = "v01d";
- $gitphp_appstring = "gitphp $version";
 /*
  *  index.php
  *  gitphp: A PHP git repository browser
@@ -23,6 +21,11 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
+
+ /*
+  * Version
+  */
+ include_once('include/version.php');
 
  /*
   * Configuration
@@ -128,7 +131,7 @@
  if (!$suppress_headers) {
 	 $tpl->clear_all_assign();
 	 $tpl->assign("stylesheet",$gitphp_conf['stylesheet']);
-	 $tpl->assign("version",$version);
+	 $tpl->assign("version",$gitphp_version);
 	 $title = $gitphp_conf['title'];
 	 if ($rss_link) {
 		$tpl->assign("rss_link",TRUE);

comments