blob: ee707ca1d10ec160f4e61dafb1057772cc1e1354 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
<?php
/**
* Elgg version library.
* Contains code for handling versioning and upgrades.
*
* @package Elgg
* @subpackage Core
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @copyright Curverider Ltd 2008
* @link http://elgg.org/
*/
/**
* 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 db_upgrade_check() {
$dbversion = (int) get_datalist('version');
$version = get_version();
if ($version > $dbversion) {
return true;
}
return false;
}
?>
|