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

Restructure lib.php

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.3
    • 2.4.1
    • Module: Questionnaire
    • MOODLE_24_STABLE
    • MOODLE_24_STABLE

    Description

      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.

      Attachments

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

        Activity

          People

            jenny-gray Jenny Gray
            jenny-gray Jenny Gray
            Mike Churchward
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              14/Jan/13