Skip to content

Commit

Permalink
MDL-69475 install: Version, env. and minimal changes before branching
Browse files Browse the repository at this point in the history
Note this doesn't aim to be a complete change-set, but just the
minimum to switch to 3-digit $branches and keep installation, checks
and tests running and passing.
  • Loading branch information
stronk7 committed Aug 16, 2020
1 parent a0fc902 commit 35c36d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions lib/environmentlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ function get_latest_version_available($version, $env_select) {
return false;
}
/// First we look for exact version
if (in_array($version, $versions)) {
if (in_array($version, $versions, true)) {
return $version;
} else {
$found_version = false;
Expand Down Expand Up @@ -416,7 +416,7 @@ function get_environment_for_version($version, $env_select) {
}

/// If the version requested is available
if (!in_array($version, $versions)) {
if (!in_array($version, $versions, true)) {
return false;
}

Expand Down Expand Up @@ -808,8 +808,15 @@ function environment_check_moodle($version, $env_select) {
$release = get_config('', 'release');
$current_version = normalize_version($release);
if (strpos($release, 'dev') !== false) {
// when final version is required, dev is NOT enough!
$current_version = $current_version - 0.1;
// When final version is required, dev is NOT enough so, at all effects
// it's like we are running the previous version.
$versionarr = explode('.', $current_version);
if (isset($versionarr[1]) and $versionarr[1] > 0) {
$versionarr[1]--;
$current_version = implode('.', $versionarr);
} else {
$current_version = $current_version - 0.1;
}
}

/// And finally compare them, saving results
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/setuplib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function test_get_docs_url_standard() {
} else {
$docroot = $CFG->docroot;
}
$this->assertRegExp('~^' . preg_quote($docroot, '') . '/\d{2}/' . current_language() . '/course/editing$~',
$this->assertRegExp('~^' . preg_quote($docroot, '') . '/\d{2,3}/' . current_language() . '/course/editing$~',
get_docs_url('course/editing'));
}

Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.0dev (Build: 20200814)'; // Human-friendly version name
$branch = '40'; // This version's branch.
$branch = '400'; // This version's branch.
$maturity = MATURITY_ALPHA; // This version's maturity level.

0 comments on commit 35c36d3

Please sign in to comment.