]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14863 - 1st iteration: lowercase XMLDB constants, object, file and structure...
authorstronk7 <stronk7>
Tue, 20 May 2008 17:06:26 +0000 (17:06 +0000)
committerstronk7 <stronk7>
Tue, 20 May 2008 17:06:26 +0000 (17:06 +0000)
20 files changed:
admin/xmldb/actions/check_bigints/check_bigints.class.php
admin/xmldb/actions/check_defaults/check_defaults.class.php
admin/xmldb/actions/check_indexes/check_indexes.class.php
admin/xmldb/actions/load_xml_file/load_xml_file.class.php
admin/xmldb/actions/load_xml_files/load_xml_files.class.php
admin/xmldb/actions/view_structure_php/view_structure_php.class.php
admin/xmldb/actions/view_table_php/view_table_php.class.php
admin/xmldb/index.php
lib/ddl/database_manager.php
lib/ddl/sql_generator.php
lib/ddllib.php
lib/xmldb/XMLDBField.class.php
lib/xmldb/XMLDBIndex.class.php
lib/xmldb/XMLDBKey.class.php
lib/xmldb/XMLDBStatement.class.php
lib/xmldb/XMLDBTable.class.php
lib/xmldb/xmldb_constants.php [moved from lib/xmldb/XMLDBConstants.php with 98% similarity]
lib/xmldb/xmldb_file.php [moved from lib/xmldb/XMLDBFile.class.php with 90% similarity]
lib/xmldb/xmldb_object.php [moved from lib/xmldb/XMLDBObject.class.php with 91% similarity]
lib/xmldb/xmldb_structure.php [moved from lib/xmldb/XMLDBStructure.class.php with 97% similarity]

index abaa91cb55abfd1476fe79346585d640b77ec09c..6cc2b220f6e0a6b32e75553f899e0721001d4787 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
@@ -142,7 +142,7 @@ class check_bigints extends XMLDBAction {
                         continue;
                     }
                 /// Load the XML file
-                    $xmldb_file = new XMLDBFile($dbdir->path . '/install.xml');
+                    $xmldb_file = new xmldb_file($dbdir->path . '/install.xml');
 
                 /// Only if the file exists
                     if (!$xmldb_file->fileExists()) {
index 5b22238f4c34715e0d687cabe984285384930818..896021906b6ae292eb5a5d354e9a92ec4f6f9708 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
@@ -125,7 +125,7 @@ class check_defaults extends XMLDBAction {
                         continue;
                     }
                 /// Load the XML file
-                    $xmldb_file = new XMLDBFile($dbdir->path . '/install.xml');
+                    $xmldb_file = new xmldb_file($dbdir->path . '/install.xml');
 
                 /// Only if the file exists
                     if (!$xmldb_file->fileExists()) {
index a7596b36712cd50045212633dae47234894c751e..5a177305df3f8d36e1b5046fb3886ddb994ab1a8 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
@@ -124,7 +124,7 @@ class check_indexes extends XMLDBAction {
                         continue;
                     }
                 /// Load the XML file
-                    $xmldb_file = new XMLDBFile($dbdir->path . '/install.xml');
+                    $xmldb_file = new xmldb_file($dbdir->path . '/install.xml');
 
                 /// Only if the file exists
                     if (!$xmldb_file->fileExists()) {
index 9804fd96a551e226b55147c3b7be73d0e5a474b2..c672d29cf15f1215fb636e54874b12e3e9710e75 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
@@ -80,7 +80,7 @@ class load_xml_file extends XMLDBAction {
                 if (!$dbdir->path_exists) {
                     return false;
                 }
-                $xmldb_file = new XMLDBFile($dbdir->path . '/install.xml');
+                $xmldb_file = new xmldb_file($dbdir->path . '/install.xml');
             ///Set the XML DTD and schema
                 $xmldb_file->setDTD($CFG->dirroot . '/lib/xmldb/xmldb.dtd');
                 $xmldb_file->setSchema($CFG->dirroot . '/lib/xmldb/xmldb.xsd');
index ba105f6201a63541f9063a7496608a67ed1070b8..1791111833cd6b07d1efaa25e20eece53df31c2d 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
@@ -76,7 +76,7 @@ class load_xml_files extends XMLDBAction {
                 if (!$dbdir->path_exists) {
                     continue;
                 }
-                $xmldb_file = new XMLDBFile($dbdir->path . '/install.xml');
+                $xmldb_file = new xmldb_file($dbdir->path . '/install.xml');
             /// Set dbdir as necessary
                 if ($xmldb_file->fileExists()) {
                     $dbdir->xml_exists = true;
index 13d757b9be887a74942411b034c9b0fb2174254e..cc7af7719c822fcae17fcb2da7b74ac124746f4e 100644 (file)
@@ -149,7 +149,7 @@ class view_structure_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * create one table using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table code to be created
      * @return string PHP code to be used to create the table
      */
@@ -227,7 +227,7 @@ class view_structure_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * drop one table using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table code to be dropped
      * @return string PHP code to be used to drop the table
      */
@@ -268,7 +268,7 @@ class view_structure_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * rename one table using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table code to be renamed
      * @return string PHP code to be used to rename the table
      */
@@ -310,7 +310,7 @@ class view_structure_php extends XMLDBAction {
      * implement the upgrade_xxxx_savepoint() php calls in
      * upgrade code generated from the editor
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @return string PHP code to be used to stabilish a savepoint
      */
     function upgrade_savepoint_php ($structure) {
index a891293f45574b3542c07ed1e4fff24be4ba44b2..22ca9f4b36cb8e7b6fc236ab4a0c57773a5e83a8 100644 (file)
@@ -305,7 +305,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * create one field using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string field field name to be created
      * @return string PHP code to be used to create the field
@@ -352,7 +352,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * drop one field using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string field field name to be dropped
      * @return string PHP code to be used to drop the field
@@ -398,7 +398,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * rename one field using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string field field name to be renamed
      * @return string PHP code to be used to rename the field
@@ -452,7 +452,7 @@ class view_table_php extends XMLDBAction {
      *     float to char
      *     char to float
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string field field name to change precision
      */
@@ -501,7 +501,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * change the precision of one field using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string field field name to change precision
      */
@@ -554,7 +554,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * change the unsigned/signed of one field using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string field field name to change unsigned/signed
      */
@@ -603,7 +603,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * change the nullability of one field using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string field field name to change null/not null
      */
@@ -653,7 +653,7 @@ class view_table_php extends XMLDBAction {
      * change the enum values (check constraint) of one field
      * using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string field field name to change its enum
      */
@@ -702,7 +702,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * change the default of one field using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string field field name to change null/not null
      */
@@ -751,7 +751,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * create one key using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string key key name to be created
      * @return string PHP code to be used to create the key
@@ -798,7 +798,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * drop one key using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string key key name to be dropped
      * @return string PHP code to be used to drop the key
@@ -845,7 +845,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * rename one key using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string key key name to be renamed
      * @return string PHP code to be used to rename the key
@@ -895,7 +895,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * create one index using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string index index name to be created
      * @return string PHP code to be used to create the index
@@ -942,7 +942,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * drop one index using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string index index name to be dropped
      * @return string PHP code to be used to drop the index
@@ -989,7 +989,7 @@ class view_table_php extends XMLDBAction {
      * This function will generate all the PHP code needed to
      * rename one index using XMLDB objects and functions
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @param string table table name
      * @param string index index name to be renamed
      * @return string PHP code to be used to rename the index
@@ -1040,7 +1040,7 @@ class view_table_php extends XMLDBAction {
      * implement the upgrade_xxxx_savepoint() php calls in
      * upgrade code generated from the editor
      *
-     * @param XMLDBStructure structure object containing all the info
+     * @param xmldb_structure structure object containing all the info
      * @return string PHP code to be used to stabilish a savepoint
      */
     function upgrade_savepoint_php ($structure) {
index f57b8a1be3f3347da8ee2a24e1646f0f5d7582d4..f36ed99512de4a37d128a42a00141d0e9fc2207b 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
 /// all the actions supported will be launched.
 
 /// Add required XMLDB constants
-    require_once('../../lib/xmldb/XMLDBConstants.php');
+    require_once('../../lib/xmldb/xmldb_constants.php');
 
 /// Add required XMLDB action classes
     require_once('actions/XMLDBAction.class.php');
 
 
 /// Add required XMLDB DB classes
-    require_once('../../lib/xmldb/XMLDBObject.class.php');
-    require_once('../../lib/xmldb/XMLDBFile.class.php');
-    require_once('../../lib/xmldb/XMLDBStructure.class.php');
+    require_once('../../lib/xmldb/xmldb_object.php');
+    require_once('../../lib/xmldb/xmldb_file.php');
+    require_once('../../lib/xmldb/xmldb_structure.php');
     require_once('../../lib/xmldb/XMLDBTable.class.php');
     require_once('../../lib/xmldb/XMLDBField.class.php');
     require_once('../../lib/xmldb/XMLDBKey.class.php');
index 2339c633ee7ce3a146186901ca8c25adb1d5370f..ac0893218769c91715472e19ce8a771b623503b1 100644 (file)
@@ -372,7 +372,7 @@ class database_manager {
      */
     public function delete_tables_from_xmldb_file($file, $feedback=true ) {
 
-        $xmldb_file = new XMLDBFile($file);
+        $xmldb_file = new xmldb_file($file);
 
         if (!$xmldb_file->fileExists()) {
             return false;
@@ -441,7 +441,7 @@ class database_manager {
      * @return boolean (true on success, false on error)
      */
     public function install_from_xmldb_file($file, $continue=true, $feedback=true) {
-        $xmldb_file = new XMLDBFile($file);
+        $xmldb_file = new xmldb_file($file);
 
         if (!$xmldb_file->fileExists()) {
             return false;
index 669f5f2215804596f3295840860848c9df53f8e9..6d48b6d4f77e6e62cf479331e0a4fbeb71a6e969 100644 (file)
@@ -1048,7 +1048,7 @@ abstract class sql_generator {
                          if (isset($matches[1])) {
                              $part = $matches[1];
                          /// Convert the comma separated string to an array
-                             $arr = XMLDBObject::comma2array($part);
+                             $arr = xmldb_object::comma2array($part);
                              if ($arr) {
                                  $value = $this->getConcatSQL($arr);
                              }
index 1f94e43dda5f9a9dc2084adb6b35a6913f4ae502..01487124cdea9dc9463e93324b239eaf1eebe46e 100644 (file)
 // For further documentation, visit http://docs.moodle.org/en/DDL_functions
 
 /// Add required XMLDB constants
-require_once($CFG->libdir.'/xmldb/XMLDBConstants.php');
+require_once($CFG->libdir.'/xmldb/xmldb_constants.php');
 
 /// Add required XMLDB DB classes
-require_once($CFG->libdir.'/xmldb/XMLDBObject.class.php');
-require_once($CFG->libdir.'/xmldb/XMLDBFile.class.php');
-require_once($CFG->libdir.'/xmldb/XMLDBStructure.class.php');
+require_once($CFG->libdir.'/xmldb/xmldb_object.php');
+require_once($CFG->libdir.'/xmldb/xmldb_file.php');
+require_once($CFG->libdir.'/xmldb/xmldb_structure.php');
 require_once($CFG->libdir.'/xmldb/XMLDBTable.class.php');
 require_once($CFG->libdir.'/xmldb/XMLDBField.class.php');
 require_once($CFG->libdir.'/xmldb/XMLDBKey.class.php');
@@ -100,7 +100,7 @@ function get_used_table_names() {
     foreach ($dbdirs as $dbdir) {
         $file = $dbdir.'/install.xml';
 
-        $xmldb_file = new XMLDBFile($file);
+        $xmldb_file = new xmldb_file($file);
 
         if (!$xmldb_file->fileExists()) {
             continue;
@@ -373,4 +373,4 @@ function table_column($table, $oldfield, $field, $type='integer', $size='10',
 }
 
 
-?>
\ No newline at end of file
+?>
index 0ffca5588a3dac59c91521bebee39b104218daab..f542af0cb9e5a3276e138a2d9d5432b98f72da9d 100644 (file)
@@ -26,7 +26,7 @@
 
 /// This class represent one XMLDB Field
 
-class XMLDBField extends XMLDBObject {
+class XMLDBField extends xmldb_object {
 
     var $type;
     var $length;
@@ -42,7 +42,7 @@ class XMLDBField extends XMLDBObject {
      * Creates one new XMLDBField
      */
     function XMLDBField($name) {
-        parent::XMLDBObject($name);
+        parent::__construct($name);
         $this->type = NULL;
         $this->length = NULL;
         $this->unsigned = true;
index 097efa5edc5c020f065e20e5e78a3eae249b5962..49b79a1f77502228f3de590aac729a791542dfbc 100644 (file)
@@ -26,7 +26,7 @@
 
 /// This class represent one XMLDB Index
 
-class XMLDBIndex extends XMLDBObject {
+class XMLDBIndex extends xmldb_object {
 
     var $unique;
     var $fields;
@@ -35,7 +35,7 @@ class XMLDBIndex extends XMLDBObject {
      * Creates one new XMLDBIndex
      */
     function XMLDBIndex($name) {
-        parent::XMLDBObject($name);
+        parent::__construct($name);
         $this->unique = false;
         $this->fields = array();
     }
index 6463c0e5411a915c6767daa0a5b190950b0bdef8..16ee8580469afd09a03444e4643038753844001b 100644 (file)
@@ -26,7 +26,7 @@
 
 /// This class represent one XMLDB Key
 
-class XMLDBKey extends XMLDBObject {
+class XMLDBKey extends xmldb_object {
 
     var $type;
     var $fields;
@@ -37,7 +37,7 @@ class XMLDBKey extends XMLDBObject {
      * Creates one new XMLDBKey
      */
     function XMLDBKey($name) {
-        parent::XMLDBObject($name);
+        parent::__construct($name);
         $this->type = NULL;
         $this->fields = array();
         $this->reftable = NULL;
index 90cfcaac8922c48ea7b8c72b703a510a314627ec..0b51668c1d97d32748c4dc760f143a585264c978 100644 (file)
@@ -28,7 +28,7 @@
 /// (a group of SQL arbitrary sentences)
 /// (only INSERT is allowed for now)
 
-class XMLDBStatement extends XMLDBObject {
+class XMLDBStatement extends xmldb_object {
 
     var $table;     // Table we are handling
     var $type;      // XMLDB_STATEMENT_TYPE
@@ -38,7 +38,7 @@ class XMLDBStatement extends XMLDBObject {
      * Creates one new XMLDBStatement
      */
     function XMLDBStatement($name) {
-        parent::XMLDBObject($name);
+        parent::__construct($name);
         $this->table     = NULL;
         $this->type      = XMLDB_STATEMENT_INCORRECT;
         $this->sentences = array();
index 7ad0d2a925e2dde510e7d5062efef694d09abf5d..f0c27497ec3a1fd7a867d502f826d482188d599b 100644 (file)
@@ -26,7 +26,7 @@
 
 /// This class represent one XMLDB table
 
-class XMLDBTable extends XMLDBObject {
+class XMLDBTable extends xmldb_object {
 
     var $fields;
     var $keys;
@@ -36,7 +36,7 @@ class XMLDBTable extends XMLDBObject {
      * Creates one new XMLDBTable
      */
     function XMLDBTable($name) {
-        parent::XMLDBObject($name);
+        parent::__construct($name);
         $this->fields = array();
         $this->keys = array();
         $this->indexes = array();
similarity index 98%
rename from lib/xmldb/XMLDBConstants.php
rename to lib/xmldb/xmldb_constants.php
index 6161b5d5bcc9d9b0da81918d498f14d1e065217e..52f9c8a2b7a2ee3383eac4fdfd28b73a1b99f16e 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
similarity index 90%
rename from lib/xmldb/XMLDBFile.class.php
rename to lib/xmldb/xmldb_file.php
index cb0761e734fe84e296e22b28fea5865a19e56f81..119297980da30cd0d1ff966b517de676069e8ecd 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
@@ -26,7 +26,7 @@
 
 /// This class represents an entire XMLDB file
 
-class XMLDBFile extends XMLDBObject {
+class xmldb_file extends xmldb_object {
 
     var $path;
     var $schema;
@@ -34,10 +34,10 @@ class XMLDBFile extends XMLDBObject {
     var $xmldb_structure;
 
     /**
-     * Constructor of the XMLDBFile
+     * Constructor of the xmldb_file
      */
-    function XMLDBFile ($path) {
-        parent::XMLDBObject($path);
+    function __construct ($path) {
+        parent::__construct($path);
         $this->path = $path;
         $this->xmldb_structure = NULL;
     }
@@ -96,7 +96,7 @@ class XMLDBFile extends XMLDBObject {
         /// Prepare errors
             if (!empty($errors)) {
             /// Create one structure to store errors
-                $structure = new XMLDBStructure($this->path);
+                $structure = new xmldb_structure($this->path);
             /// Add errors to structure
                 $structure->errormsg = 'XML Error: ';
                 foreach ($errors as $error) {
@@ -115,7 +115,7 @@ class XMLDBFile extends XMLDBObject {
             $parser = xml_parser_create();
             if (!xml_parse($parser, file_get_contents($this->path))) {
             /// Create one structure to store errors
-                $structure = new XMLDBStructure($this->path);
+                $structure = new xmldb_structure($this->path);
             /// Add error to structure
                 $structure->errormsg = sprintf("XML Error: %s at line %d", 
                          xml_error_string(xml_get_error_code($parser)),
@@ -148,7 +148,7 @@ class XMLDBFile extends XMLDBObject {
         /// Load everything to a big array
             $xmlarr = xmlize(file_get_contents($this->path));
         /// Convert array to xmldb structure
-            $this->xmldb_structure = $this->arr2XMLDBStructure($xmlarr);
+            $this->xmldb_structure = $this->arr2xmldb_structure($xmlarr);
         /// Analize results
             if ($this->xmldb_structure->isLoaded()) {
                 $this->loaded = true;
@@ -161,11 +161,11 @@ class XMLDBFile extends XMLDBObject {
     }
 
     /**
-     * This function takes an xmlized array and put it into one XMLDBStructure
+     * This function takes an xmlized array and put it into one xmldb_structure
      */
-    function arr2XMLDBStructure ($xmlarr) {
-        $structure = new XMLDBStructure($this->path);
-        $structure->arr2XMLDBStructure($xmlarr);
+    function arr2xmldb_structure ($xmlarr) {
+        $structure = new xmldb_structure($this->path);
+        $structure->arr2xmldb_structure($xmlarr);
         return $structure;
     }
 
@@ -184,7 +184,7 @@ class XMLDBFile extends XMLDBObject {
     }
 
     /**
-     * This function saves the whole XMLDBStructure to its file
+     * This function saves the whole xmldb_structure to its file
      */
     function saveXMLFile() {
 
similarity index 91%
rename from lib/xmldb/XMLDBObject.class.php
rename to lib/xmldb/xmldb_object.php
index 4c31feedee72850ced27a32c3d3c626abc0acf74..ae4a3919a40ce243c516f7525171cee90f7a08c7 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
@@ -27,7 +27,7 @@
 /// This class represent the XMLDB base class where all the common piezes
 /// are defined
 
-class XMLDBObject {
+class xmldb_object {
 
     var $name;
     var $comment;
@@ -39,9 +39,9 @@ class XMLDBObject {
     var $errormsg;
 
     /**
-     * Creates one new XMLDBObject
+     * Creates one new xmldb_object
      */
-    function XMLDBObject($name) {
+    function __construct($name) {
         $this->name = $name;
         $this->comment = NULL;
         $this->previous = NULL;
@@ -53,49 +53,49 @@ class XMLDBObject {
     }
 
     /**
-     * This function returns true/false, if the XMLDBObject has been loaded
+     * This function returns true/false, if the xmldb_object has been loaded
      */
     function isLoaded() {
         return $this->loaded;
     }
 
     /**
-     * This function returns true/false, if the XMLDBObject has changed
+     * This function returns true/false, if the xmldb_object has changed
      */
     function hasChanged() {
         return $this->changed;
     }
 
     /**
-     * This function returns the comment of one XMLDBObject
+     * This function returns the comment of one xmldb_object
      */
     function getComment() {
         return $this->comment;
     }
 
     /**
-     * This function returns the hash of one XMLDBObject
+     * This function returns the hash of one xmldb_object
      */
     function getHash() {
         return $this->hash;
     }
 
     /**
-     * This function will return the name of the previous XMLDBObject
+     * This function will return the name of the previous xmldb_object
      */
     function getPrevious() {
         return $this->previous;
     }
 
     /**
-     * This function will return the name of the next XMLDBObject
+     * This function will return the name of the next xmldb_object
      */
     function getNext() {
         return $this->next;
     }
 
     /**
-     * This function will return the name of the XMLDBObject
+     * This function will return the name of the xmldb_object
      */
     function getName() {
         return $this->name;
@@ -109,48 +109,48 @@ class XMLDBObject {
     }
 
     /**
-     * This function will set the comment of the XMLDB object
+     * This function will set the comment of the xmldb_object
      */
     function setComment($comment) {
         $this->comment = $comment;
     }
 
     /**
-     * This function will set the previous of the XMLDB object
+     * This function will set the previous of the xmldb_object
      */
     function setPrevious($previous) {
         $this->previous = $previous;
     }
 
     /**
-     * This function will set the next of the XMLDB object
+     * This function will set the next of the xmldb_object
      */
     function setNext($next) {
         $this->next = $next;
     }
 
     /**
-     * This function will set the hash of the XMLDB object
+     * This function will set the hash of the xmldb_object
      */
     function setHash($hash) {
         $this->hash = $hash;
     }
 
     /**
-     * This function will set the loaded field of the XMLDB object
+     * This function will set the loaded field of the xmldb_object
      */
     function setLoaded($loaded = true) {
         $this->loaded = $loaded;
     }
 
     /**
-     * This function will set the changed field of the XMLDB object
+     * This function will set the changed field of the xmldb_object
      */
     function setChanged($changed = true) {
         $this->changed = $changed;
     }
     /**
-     * This function will set the name field of the XMLDB object
+     * This function will set the name field of the xmldb_object
      */
     function setName($name) {
         $this->name = $name;
@@ -364,7 +364,7 @@ class XMLDBObject {
     }
 
     /**
-     * This function will display a readable info about the XMLDBObject
+     * This function will display a readable info about the xmldb_object
      * (should be implemented inside each XMLDBxxx object)
      */
     function readableInfo() {
similarity index 97%
rename from lib/xmldb/XMLDBStructure.class.php
rename to lib/xmldb/xmldb_structure.php
index 526a917299c97e68bc74242fdd929d5655535c8a..01b8d127867128ce83a9fff46d8ace869b8d4ade 100644 (file)
@@ -7,7 +7,7 @@
 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
 //          http://moodle.com                                            //
 //                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas        http://dougiamas.com  //
+// Copyright (C) 1999 onwards Martin Dougiamas     http://dougiamas.com  //
 //           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
 //                                                                       //
 // This program is free software; you can redistribute it and/or modify  //
@@ -26,7 +26,7 @@
 
 /// This class represent one XMLDB structure
 
-class XMLDBStructure extends XMLDBObject {
+class xmldb_structure extends xmldb_object {
 
     var $path;
     var $version;
@@ -34,10 +34,10 @@ class XMLDBStructure extends XMLDBObject {
     var $statements;
 
     /**
-     * Creates one new XMLDBStructure
+     * Creates one new xmldb_structure
      */
-    function XMLDBStructure($name) {
-        parent::XMLDBObject($name);
+    function construct($name) {
+        parent::__construct($name);
         $this->path = NULL;
         $this->version = NULL;
         $this->tables = array();
@@ -328,7 +328,7 @@ class XMLDBStructure extends XMLDBObject {
     /**
      * Load data from XML to the structure
      */
-    function arr2XMLDBStructure($xmlarr) {
+    function arr2xmldb_structure($xmlarr) {
 
         global $CFG;
 
@@ -459,7 +459,7 @@ class XMLDBStructure extends XMLDBObject {
     }
 
     /**
-     * This function calculate and set the hash of one XMLDBStructure
+     * This function calculate and set the hash of one xmldb_structure
      */
      function calculateHash($recursive = false) {
         if (!$this->loaded) {
@@ -561,7 +561,7 @@ class XMLDBStructure extends XMLDBObject {
 
     /**
      * This function returns the number of uses of one field inside
-     * a whole XMLDBStructure. Useful to detect if the field must be
+     * a whole xmldb_structure. Useful to detect if the field must be
      * locked. Return false if no uses are found.
      */
     function getFieldUses($tablename, $fieldname) {
@@ -618,7 +618,7 @@ class XMLDBStructure extends XMLDBObject {
 
     /**
      * This function returns the number of uses of one key inside
-     * a whole XMLDBStructure. Useful to detect if the key must be
+     * a whole xmldb_structure. Useful to detect if the key must be
      * locked. Return false if no uses are found.
      */
     function getKeyUses($tablename, $keyname) {
@@ -657,7 +657,7 @@ class XMLDBStructure extends XMLDBObject {
 
     /**
      * This function returns the number of uses of one index inside
-     * a whole XMLDBStructure. Useful to detect if the index must be
+     * a whole xmldb_structure. Useful to detect if the index must be
      * locked. Return false if no uses are found.
      */
     function getIndexUses($tablename, $indexname) {