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

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

XMLWordPrintable

      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.

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Safat Shahin Safat Shahin
            Jun Pataleta Jun Pataleta
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.