From 46293bd7b78ddd5a19687dea2c5c98d86f4407b6 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 20 May 2008 17:06:26 +0000 Subject: [PATCH] MDL-14863 - 1st iteration: lowercase XMLDB constants, object, file and structure (no changes in public API yet) --- .../check_bigints/check_bigints.class.php | 4 +- .../check_defaults/check_defaults.class.php | 4 +- .../check_indexes/check_indexes.class.php | 4 +- .../load_xml_file/load_xml_file.class.php | 4 +- .../load_xml_files/load_xml_files.class.php | 4 +- .../view_structure_php.class.php | 8 ++-- .../view_table_php/view_table_php.class.php | 32 ++++++++-------- admin/xmldb/index.php | 10 ++--- lib/ddl/database_manager.php | 4 +- lib/ddl/sql_generator.php | 2 +- lib/ddllib.php | 12 +++--- lib/xmldb/XMLDBField.class.php | 4 +- lib/xmldb/XMLDBIndex.class.php | 4 +- lib/xmldb/XMLDBKey.class.php | 4 +- lib/xmldb/XMLDBStatement.class.php | 4 +- lib/xmldb/XMLDBTable.class.php | 4 +- ...XMLDBConstants.php => xmldb_constants.php} | 2 +- .../{XMLDBFile.class.php => xmldb_file.php} | 26 ++++++------- ...XMLDBObject.class.php => xmldb_object.php} | 38 +++++++++---------- ...tructure.class.php => xmldb_structure.php} | 20 +++++----- 20 files changed, 97 insertions(+), 97 deletions(-) rename lib/xmldb/{XMLDBConstants.php => xmldb_constants.php} (98%) rename lib/xmldb/{XMLDBFile.class.php => xmldb_file.php} (90%) rename lib/xmldb/{XMLDBObject.class.php => xmldb_object.php} (91%) rename lib/xmldb/{XMLDBStructure.class.php => xmldb_structure.php} (97%) diff --git a/admin/xmldb/actions/check_bigints/check_bigints.class.php b/admin/xmldb/actions/check_bigints/check_bigints.class.php index abaa91cb55..6cc2b220f6 100644 --- a/admin/xmldb/actions/check_bigints/check_bigints.class.php +++ b/admin/xmldb/actions/check_bigints/check_bigints.class.php @@ -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()) { diff --git a/admin/xmldb/actions/check_defaults/check_defaults.class.php b/admin/xmldb/actions/check_defaults/check_defaults.class.php index 5b22238f4c..896021906b 100644 --- a/admin/xmldb/actions/check_defaults/check_defaults.class.php +++ b/admin/xmldb/actions/check_defaults/check_defaults.class.php @@ -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()) { diff --git a/admin/xmldb/actions/check_indexes/check_indexes.class.php b/admin/xmldb/actions/check_indexes/check_indexes.class.php index a7596b3671..5a177305df 100644 --- a/admin/xmldb/actions/check_indexes/check_indexes.class.php +++ b/admin/xmldb/actions/check_indexes/check_indexes.class.php @@ -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()) { diff --git a/admin/xmldb/actions/load_xml_file/load_xml_file.class.php b/admin/xmldb/actions/load_xml_file/load_xml_file.class.php index 9804fd96a5..c672d29cf1 100644 --- a/admin/xmldb/actions/load_xml_file/load_xml_file.class.php +++ b/admin/xmldb/actions/load_xml_file/load_xml_file.class.php @@ -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'); diff --git a/admin/xmldb/actions/load_xml_files/load_xml_files.class.php b/admin/xmldb/actions/load_xml_files/load_xml_files.class.php index ba105f6201..1791111833 100644 --- a/admin/xmldb/actions/load_xml_files/load_xml_files.class.php +++ b/admin/xmldb/actions/load_xml_files/load_xml_files.class.php @@ -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; diff --git a/admin/xmldb/actions/view_structure_php/view_structure_php.class.php b/admin/xmldb/actions/view_structure_php/view_structure_php.class.php index 13d757b9be..cc7af7719c 100644 --- a/admin/xmldb/actions/view_structure_php/view_structure_php.class.php +++ b/admin/xmldb/actions/view_structure_php/view_structure_php.class.php @@ -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) { diff --git a/admin/xmldb/actions/view_table_php/view_table_php.class.php b/admin/xmldb/actions/view_table_php/view_table_php.class.php index a891293f45..22ca9f4b36 100644 --- a/admin/xmldb/actions/view_table_php/view_table_php.class.php +++ b/admin/xmldb/actions/view_table_php/view_table_php.class.php @@ -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) { diff --git a/admin/xmldb/index.php b/admin/xmldb/index.php index f57b8a1be3..f36ed99512 100644 --- a/admin/xmldb/index.php +++ b/admin/xmldb/index.php @@ -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 // @@ -28,16 +28,16 @@ /// 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'); diff --git a/lib/ddl/database_manager.php b/lib/ddl/database_manager.php index 2339c633ee..ac08932187 100644 --- a/lib/ddl/database_manager.php +++ b/lib/ddl/database_manager.php @@ -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; diff --git a/lib/ddl/sql_generator.php b/lib/ddl/sql_generator.php index 669f5f2215..6d48b6d4f7 100644 --- a/lib/ddl/sql_generator.php +++ b/lib/ddl/sql_generator.php @@ -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); } diff --git a/lib/ddllib.php b/lib/ddllib.php index 1f94e43dda..01487124cd 100644 --- a/lib/ddllib.php +++ b/lib/ddllib.php @@ -39,12 +39,12 @@ // 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 +?> diff --git a/lib/xmldb/XMLDBField.class.php b/lib/xmldb/XMLDBField.class.php index 0ffca5588a..f542af0cb9 100644 --- a/lib/xmldb/XMLDBField.class.php +++ b/lib/xmldb/XMLDBField.class.php @@ -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; diff --git a/lib/xmldb/XMLDBIndex.class.php b/lib/xmldb/XMLDBIndex.class.php index 097efa5edc..49b79a1f77 100644 --- a/lib/xmldb/XMLDBIndex.class.php +++ b/lib/xmldb/XMLDBIndex.class.php @@ -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(); } diff --git a/lib/xmldb/XMLDBKey.class.php b/lib/xmldb/XMLDBKey.class.php index 6463c0e541..16ee858046 100644 --- a/lib/xmldb/XMLDBKey.class.php +++ b/lib/xmldb/XMLDBKey.class.php @@ -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; diff --git a/lib/xmldb/XMLDBStatement.class.php b/lib/xmldb/XMLDBStatement.class.php index 90cfcaac89..0b51668c1d 100644 --- a/lib/xmldb/XMLDBStatement.class.php +++ b/lib/xmldb/XMLDBStatement.class.php @@ -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(); diff --git a/lib/xmldb/XMLDBTable.class.php b/lib/xmldb/XMLDBTable.class.php index 7ad0d2a925..f0c27497ec 100644 --- a/lib/xmldb/XMLDBTable.class.php +++ b/lib/xmldb/XMLDBTable.class.php @@ -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(); diff --git a/lib/xmldb/XMLDBConstants.php b/lib/xmldb/xmldb_constants.php similarity index 98% rename from lib/xmldb/XMLDBConstants.php rename to lib/xmldb/xmldb_constants.php index 6161b5d5bc..52f9c8a2b7 100644 --- a/lib/xmldb/XMLDBConstants.php +++ b/lib/xmldb/xmldb_constants.php @@ -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 // diff --git a/lib/xmldb/XMLDBFile.class.php b/lib/xmldb/xmldb_file.php similarity index 90% rename from lib/xmldb/XMLDBFile.class.php rename to lib/xmldb/xmldb_file.php index cb0761e734..119297980d 100644 --- a/lib/xmldb/XMLDBFile.class.php +++ b/lib/xmldb/xmldb_file.php @@ -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() { diff --git a/lib/xmldb/XMLDBObject.class.php b/lib/xmldb/xmldb_object.php similarity index 91% rename from lib/xmldb/XMLDBObject.class.php rename to lib/xmldb/xmldb_object.php index 4c31feedee..ae4a3919a4 100644 --- a/lib/xmldb/XMLDBObject.class.php +++ b/lib/xmldb/xmldb_object.php @@ -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() { diff --git a/lib/xmldb/XMLDBStructure.class.php b/lib/xmldb/xmldb_structure.php similarity index 97% rename from lib/xmldb/XMLDBStructure.class.php rename to lib/xmldb/xmldb_structure.php index 526a917299..01b8d12786 100644 --- a/lib/xmldb/XMLDBStructure.class.php +++ b/lib/xmldb/xmldb_structure.php @@ -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) { -- 2.39.5