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

Encourage the use of get_config/set_config instead of $CFG where ever possible

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.4.4, 2.5
    • Administration, Libraries
    • MOODLE_24_STABLE, MOODLE_25_STABLE

      We've developed a plugin which allows non-administrators to change admin-level settings at the category level. https://moodle.org/plugins/view.php?id=677

      Currently one of the limitations which prevents a relatively clean implementation of this functionality is the use of $CFG in a number of plugins.

      Our method involves modifying get_config/set_config methods allowing them to check a 'category settings' table based off of the config/config_plugins tables.

      In order to make this work we've had to modify the core plugins anywhere $CFG-> is used and change to the get_config version.

      We'd like to get this started as a discussion as there may be issues with doing this we haven't discovered yet. For instance get_config does cause a lookup instead of a memory access which of course could mean performance degradation.
      We have already gone through and modified all the core modules and can provide the changes if this is accepted.

            Unassigned Unassigned
            tdjones Trevor Jones
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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