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

rfc: coding convention change: keep functions in libraries

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.1
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jun/07