diff --git a/application/startup.inc.php b/application/startup.inc.php index 0ccf697e9..5a416ea94 100644 --- a/application/startup.inc.php +++ b/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); diff --git a/core/config.class.inc.php b/core/config.class.inc.php index bf9b6934d..ce23676d9 100644 --- a/core/config.class.inc.php +++ b/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 * diff --git a/setup/index.php b/setup/index.php index 5924f1957..aa8a503a8 100644 --- a/setup/index.php +++ b/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'); @@ -40,6 +41,25 @@ define('MIN_MEMORY_LIMIT', 32*1024*1024); $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) @@ -460,7 +480,10 @@ function PopulateDataFilesList(SetupWebPage $oP) function DisplayStep1(SetupWebPage $oP) { $sNextOperation = 'step2'; + $sVersionString = GetITopVersion(); $oP->add("