瀏覽代碼

- Moved the iTop version number to the Config class to be able to access it from the setup.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@426 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 年之前
父節點
當前提交
5be6ae833c
共有 3 個文件被更改,包括 27 次插入4 次删除
  1. 0 4
      application/startup.inc.php
  2. 4 0
      core/config.class.inc.php
  3. 23 0
      setup/index.php

+ 0 - 4
application/startup.inc.php

@@ -23,10 +23,6 @@
  * @license     http://www.opensource.org/licenses/gpl-3.0.html LGPL
  */
 
-define('ITOP_VERSION', '0.9');
-define('ITOP_REVISION', '$WCREV$');
-define('ITOP_BUILD_DATE', '$WCNOW$');
-
 require_once('../application/utils.inc.php');
 
 MetaModel::Startup(ITOP_CONFIG_FILE);

+ 4 - 0
core/config.class.inc.php

@@ -14,6 +14,10 @@
 //   along with this program; if not, write to the Free Software
 //   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+define('ITOP_VERSION', '0.9');
+define('ITOP_REVISION', '$WCREV$');
+define('ITOP_BUILD_DATE', '$WCNOW$');
+
 /**
  * Configuration read/write
  *

+ 23 - 0
setup/index.php

@@ -28,6 +28,7 @@ require_once('../core/config.class.inc.php');
 require_once('../core/log.class.inc.php');
 require_once('../core/cmdbsource.class.inc.php');
 require_once('./setuppage.class.inc.php');
+
 define('TMP_CONFIG_FILE', '../tmp-config-itop.php');
 define('FINAL_CONFIG_FILE', '../config-itop.php');
 define('SETUP_STRUCTURE_DATA_DIR', './data/structure');
@@ -41,6 +42,25 @@ $sOperation = Utils::ReadParam('operation', 'step1');
 $oP = new SetupWebPage('iTop configuration wizard');
 
 /**
+ * Get a nicely formatted version string
+ */
+function GetITopVersion()
+{
+	$sVersionString = '';
+	if (ITOP_REVISION == '$WCREV$')
+	{
+		// This is NOT a version built using the buil system, just display the main version
+		$sVersionString = "iTop Version ".ITOP_VERSION;
+	}
+	else
+	{
+		// This is a build made from SVN, let display the full information
+		$sVersionString = "iTop Version ".ITOP_VERSION." revision ".ITOP_REVISION.", built on: ".ITOP_BUILD_DATE;
+	}
+	return $sVersionString;
+}
+
+/**
  * Helper function to retrieve the system's temporary directory
  * Emulates sys_get_temp_dir if neeed (PHP < 5.2.1) 
  * @return string Path to the system's temp directory 
@@ -460,7 +480,10 @@ function PopulateDataFilesList(SetupWebPage $oP)
 function DisplayStep1(SetupWebPage $oP)
 {
 	$sNextOperation = 'step2';
+	$sVersionString = GetITopVersion();
 	$oP->add("<h1>iTop configuration wizard</h1>\n");
+	$oP->p($sVersionString);
+	$oP->log($sVersionString);
 	$oP->add("<h2>Checking prerequisites</h2>\n");
 	if (CheckPHPVersion($oP))
 	{