Class JSchemaChangeset

Description

Contains a set of JSchemaChange objects for a particular instance of Joomla.

Each of these objects contains a DDL query that should have been run against the database when this database was created or updated. This enables the Installation Manager to check that the current database schema is up to date.

  • since: 2.5

Located in /libraries/cms/schema/changeset.php (line 24)


	
			
Variable Summary
Method Summary
 static JSchemaChangeset getInstance (JDatabaseDriver $db, string $folder)
 JSchemaChangeset __construct (JDatabaseDriver $db, [string $folder = null])
 array check ()
 void fix ()
 string getSchema ()
 array getStatus ()
Variables
array $changeItems = array() (line 32)

Array of JSchemaChangeitem objects

  • since: 2.5
  • access: protected
JDatabaseDriver $db = null (line 40)

JDatabaseDriver object

  • since: 2.5
  • access: protected
string $folder = null (line 47)

Folder where SQL update files will be found

  • access: protected
Methods
static getInstance (line 80)

Returns a reference to the JSchemaChangeset object, only creating it if it doesn't already exist.

  • since: 2.5
  • access: public
static JSchemaChangeset getInstance (JDatabaseDriver $db, string $folder)
  • JDatabaseDriver $db: The current database object
  • string $folder: The full path to the folder containing the update queries
Constructor __construct (line 58)

Constructor: builds array of $changeItems by processing the .sql files in a folder.

The folder for the Joomla core updates is administrator/components/com_admin/sql/updates/<database>.

  • since: 2.5
  • access: public
JSchemaChangeset __construct (JDatabaseDriver $db, [string $folder = null])
  • JDatabaseDriver $db: The current database object
  • string $folder: The full path to the folder containing the update queries
check (line 101)

Checks the database and returns an array of any errors found.

Note these are not database errors but rather situations where the current schema is not up to date.

  • return: Array of errors if any.
  • since: 2.5
  • access: public
array check ()
fix (line 122)

Runs the update query to apply the change to the database

  • since: 2.5
  • access: public
void fix ()
getSchema (line 172)

Gets the current database schema, based on the highest version number.

Note that the .sql files are named based on the version and date, so the file name of the last file should match the database schema version in the #__schemas table.

  • return: the schema version for the database
  • since: 2.5
  • access: public
string getSchema ()
getStatus (line 138)

Returns an array of results for this set

  • return: associative array of changeitems grouped by unchecked, ok, error, and skipped
  • since: 2.5
  • access: public
array getStatus ()

Documentation generated on Tue, 19 Nov 2013 14:55:39 +0100 by phpDocumentor 1.4.3