Merge branch 'MDL-28134_branch' of git://github.com/nebgor/moodle

This commit is contained in:
Dan Poltawski 2012-05-10 13:44:03 +08:00
commit 3388649065
5 changed files with 16 additions and 11 deletions

View File

@ -82,7 +82,7 @@ if (empty($CFG->version)) {
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) {
@ -150,6 +150,7 @@ if ($version > $CFG->version) {
upgrade_core($version, true);
}
set_config('release', $release);
set_config('branch', $branch);
// unconditionally upgrade
upgrade_noncore(true);

View File

@ -98,7 +98,8 @@ if (!isset($CFG->version)) {
$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) {
@ -260,6 +261,10 @@ if ($release <> $CFG->release) { // Update the release version
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

View File

@ -450,6 +450,7 @@ function install_cli_database(array $options, $interactive) {
// install core
install_core($version, true);
set_config('release', $release);
set_config('branch', $branch);
// install all plugins types, local, etc.
upgrade_noncore(true);

View File

@ -566,19 +566,16 @@ function get_exception_info($ex) {
*/
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

View File

@ -36,4 +36,5 @@ $version = 2012050400.02; // YYYYMMDD = weekly release date o
$release = '2.3dev (Build: 20120504)'; // Human-friendly version name
$branch = '23'; // this version's branch
$maturity = MATURITY_ALPHA; // this version's maturity level