Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-4304

Restructure lib.php

XMLWordPrintable

    • MOODLE_24_STABLE
    • MOODLE_24_STABLE

      Recent investigations into poor performance of our moodle 2.4 candidate release have uncovered a number of concerns including the use of lib.php.

      lib.php is included from many locations through the code, so the file needs to be as small as possible, no include other files, and only hold functions which are truly needed outside the scope of the plug-in.

      Where require_once is necessary in lib.php, it should be within a specific function rather than at the top of the file (different to normal coding guidelines about require_once).

      I've looked at questionnaire/lib.php which appears to have a number of functions which may be internal only, and it also includes its own locallib.php and eventlib.php at the top of the file.

      This issue is to restructure lib.php and locallib.php where necessary in order to meet the current best practice and hopefully have a small impact on overall Moodle performance.

        1. questionnaire.zip
          415 kB
        2. tmp.patch
          297 kB

            jenny-gray Jenny Gray (Inactive)
            jenny-gray Jenny Gray (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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