Skip to content

Commit

Permalink
MDL-67250 setup: Revert removal of the httpswwwroot setting
Browse files Browse the repository at this point in the history
It is still used widely in the plugins that would stop working suddenly
without being warned via a debugging message. We must keep it forever as
an alias for the wwwroot.
  • Loading branch information
mudrd8mz committed Nov 13, 2019
1 parent 1633a60 commit 469d4b7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions admin/cli/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
$CFG->dirroot = dirname(dirname(__DIR__));
$CFG->libdir = "$CFG->dirroot/lib";
$CFG->wwwroot = "http://localhost";
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->docroot = 'http://docs.moodle.org';
$CFG->running_installer = true;
$CFG->early_install_lang = true;
Expand Down Expand Up @@ -388,6 +389,7 @@
}
}
$CFG->wwwroot = $wwwroot;
$CFG->httpswwwroot = $CFG->wwwroot;

//We need dataroot before lang download
$CFG->dataroot = $options['dataroot'];
Expand Down
1 change: 1 addition & 0 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
$CFG->dirroot = __DIR__;
$CFG->libdir = "$CFG->dirroot/lib";
$CFG->wwwroot = install_guess_wwwroot(); // can not be changed - ppl must use the real address when installing
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->dataroot = $config->dataroot;
$CFG->tempdir = $CFG->dataroot.'/temp';
$CFG->backuptempdir = $CFG->tempdir.'/backup';
Expand Down
4 changes: 4 additions & 0 deletions lib/phpunit/tests/basic_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ protected function setUp() {
*/
public function test_bootstrap() {
global $CFG;

// The httpswwwroot has been deprecated, we keep it as an alias for backwards compatibility with plugins only.
$this->assertTrue(isset($CFG->httpswwwroot));
$this->assertEquals($CFG->httpswwwroot, $CFG->wwwroot);
$this->assertEquals($CFG->prefix, $CFG->phpunit_prefix);
}

Expand Down
3 changes: 3 additions & 0 deletions lib/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,9 @@
*/
global $SCRIPT;

// The httpswwwroot has been deprecated, we keep it as an alias for backwards compatibility with plugins only.
$CFG->httpswwwroot = $CFG->wwwroot;

require_once($CFG->libdir .'/setuplib.php'); // Functions that MUST be loaded first

if (NO_OUTPUT_BUFFERING) {
Expand Down
2 changes: 0 additions & 2 deletions lib/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ information provided here is intended especially for developers.
independently of local files (MDL-66304).
* The methods get_local_path_from_storedfile and get_remote_path_from_storedfile in lib/filestore/file_system.php
are now public. If you are overriding these then you will need to change your methods to public in your class.
* $CFG->httpswwwroot has been removed. It is no longer necessary as loginhttps has already been removed and it's no longer being
used anywhere in core.
* It is now possible to use sub-directories for AMD modules.
The standard rules for Level 2 namespaces also apply to AMD modules.
The sub-directory used must be either an valid component, or placed inside a 'local' directory to ensure that it does not conflict with other components.
Expand Down

0 comments on commit 469d4b7

Please sign in to comment.