From c5cc2821311012a8a4385a304a043c4b41f2afbb Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 31 Aug 2009 19:05:21 +0000 Subject: All line endings are now Unix-style. git-svn-id: https://code.elgg.org/elgg/trunk@3451 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/version.php | 116 ++++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'engine/lib/version.php') diff --git a/engine/lib/version.php b/engine/lib/version.php index 47bb36972..2476a0b75 100644 --- a/engine/lib/version.php +++ b/engine/lib/version.php @@ -1,14 +1,14 @@ -path . "version.php")) { - if (!$humanreadable) return $version; - return $release; - } - - return false; - - } - - /** - * Determines whether or not the database needs to be upgraded. - * - * @return true|false Depending on whether or not the db version matches the code version - */ - function version_upgrade_check() { - - $dbversion = (int) datalist_get('version'); - $version = get_version(); - - if ($version > $dbversion) { - return true; - } - return false; - - } - - /** - * Upgrades Elgg - * - */ - function version_upgrade() { - - $dbversion = (int) datalist_get('version'); + } + + /** + * Get the current version information + * + * @param true|false $humanreadable Whether to return a human readable version (default: false) + * @return string|false Depending on success + */ + function get_version($humanreadable = false) { + + global $CONFIG; + if (@include($CONFIG->path . "version.php")) { + if (!$humanreadable) return $version; + return $release; + } + + return false; + + } + + /** + * Determines whether or not the database needs to be upgraded. + * + * @return true|false Depending on whether or not the db version matches the code version + */ + function version_upgrade_check() { + + $dbversion = (int) datalist_get('version'); + $version = get_version(); + + if ($version > $dbversion) { + return true; + } + return false; + + } + + /** + * Upgrades Elgg + * + */ + function version_upgrade() { + + $dbversion = (int) datalist_get('version'); // Upgrade database - db_upgrade($dbversion); + db_upgrade($dbversion); system_message(elgg_echo('upgrade:db')); // Upgrade core @@ -121,8 +121,8 @@ trigger_elgg_event('upgrade', 'upgrade', $upgrade_details); // Update the version - datalist_set('version', get_version()); - - } - + datalist_set('version', get_version()); + + } + ?> \ No newline at end of file -- cgit v1.2.3