Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51718

moodle_url has no way to set the url scheme

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 3.1
    • General

    Description

      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"

      Attachments

        Activity

          People

            brendanheywood Brendan Heywood
            brendanheywood Brendan Heywood
            Jun Pataleta Jun Pataleta
            Dan Poltawski Dan Poltawski
            CiBoT CiBoT
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              23/May/16