-
Type:
Improvement
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.1
-
Fix Version/s: 3.1
-
Component/s: General
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_31_STABLE
-
Fixed Branches:MOODLE_31_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-51718-set-scheme -
Pull Master Diff URL:
The scheme can be set in the constructor but not changed afterwards. Seems like simply an omission in the moodle_url api as it is an edge case, but it is still quite valid and means you don't have to construct a url, encode it, and then re-parse it and replace the scheme afterwards.
require_once('config.php');
$url = new moodle_url('/local/blah/someapi');
$url->set_scheme('myscheme');
echo $url; --> "myscheme://moodle.example.com/local/blah/someapi"