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

Proposal: Enable the defaults.php system for plugins...

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Installation
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Currently Moodle modules (upgrade_activity_modules) have support for reading initial configuration values from a defaults.php file. This enables all those configurations to be set, so we can save a bunch of isset() checks here and there.

      But there isn't any similar system for all the plugins within moodle (upgrade_plugins). Currently a lot of plugins... are performing queries to DB per request, just to know if one configuration setting has been set or no. Perhaps it would be a good idea to use a similar approach than the used for modules.

      I've attached one patch for HEAD. It's really simple (and does nothing in its current form!!).

      The only thing to decide in the patch, in order to have it working is "WHERE" are plugin configuration variables going to be stored. There are two alternatives: the main config table (loaded entirely by request), or the specialised config_plugins one (not loaded by default at all).

      I think we should use the plugins one (after all, we are using plugins) and in the long term it will make the main config one smaller and lighter... but I really don't know how other plugins are using those tables.

      Also... someway related... perhaps it could be a good idea to create one static cache by plugin and name in get_config(), reseting/updating it in set_config() of course.

      Your decission... ciao

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Tester:
            Nobody
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08