cli_error(get_string('missingconfigversion', 'debug'));
}
-require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
+require("$CFG->dirroot/version.php"); // defines $version, $release, $branch and $maturity
$CFG->target_release = $release; // used during installation and upgrades
if ($version < $CFG->version) {
upgrade_core($version, true);
}
set_config('release', $release);
+set_config('branch', $branch);
// unconditionally upgrade
upgrade_noncore(true);
$version = null;
$release = null;
-require("$CFG->dirroot/version.php"); // defines $version, $release and $maturity
+$branch = null;
+require("$CFG->dirroot/version.php"); // defines $version, $release, $branch and $maturity
$CFG->target_release = $release; // used during installation and upgrades
if (!$version or !$release) {
set_config('release', $release);
}
+if ($branch <> $CFG->branch) { // Update the branch
+ set_config('branch', $branch);
+}
+
if (moodle_needs_upgrading()) {
if (!$PAGE->headerprinted) {
// means core upgrade or installation was not already done
// install core
install_core($version, true);
set_config('release', $release);
+ set_config('branch', $branch);
// install all plugins types, local, etc.
upgrade_noncore(true);
*/
function get_docs_url($path=null) {
global $CFG;
- // Check that $CFG->release has been set up, during installation it won't be.
- if (empty($CFG->release)) {
+ // Check that $CFG->branch has been set up, during installation it won't be.
+ if (empty($CFG->branch)) {
// It's not there yet so look at version.php
include($CFG->dirroot.'/version.php');
} else {
- // We can use $CFG->release and avoid having to include version.php
- $release = $CFG->release;
+ // We can use $CFG->branch and avoid having to include version.php
+ $branch = $CFG->branch;
}
- // Attempt to match the branch from the release
- if (preg_match('/^(.)\.(.)/', $release, $matches)) {
- // We should ALWAYS get here
- $branch = $matches[1].$matches[2];
- } else {
+ // ensure branch is valid.
+ if (!$branch) {
// We should never get here but in case we do lets set $branch to .
// the smart one's will know that this is the current directory
// and the smarter ones will know that there is some smart matching
$release = '2.3dev (Build: 20120427)'; // Human-friendly version name
+$branch = '23'; // this version's branch
$maturity = MATURITY_ALPHA; // this version's maturity level