Difference between revisions of "DB layer 2.0 implementation plan"

From MoodleDocs
Line 1: Line 1:
{{Work in progress}}
{{Work in progress}}
{{Development:dmllib 2.0}}
{{Template:Development:dmllib 2.0}}

Revision as of 02:57, 11 May 2008

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.



  1. import latest adodb for PHP5

in patch MDL-14679:

  1. implement basic API as abstract moodle_database class and moodle_recordset interface
  2. tweak lib/setup.php and related files - place all $DB setup code into one function setup_DB()
  3. keep old global $db until everything is converted to new global $DB
  4. all dmllib functions that do not accept $sql or $select can be rewritten to use new $DB - move those classes to lib/dmllib_deprecated.php for now - this allows us to run moodle in hybrid mode for testing purposes
  5. move all unused dmllib functions to lib/dmllib_removed.php and remove body - this could be useful during the migration phase of contrib (make them to act as wrappers over new dmllib and emit debugging messages!)
  6. implement basic mysql and postgresql classes


  1. test, refactor, rewrite, improve, etc. the new dmllib classes
  2. implement classes for all supported backends - oracle, mssql
  3. majority of code can be converted to new classes while keeping magic quotes on (we are dealing with numbers mostly), the formslib can already return unslashed data and we can add new parameter to data_submitted() too
  4. kill the magic quotes and convert the rest

We could also prepare an experimental mysql pdo driver in parallel - this could help to uncover potential problems in API design or implementation.