PHP 클래스 FOF30\Database\Installer

파일 보기 프로젝트 열기: akeeba/fof 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$allTables Internal cache for table list

공개 메소드들

메소드 설명
__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

보호된 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
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.

메소드 상세

__construct() 공개 메소드

Public constructor
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

conditionMet() 보호된 메소드

Checks if a condition is met
protected conditionMet ( string $table, SimpleXMLElement $node ) : boolean
$table string The table we're operating on
$node SimpleXMLElement The condition definition node
리턴 boolean

findSchemaXml() 보호된 메소드

Find an suitable schema XML file for this database type and return the SimpleXMLElement holding its information
protected findSchemaXml ( ) : null | SimpleXMLElemen\SimpleXMLElement
리턴 null | SimpleXMLElemen\SimpleXMLElement Null if no suitable schema XML file is found

getForcedFile() 공개 메소드

Returns the absolute path to the forced XML schema file
public getForcedFile ( ) : string
리턴 string

getXmlDirectory() 공개 메소드

Returns the directory where XML schema files are stored
public getXmlDirectory ( ) : string
리턴 string

nukeCache() 공개 메소드

Clears the internal table list cache
public nukeCache ( ) : void
리턴 void

openAndVerify() 보호된 메소드

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.
protected openAndVerify ( $fileName ) : false | SimpleXMLElemen\SimpleXMLElement
리턴 false | SimpleXMLElemen\SimpleXMLElement False if it's not a suitable XML schema file

removeSchema() 공개 메소드

Uninstalls the database schema
public removeSchema ( ) : void
리턴 void

setForcedFile() 공개 메소드

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.
public setForcedFile ( string $forcedFile )
$forcedFile string

setXmlDirectory() 공개 메소드

Sets the directory where XML schema files are stored
public setXmlDirectory ( string $xmlDirectory )
$xmlDirectory string

updateSchema() 공개 메소드

Creates or updates the database schema
public updateSchema ( ) : void
리턴 void

프로퍼티 상세

$allTables 보호되어 있는 정적으로 프로퍼티

Internal cache for table list
protected static $allTables