Back to Joomla project (class list)

Class ChangeSet - list of methods

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.
Package: Joomla\CMS\Schema
Copyright: (C) 2011 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Schema/ChangeSet.php
Project: Joomla

Method Summary

public
(mixed $db, mixed $folder = null)

Constructor: builds array of $changeItems by processing the .sql files in a folder.
Parameters
  • \Joomla\Database\DatabaseDriver $db The current database object
  • string $folder The full path to the folder containing the update queries
Since
  • 2.5
Show source code of this method: __construct Source Code

public static \Joomla\CMS\Schema\ChangeSet
(mixed $db, mixed $folder = null)

Returns a reference to the ChangeSet object, only creating it if it doesn't already exist.
Parameters
  • \Joomla\Database\DatabaseDriver $db The current database object
  • string $folder The full path to the folder containing the update queries
Returns
  • \Joomla\CMS\Schema\ChangeSet
Since
  • 2.5
Show source code of this method: getInstance Source Code

public array
()

Checks the database and returns an array of any errors found.
Returns
  • array Array of errors if any.
Since
  • 2.5
Show source code of this method: check Source Code

public void
()

Runs the update query to apply the change to the database
Returns
  • void
Since
  • 2.5
Show source code of this method: fix Source Code

public array
()

Returns an array of results for this set
Returns
  • array associative array of changeitems grouped by unchecked, ok, error, and skipped
Since
  • 2.5
Show source code of this method: getStatus Source Code

public string
()

Gets the current database schema, based on the highest version number.
Returns
  • string the schema version for the database
Since
  • 2.5
Show source code of this method: getSchema Source Code

private array|bool
()

Get list of SQL update files for this database
Returns
  • array|bool list of sql update full-path names. False if directory doesn't exist
Since
  • 2.5
Show source code of this method: getUpdateFiles Source Code

private array
(array $sqlfiles)

Get array of SQL queries
Parameters
  • array $sqlfiles Array of .sql update filenames.
Returns
  • array Array of \stdClass objects where: file=filename, update_query = text of SQL update query
Since
  • 2.5
Show source code of this method: getUpdateQueries Source Code

Properties Summary

protected \Joomla\CMS\Schema\ChangeItem[]
$changeItems
Array of ChangeItem objects
Since
  • 2.5
protected \Joomla\Database\DatabaseDriver
$db
DatabaseDriver object
Since
  • 2.5
protected string
$folder
Folder where SQL update files will be found
Since
  • 2.5
protected static \Joomla\CMS\Schema\ChangeSet
$instance
The singleton instance of this object
Since
  • 3.5.1

Tags Summary

Since
2.5