[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Schema/ -> ChangeSet.php (summary)

Joomla! Content Management System

Copyright: (C) 2011 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 316 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ChangeSet:: (8 methods):
  __construct()
  getInstance()
  check()
  fix()
  getStatus()
  getSchema()
  getUpdateFiles()
  getUpdateQueries()


Class: ChangeSet  - X-Ref

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.

__construct($db, $folder = null)   X-Ref
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>`.

param: DatabaseDriver  $db      The current database object
param: string          $folder  The full path to the folder containing the update queries

getInstance($db, $folder = null)   X-Ref
Returns a reference to the ChangeSet object, only creating it if it doesn't already exist.

param: DatabaseDriver  $db      The current database object
param: string          $folder  The full path to the folder containing the update queries
return: ChangeSet

check()   X-Ref
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 Array of errors if any.

fix()   X-Ref
Runs the update query to apply the change to the database

return: void

getStatus()   X-Ref
Returns an array of results for this set

return: array  associative array of changeitems grouped by unchecked, ok, error, and skipped

getSchema()   X-Ref
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: string  the schema version for the database

getUpdateFiles()   X-Ref
Get list of SQL update files for this database

return: array|boolean  list of sql update full-path names. False if directory doesn't exist

getUpdateQueries(array $sqlfiles)   X-Ref
Get array of SQL queries

param: array  $sqlfiles  Array of .sql update filenames.
return: array  Array of \stdClass objects where:



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer