Property | Type | Description | |
---|---|---|---|
$allTables | Internal cache for table list |
Method | Description | |
---|---|---|
__construct ( JDatabaseDriver $db, string $directory ) | Public constructor | |
getForcedFile ( ) : string | Returns the absolute path to the forced XML schema file | |
getXmlDirectory ( ) : string | Returns the directory where XML schema files are stored | |
nukeCache ( ) : void | Clears the internal table list cache | |
removeSchema ( ) : void | Uninstalls the database schema | |
setForcedFile ( string $forcedFile ) | Sets the absolute path to an XML schema file which will be read no matter what. Set to a blank string to let the Installer class auto-detect your schema file based on your database type. | |
setXmlDirectory ( string $xmlDirectory ) | Sets the directory where XML schema files are stored | |
updateSchema ( ) : void | Creates or updates the database schema |
Method | Description | |
---|---|---|
conditionMet ( string $table, SimpleXMLElement $node ) : boolean | Checks if a condition is met | |
findSchemaXml ( ) : null | SimpleXMLElemen\SimpleXMLElement | Find an suitable schema XML file for this database type and return the SimpleXMLElement holding its information | |
openAndVerify ( $fileName ) : false | SimpleXMLElemen\SimpleXMLElement | Opens the schema XML file and return the SimpleXMLElement holding its information. If the file doesn't exist, it is not a schema file or it doesn't match our database driver we return boolean false. |
Method | Description | |
---|---|---|
convertTablesToUtf8mb4 ( array $tablesToConvert ) : void | Converts the collation of tables listed in $tablesToConvert to utf8mb4_unicode_ci | |
convertUtf8QueryToUtf8mb4 ( string $query ) : string | Automatically upgrade a CREATE TABLE or ALTER TABLE query from plain utf8 to utf8mb4 (UTF-8 Multibyte). | |
convertUtf8mb4QueryToUtf8 ( string $query ) : string | Automatically downgrade a CREATE TABLE or ALTER TABLE query from utf8mb4 (UTF-8 Multibyte) to plain utf8. | |
extractTablesToConvert ( string $query, string &$tables ) : void | Analyzes a query. If it's a CREATE TABLE query the table is added to the $tables array. | |
getColumnCollation ( string $tableName, string $columnName ) : string | Get the collation of a column. Uses an internal cache for efficiency. | |
getTableCollation ( string $tableName ) : string | Get the collation of a table. Uses an internal cache for efficiency. | |
hasIndex ( string $tableName, string $indexName ) : boolean | Returns true if table $tableName has an index named $indexName or if it's impossible to retrieve index names for the table (not enough privileges, not a MySQL database, . | |
realGetColumnCollation ( string $tableName, string $columnName ) : string | Get the collation of a column. This is the internal method used by getColumnCollation. | |
realGetTableCollation ( string $tableName ) : string | Get the collation of a table. This is the internal method used by getTableCollation. |
public __construct ( JDatabaseDriver $db, string $directory ) | ||
$db | JDatabaseDriver | The database driver we're going to use to install the tables |
$directory | string | The directory holding the XML schema update files |
protected conditionMet ( string $table, SimpleXMLElement $node ) : boolean | ||
$table | string | The table we're operating on |
$node | SimpleXMLElement | The condition definition node |
return | boolean |
protected findSchemaXml ( ) : null | SimpleXMLElemen\SimpleXMLElement | ||
return | null | SimpleXMLElemen\SimpleXMLElement | Null if no suitable schema XML file is found |
public getForcedFile ( ) : string | ||
return | string |
public getXmlDirectory ( ) : string | ||
return | string |
protected openAndVerify ( $fileName ) : false | SimpleXMLElemen\SimpleXMLElement | ||
return | false | SimpleXMLElemen\SimpleXMLElement | False if it's not a suitable XML schema file |
public removeSchema ( ) : void | ||
return | void |
public setForcedFile ( string $forcedFile ) | ||
$forcedFile | string |
public setXmlDirectory ( string $xmlDirectory ) | ||
$xmlDirectory | string |
public updateSchema ( ) : void | ||
return | void |