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

Restructure lib.php

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.3
    • Fix Version/s: 2.4.1
    • Component/s: Module: Questionnaire
    • Labels:
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      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

            Assignee:
            jenny-gray Jenny Gray
            Reporter:
            jenny-gray Jenny Gray
            Participants:
            Component watchers:
            Mike Churchward
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Jan/13