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

rfc: coding convention change: keep functions in libraries

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 1.8.1
    • 1.8
    • General
    • None
    • MOODLE_18_STABLE
    • MOODLE_18_STABLE

    Description

      There seems to have been an increased move for functions to support scripts to end up at the bottom of those scripts rather than in libraries, which is fine except at the moment that you want to reuse them some place else.

      The latest example of this (which is what has just bitten me) is mod/data/preset.php - I want to programmatically

      • create an instance of a database module
      • import a preset
      • do stuff (migrate entries from a glossary)

      at moodle upgrade time

      and all the code to deal with importing the preset (including a class!) is in preset.php which obviously I can't just include because it's not a library.

      I know it's relatively trivial for me to just move stuff (although I want this in 1.8, not head), but I wonder if it's worth getting some feedback about this from the wider dev community about coding conventions.

      Attachments

        Activity

          People

            mjollnir Penny Leach
            mjollnir Penny Leach
            Nobody Nobody
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Clockify

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