Each object represents one query, which is one line from a DDS SQL query.
This class is used to check the site's database to see if the DDL query has been run. If not, it provides the ability to fix the database by re-running the DDL query. The queries are parsed from the update files in the folder administrator/components/com_admin/sql/updates/<database>. These updates are run automatically if the site was updated using com_installer. However, it is possible that the program files could be updated without udpating the database (for example, if a user just copies the new files over the top of an existing installation).
This is an abstract class. We need to extend it for each database and add a buildCheckQuery() method that creates the query to check that a DDL query has been run.
Located in /libraries/cms/schema/changeitem.php (line 32)
JObject | --JSchemaChangeitem
Class | Description |
---|---|
JSchemaChangeitemmysql | Checks the database schema against one MySQL DDL query to see if it has been run. |
JSchemaChangeitemsqlsrv | Checks the database schema against one MySQL DDL query to see if it has been run. |
Check query: query used to check the db schema
Check query result: expected result of check query if database is up to date
Checked status
JDatabase object
Update file: full path file name where query was found
Array with values for use in a JText::sprintf statment indicating what was checked
Tells you what the message should be, based on which elements are defined, as follows: For ADD_TABLE: table For ADD_COLUMN: table, column For CHANGE_COLUMN_TYPE: table, column, type For ADD_INDEX: table, index
Query type: To be used in building a language key for a message to tell user what was checked / changed Possible values: ADD_TABLE, ADD_COLUMN, CHANGE_COLUMN_TYPE, ADD_INDEX
Rerun status
Update query: query used to change the db schema (one line from the file)
Inherited from JObject
JObject::$_errors
Returns an instance of the correct schemachangeitem for the $db
Constructor: builds check query and message from $updateQuery
Runs the check query and checks that 1 row is returned If yes, return true, otherwise return false
Runs the update query to apply the change to the database
Inherited From JObject
JObject::__construct()
JObject::def()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()
JObject::__toString()
Documentation generated on Mon, 25 Jun 2012 13:52:58 -0500 by phpDocumentor 1.4.4