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

Add check to \core_component for some key autoloadable classes

XMLWordPrintable

      Following from MDL-81919 and MDL-80275 I feel that it would be prudent to validate that certain critical classes are in the cache before accepting it.

      There is already a mechanism in place for this, but it does not check the presence of classes.

      This is particularly important as we move classes from monolith files into autoloaded classes and stop automatically loading them all. At the moment (in MDL-81919) we are adding things like this:

      // TODO MDL-81933 Remove after Moodle 4.5 release.
      require_once($CFG->libdir . '/classes/exception/moodle_exception.php');       // Required by some other legacy libraries.
      require_once($CFG->libdir . '/classes/output/bootstrap_renderer.php');        // Required by some other legacy libraries.
      

      The same is also true for some hooks in Moodle 4.4.

      I wonder whether a better approach would be to check for some (not all or many) of these classes in the cache during the loading. I would suggest that we keep a small array of these classes which we update when we encounter a new critical path (that is something that is required during every page load and which prevents access to the UI upgrade infrastructure).

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Paul Holden Paul Holden
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 12 minutes
                4h 12m

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