From 8d5be1cd6feb3e375d44a4de3c782fcdb65c340a Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Thu, 15 Jun 2006 23:00:44 +0000 Subject: [PATCH] Implement getSystemIdentifier, a unique, information-free, identifier for the system. --- lib/util/ktutil.inc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/util/ktutil.inc b/lib/util/ktutil.inc index df8982a..525acaa 100644 --- a/lib/util/ktutil.inc +++ b/lib/util/ktutil.inc @@ -640,9 +640,27 @@ class KTUtil { } } + function getSystemIdentifier() { + $sIdentifier = KTUtil::getSystemSetting('kt_system_identifier'); + if (empty($sIdentifier)) { + $sIdentifier = md5(uniqid(mt_rand(), true)); + KTUtil::setSystemSetting('kt_system_identifier', $sIdentifier); + } + return $sIdentifier; + } + function getKTVersions() { - return array('OSS' => '3.0.3', - 'Pro' => '1.0.0'); + $aVersions = array(); + $sProfessionalFile = KT_DIR . '/docs/VERSION-PRO.txt'; + $sOssFile = KT_DIR . '/docs/VERSION-OSS.txt'; + if (file_exists($sProfessionalFile)) { + $sVersion = trim(file_get_contents($sProfessionalFile)); + $aVersions['Pro'] = $sVersion; + } else { + $sVersion = trim(file_get_contents($sOssFile)); + $aVersions['OSS'] = $sVersion; + } + return $aVersions; } } -- libgit2 0.21.4