Public Member Functions | |
getCharLimits () | |
Static Public Member Functions | |
static | charLength ($columnName) |
static | concat (array $strings) |
static | escape ($value) |
static | getAllTableNames () |
static | getDateFormat () |
static | getDateTimeFormat () |
static | getMaxVarCharLength () |
static | lower ($columnName) |
static | getQuote () |
static | getTrue () |
static | length ($columnName) |
static | quoteString ($string) |
static | getDatabaseMaxColumnNameLength () |
static | getDatabaseReserverWords () |
static | getOperatorAndValueWherePart ($operatorType, $value) |
static | resolveToLowerForStringComparison ($operatorType, $value) |
static | bulkInsert ($tableName, &$rowsOfColumnValues, &$columnNames, $bulkQuantity, $shouldTrim=false) |
static | getDatabaseVersion ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort) |
static | getDatabaseMaxAllowedPacketsSizeRb () |
static | getDatabaseMaxAllowedPacketsSize ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort) |
static | getDatabaseMaxSpRecursionDepth ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort) |
static | getDatabaseThreadStackValue ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort) |
static | getDatabaseOptimizerSearchDepthValue ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort) |
static | getDatabaseLogBinValue ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort) |
static | getDatabaseLogBinTrustFunctionCreatorsValue ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort) |
static | getDatabaseDefaultCollation ($databaseType, $databaseHostname, $databaseName, $databaseUsername, $databasePassword, $databasePort) |
static | isDatabaseStrictMode ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort) |
static | checkDatabaseConnection ($databaseType, $host, $rootUsername, $rootPassword, $port) |
static | checkDatabaseExists ($databaseType, $host, $rootUsername, $rootPassword, $port, $databaseName) |
static | checkDatabaseUserExists ($databaseType, $host, $rootUsername, $rootPassword, $port, $username) |
static | getDatabaseSupportsLoadLocalInFile ($databaseType, $databaseHostname, $databaseUsername, $databasePassword, $databasePort) |
static | createDatabase ($databaseType, $host, $rootUsername, $rootPassword, $port, $databaseName) |
static | createDatabaseUser ($databaseType, $host, $rootUsername, $rootPassword, $port, $databaseName, $username, $password) |
static | getTableRowsCountTotal () |
static | getDatabaseDefaultPort ($databaseType= 'mysql') |
static | backupDatabase ($databaseType= 'mysql', $host, $username, $password, $port, $databaseName, $backupFilePath) |
static | restoreDatabase ($databaseType= 'mysql', $host, $username, $password, $port, $databaseName, $restoreFilePath) |
static | mapHintTypeIntoDatabaseColumnType ($hintType, $length=null) |
static | makeTimeZoneAdjustmentContent () |
static | resolveIntegerMaxAllowedValuesByType ($signed=false) |
static | resolveCollationByHintType ($hint) |
static | resolveUnsignedByHintType ($hint, $assumeSigned=false, $hintName=null) |
Helper functionality for use in RedBeanModels and derived models. These functions cater for specific databases other than MySQL, then by default return results for for MySQL.
Definition at line 42 of file DatabaseCompatibilityUtil.php.
static charLength | ( | $ | columnName | ) | [static] |
Returns the database character length equivalent string function by a column name.
string | $columnName |
Definition at line 48 of file DatabaseCompatibilityUtil.php.
static concat | ( | array $ | strings | ) | [static] |
Returns sql to concatentate the given strings for the current database.
Definition at line 58 of file DatabaseCompatibilityUtil.php.
static getAllTableNames | ( | ) | [static] |
Returns an array of table names from the database.
Definition at line 79 of file DatabaseCompatibilityUtil.php.
static getDateFormat | ( | ) | [static] |
Get the date format for the database in Unicode format. http://www.unicode.org/reports/tr35/#Date_Format_Patterns
Definition at line 90 of file DatabaseCompatibilityUtil.php.
static getDateTimeFormat | ( | ) | [static] |
Get the datetime format for the database in Unicode format. http://www.unicode.org/reports/tr35/#Date_Format_Patterns
Definition at line 100 of file DatabaseCompatibilityUtil.php.
static getMaxVarCharLength | ( | ) | [static] |
Returns the maximum varchar column type value.
Definition at line 108 of file DatabaseCompatibilityUtil.php.
static lower | ( | $ | columnName | ) | [static] |
Returns the database string to lower equivalent string function by a column name and adds quotes to it.
string | $columnName |
Definition at line 118 of file DatabaseCompatibilityUtil.php.
static getQuote | ( | ) | [static] |
Get the quote used for quoting table and column names. for the current database. Note: ' is always used for strings.
Definition at line 129 of file DatabaseCompatibilityUtil.php.
static getTrue | ( | ) | [static] |
Returns the value that represents true in sql for the current database.
Definition at line 146 of file DatabaseCompatibilityUtil.php.
static length | ( | $ | columnName | ) | [static] |
Returns the database length equivalent string function by a column name.
string | $columnName |
Definition at line 163 of file DatabaseCompatibilityUtil.php.
static quoteString | ( | $ | string | ) | [static] |
Returns the given string quoted for the current database. Note: ' is always used for strings. Do not use this function to quote strings in sql.
Definition at line 175 of file DatabaseCompatibilityUtil.php.
static getDatabaseMaxColumnNameLength | ( | ) | [static] |
Get max length for column name
Definition at line 186 of file DatabaseCompatibilityUtil.php.
static getDatabaseReserverWords | ( | ) | [static] |
Get array of database reserved words
NotSupportedException |
Definition at line 197 of file DatabaseCompatibilityUtil.php.
static getOperatorAndValueWherePart | ( | $ | operatorType, | |
$ | value | |||
) | [static] |
Given an operator type and value, SQL is constructed. Example return would be '>= 5'.
Definition at line 240 of file DatabaseCompatibilityUtil.php.
static bulkInsert | ( | $ | tableName, | |
&$ | rowsOfColumnValues, | |||
&$ | columnNames, | |||
$ | bulkQuantity, | |||
$ | shouldTrim = false | |||
) | [static] |
Insert multiple columns into database. Currently it supports only mysql database. Limit write to 500 rows at once
string | $tableName | |
array | $rowsOfColumnValues | |
array | $columnNames | |
$bulkQuantity | ||
bool | $shouldTrim Should trim data before insert |
BulkInsertFailedException | ||
NotSupportedException |
Definition at line 292 of file DatabaseCompatibilityUtil.php.
static getDatabaseVersion | ( | $ | databaseType, | |
$ | databaseHostname, | |||
$ | databaseUsername, | |||
$ | databasePassword, | |||
$ | databasePort | |||
) | [static] |
Get version number of database
string | $databaseType | |
string | $databaseHostname | |
string | $databaseUsername | |
string | $databasePassword | |
string | $port |
NotSupportedException |
Definition at line 359 of file DatabaseCompatibilityUtil.php.
static getDatabaseMaxAllowedPacketsSizeRb | ( | ) | [static] |
Get database max alowed packet size.
NotSupportedException |
Definition at line 395 of file DatabaseCompatibilityUtil.php.
static getDatabaseMaxAllowedPacketsSize | ( | $ | databaseType, | |
$ | databaseHostname, | |||
$ | databaseUsername, | |||
$ | databasePassword, | |||
$ | databasePort | |||
) | [static] |
Get database max alowed packet size.
string | $databaseType | |
string | $databaseHostname | |
string | $databaseUsername | |
string | $databasePassword | |
string | $databasePort |
NotSupportedException |
Definition at line 424 of file DatabaseCompatibilityUtil.php.
static getDatabaseMaxSpRecursionDepth | ( | $ | databaseType, | |
$ | databaseHostname, | |||
$ | databaseUsername, | |||
$ | databasePassword, | |||
$ | databasePort | |||
) | [static] |
Get database max_sp_recursion_depth
string | $databaseType | |
string | $databaseHostname | |
string | $databaseUsername | |
string | $databasePassword | |
string | $databasePort |
NotSupportedException |
Definition at line 462 of file DatabaseCompatibilityUtil.php.
static getDatabaseThreadStackValue | ( | $ | databaseType, | |
$ | databaseHostname, | |||
$ | databaseUsername, | |||
$ | databasePassword, | |||
$ | databasePort | |||
) | [static] |
Get database thread_stack
string | $databaseType | |
string | $databaseHostname | |
string | $databaseUsername | |
string | $databasePassword | |
string | $databasePort |
NotSupportedException |
Definition at line 499 of file DatabaseCompatibilityUtil.php.
static getDatabaseOptimizerSearchDepthValue | ( | $ | databaseType, | |
$ | databaseHostname, | |||
$ | databaseUsername, | |||
$ | databasePassword, | |||
$ | databasePort | |||
) | [static] |
Get database optimizer_search_depth
string | $databaseType | |
string | $databaseHostname | |
string | $databaseUsername | |
string | $databasePassword | |
string | $databasePort |
NotSupportedException |
Definition at line 536 of file DatabaseCompatibilityUtil.php.
static getDatabaseLogBinValue | ( | $ | databaseType, | |
$ | databaseHostname, | |||
$ | databaseUsername, | |||
$ | databasePassword, | |||
$ | databasePort | |||
) | [static] |
Get database log_bin
string | $databaseType | |
string | $databaseHostname | |
string | $databaseUsername | |
string | $databasePassword | |
string | $databasePort |
NotSupportedException |
Definition at line 573 of file DatabaseCompatibilityUtil.php.
static getDatabaseLogBinTrustFunctionCreatorsValue | ( | $ | databaseType, | |
$ | databaseHostname, | |||
$ | databaseUsername, | |||
$ | databasePassword, | |||
$ | databasePort | |||
) | [static] |
Get database log_bin_trust_function_creators
string | $databaseType | |
string | $databaseHostname | |
string | $databaseUsername | |
string | $databasePassword | |
string | $databasePort |
NotSupportedException |
Definition at line 610 of file DatabaseCompatibilityUtil.php.
static getDatabaseDefaultCollation | ( | $ | databaseType, | |
$ | databaseHostname, | |||
$ | databaseName, | |||
$ | databaseUsername, | |||
$ | databasePassword, | |||
$ | databasePort | |||
) | [static] |
Get database default collation
string | $databaseType | |
string | $databaseHostname | |
string | $databaseName | |
string | $databaseUsername | |
string | $databasePassword | |
string | $databasePort |
NotSupportedException |
Definition at line 649 of file DatabaseCompatibilityUtil.php.
static isDatabaseStrictMode | ( | $ | databaseType, | |
$ | databaseHostname, | |||
$ | databaseUsername, | |||
$ | databasePassword, | |||
$ | databasePort | |||
) | [static] |
Check if database is in strict mode
string | $databaseType | |
string | $databaseHostname | |
string | $databaseUsername | |
string | $databasePassword | |
string | $databasePort |
NotSupportedException |
Definition at line 690 of file DatabaseCompatibilityUtil.php.
static checkDatabaseConnection | ( | $ | databaseType, | |
$ | host, | |||
$ | rootUsername, | |||
$ | rootPassword, | |||
$ | port | |||
) | [static] |
Check if can connect to database
string | $databaseType | |
string | $host | |
string | $rootUsername | |
string | $rootPassword | |
string | $port |
NotSupportedException |
Definition at line 735 of file DatabaseCompatibilityUtil.php.
static checkDatabaseExists | ( | $ | databaseType, | |
$ | host, | |||
$ | rootUsername, | |||
$ | rootPassword, | |||
$ | port, | |||
$ | databaseName | |||
) | [static] |
Check if database exist
string | $databaseType | |
string | $host | |
string | $rootUsername | |
string | $rootPassword | |
string | $port | |
string | $databaseName |
NotSupportedException |
Definition at line 773 of file DatabaseCompatibilityUtil.php.
static checkDatabaseUserExists | ( | $ | databaseType, | |
$ | host, | |||
$ | rootUsername, | |||
$ | rootPassword, | |||
$ | port, | |||
$ | username | |||
) | [static] |
Check if database user exist
string | $databaseType | |
string | $host | |
string | $rootUsername | |
string | $rootPassword | |
string | $port | |
string | $username |
NotSupportedException |
Definition at line 813 of file DatabaseCompatibilityUtil.php.
static createDatabase | ( | $ | databaseType, | |
$ | host, | |||
$ | rootUsername, | |||
$ | rootPassword, | |||
$ | port, | |||
$ | databaseName | |||
) | [static] |
Creates the named database, dropping it first if it already exists.
string | $databaseType | |
string | $host | |
string | $rootUsername | |
string | $rootPassword | |
string | $port | |
string | $databaseName |
NotSupportedException |
Definition at line 909 of file DatabaseCompatibilityUtil.php.
static createDatabaseUser | ( | $ | databaseType, | |
$ | host, | |||
$ | rootUsername, | |||
$ | rootPassword, | |||
$ | port, | |||
$ | databaseName, | |||
$ | username, | |||
$ | password | |||
) | [static] |
Creates the named database user, dropping it first if it already exists. Grants the user full access on the given database.
string | $databaseType | |
string | $host | |
string | $rootUsername | |
string | $rootPassword | |
string | $port | |
string | $databaseName | |
string | $username | |
string | $password |
NotSupportedException |
Definition at line 952 of file DatabaseCompatibilityUtil.php.
static getDatabaseDefaultPort | ( | $ | databaseType = 'mysql' |
) | [static] |
Get port on which database is running by default, depending on database type
string | $databaseType |
Definition at line 1003 of file DatabaseCompatibilityUtil.php.
static backupDatabase | ( | $ | databaseType = 'mysql' , |
|
$ | host, | |||
$ | username, | |||
$ | password, | |||
$ | port, | |||
$ | databaseName, | |||
$ | backupFilePath | |||
) | [static] |
Baackup database schema and stored procedures.
string | $databaseType | |
string | $host | |
string | $username | |
string | $password | |
int | $port | |
string | $databaseName | |
string | $backupFilePath |
NotSupportedException |
Definition at line 1027 of file DatabaseCompatibilityUtil.php.
static mapHintTypeIntoDatabaseColumnType | ( | $ | hintType, | |
$ | length = null | |||
) | [static] |
Map hint type into database valid type
string | $hintType |
NotSupportedException |
Definition at line 1099 of file DatabaseCompatibilityUtil.php.