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

moodle_url has no way to set the url scheme

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: 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

            Assignee:
            brendanheywood Brendan Heywood
            Reporter:
            brendanheywood Brendan Heywood
            Peer reviewer:
            Jun Pataleta
            Integrator:
            Dan Poltawski
            Tester:
            CiBoT
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              23/May/16