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

Move lib/externallib.php to namespaced classes and fix coding style, etc.

    XMLWordPrintable

Details

    Description

      This is one that has bothered me for quite some time.

      This proposal is to:

      • break apart lib/externallib.php into separate classes
      • sort out the tests; and
      • add a b/c layer.

      I would suggesst that we simply do class aliases and function wrappers for now, then in 4.6 (4.2 + 4) we formally deprecate these using the renamedclasses.php approach. This will allow contrib developers to only support one non-errored codebase.

      The benefits of this include:

      • we start to make the External API a bit more manageable
      • we make classes autoloadable
      • we can stop manually requiring lib/externallib.php everywhere
      • we remove some of the existing technical debt
      • we can start to improve type hinting for some of these functions

      The changes proposed here look huge, but they are not as bad as they seem. Most of the lines of changes are updating all uses of the various API functions to point to the new APIs and removing a manual require_once call which is no longer necessary.

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              dobedobedoh Andrew Lyons
              Safat Shahin Safat Shahin
              Jun Pataleta Jun Pataleta
              CiBoT CiBoT
              Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24/Apr/23

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 6 minutes
                  3d 6m