Moodle

Database export/import library

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

Create code to export database data to XML file and import XML data into existing database

  1. 200807301445-lib.php.patch
    30/Jul/08 7:21 PM
    6 kB
    Andrei Bautu
  2. 200807311040-dbtransfer.patch
    31/Jul/08 3:41 PM
    29 kB
    Andrei Bautu
  3. 200808150940-import_record_fix.patch
    15/Aug/08 2:42 PM
    0.9 kB
    Andrei Bautu

Activity

Hide
Penny Leach added a comment -

I know that xmldb classes use camel case, but coding guidelines specify lower case and underscores, even for classes and their methods:

http://docs.moodle.org/en/Development:Coding#Coding_style

Show
Penny Leach added a comment - I know that xmldb classes use camel case, but coding guidelines specify lower case and underscores, even for classes and their methods: http://docs.moodle.org/en/Development:Coding#Coding_style
Hide
Andrei Bautu added a comment -

Ok. I've switched to C-style namings (aka ugly, old and longer naming )

Show
Andrei Bautu added a comment - Ok. I've switched to C-style namings (aka ugly, old and longer naming )
Hide
Penny Leach added a comment -

looking pretty good - there's still DatabaseImporter in camel case but other than that it seems ok style wise.

import_table calls export functions - maybe a copy/paste error? it looks like the import side of things is less finished than the export classes.

Show
Penny Leach added a comment - looking pretty good - there's still DatabaseImporter in camel case but other than that it seems ok style wise. import_table calls export functions - maybe a copy/paste error? it looks like the import side of things is less finished than the export classes.
Hide
Andrei Bautu added a comment -

Fix wrong variable names in import_record.

Show
Andrei Bautu added a comment - Fix wrong variable names in import_record.
Hide
Petr Škoda (skodak) added a comment -

merging in progress...

Show
Petr Škoda (skodak) added a comment - merging in progress...
Hide
Petr Škoda (skodak) added a comment -
  • found one minor problem - the $CFG->version is not always int, could be float too
  • adding support for creation of tables if no tables present yet
  • moved the files around a bit - I suppose they might be moved around a bit more
  • made the function params more strict
  • tweaked whitespace and comments a bit

Big thanks, this is great!

committing into cvs

Show
Petr Škoda (skodak) added a comment -
  • found one minor problem - the $CFG->version is not always int, could be float too
  • adding support for creation of tables if no tables present yet
  • moved the files around a bit - I suppose they might be moved around a bit more
  • made the function params more strict
  • tweaked whitespace and comments a bit
Big thanks, this is great! committing into cvs

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: