Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe MysqlChangeItem
+ Graphe d'héritage de MysqlChangeItem:

Fonctions membres protégées

 buildCheckQuery ()
 
- Fonctions membres protégées hérités de ChangeItem
 buildCheckQuery ()
 

Fonctions membres privées

 fixInteger ($type1, $type2)
 
 fixQuote ($string)
 
 fixUtf8mb4TypeChecks ($type)
 
 checkNull ($changesArray)
 
 checkDefault ($changesArray, $type)
 

Membres hérités additionnels

- Fonctions membres publiques hérités de ChangeItem
 __construct ($db, $file, $query)
 
 check ()
 
 fix ()
 
- Fonctions membres publiques statiques hérités de ChangeItem
static getInstance ($db, $file, $query)
 
- Champs de données hérités de ChangeItem
 $file = null
 
 $updateQuery = null
 
 $checkQuery = null
 
 $checkQueryExpected = 1
 
 $db = null
 
 $queryType = null
 
 $msgElements = array()
 
 $checkStatus = 0
 
 $rerunStatus = 0
 

Description détaillée

Checks the database schema against one MySQL DDL query to see if it has been run.

Depuis
2.5

Documentation des fonctions membres

◆ buildCheckQuery()

buildCheckQuery ( )
protected

Checks a DDL query to see if it is a known type If yes, build a check query to see if the DDL has been run on the database. If successful, the $msgElements, $queryType, $checkStatus and $checkQuery fields are populated. The $msgElements contains the text to create the user message. The $checkQuery contains the SQL query to check whether the schema change has been run against the current database. The $queryType contains the type of DDL query that was run (for example, CREATE_TABLE, ADD_COLUMN, CHANGE_COLUMN_TYPE, ADD_INDEX). The $checkStatus field is set to zero if the query is created

If not successful, $checkQuery is empty and , and $checkStatus is -1. For example, this will happen if the current line is a non-DDL statement.

Renvoie
void
Depuis
2.5

When we made the UTF8MB4 conversion then text becomes medium text - so loosen the checks to these two types otherwise (for example) the profile fields profile_value check fails - see https://github.com/joomla/joomla-cms/issues/9258

When we made the UTF8MB4 conversion then text becomes medium text - so loosen the checks to these two types otherwise (for example) the profile fields profile_value check fails - see https://github.com/joomla/joomla-cms/issues/9258

Références $type, ChangeItem\$updateQuery, elseif, et null.

◆ checkDefault()

checkDefault (   $changesArray,
  $type 
)
private

Create query clause for column changes/modifications for DEFAULT attribute

Paramètres
array$changesArrayThe array of words after COLUMN name
string$typeThe type of the COLUMN
Renvoie
string The query clause for DEFAULT check in the check query
Depuis
3.8.6

Références $type.

◆ checkNull()

checkNull (   $changesArray)
private

Create query clause for column changes/modifications for NULL attribute

Paramètres
array$changesArrayThe array of words after COLUMN name
Renvoie
string The query clause for NULL check in the check query
Depuis
3.8.6

◆ fixInteger()

fixInteger (   $type1,
  $type2 
)
private

Fix up integer. Fixes problem with MySQL integer descriptions. On MySQL 8 display length is not shown anymore. This means we have to match e.g. both "int(10) unsigned" and "int unsigned", or both "int(11)" and "int" and so on. The same applies to the other integer data types "tinyint", "smallint", "mediumint" and "bigint".

Paramètres
string$type1the column type
string$type2the column attributes
Renvoie
string The original or changed column type.
Depuis
2.5

◆ fixQuote()

fixQuote (   $string)
private

Fixes up a string for inclusion in a query. Replaces name quote character with normal quote for literal. Drops trailing semicolon. Injects the database prefix.

Paramètres
string$stringThe input string to be cleaned up.
Renvoie
string The modified string.
Depuis
2.5

◆ fixUtf8mb4TypeChecks()

fixUtf8mb4TypeChecks (   $type)
private

Make check query for column changes/modifications tolerant for automatic type changes of text columns, e.g. from TEXT to MEDIUMTEXT, after conversion from utf8 to utf8mb4, and fix integer columns without display length for MySQL 8 (see also function "fixInteger" above).

Paramètres
string$typeThe column type found in the update query
Renvoie
string The condition for type check in the check query
Depuis
3.5

Références $type.


La documentation de cette classe a été générée à partir du fichier suivant :