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 FOFDatabaseDriverPdomysql
+ Graphe d'héritage de FOFDatabaseDriverPdomysql:

Fonctions membres publiques

 __construct ($options)
 
 connect ()
 
 dropTable ($tableName, $ifExists=true)
 
 select ($database)
 
 getCollation ()
 
 getConnectionCollation ()
 
 getTableCreate ($tables)
 
 getTableColumns ($table, $typeOnly=true)
 
 getTableKeys ($table)
 
 getTableList ()
 
 getVersion ()
 
 lockTable ($table)
 
 renameTable ($oldTable, $newTable, $backup=null, $prefix=null)
 
 escape ($text, $extra=false)
 
 unlockTables ()
 
 transactionCommit ($toSavepoint=false)
 
 transactionRollback ($toSavepoint=false)
 
 transactionStart ($asSavepoint=false)
 
- Fonctions membres publiques hérités de FOFDatabaseDriverPdo
 __construct ($options)
 
 __destruct ()
 
 connect ()
 
 disconnect ()
 
 escape ($text, $extra=false)
 
 execute ()
 
 getOption ($key)
 
 getConnectedQuery ()
 
 setOption ($key, $value)
 
 connected ()
 
 getAffectedRows ()
 
 getNumRows ($cursor=null)
 
 insertid ()
 
 select ($database)
 
 setQuery ($query, $offset=null, $limit=null, $driverOptions=array())
 
 setUtf ()
 
 transactionCommit ($toSavepoint=false)
 
 transactionRollback ($toSavepoint=false)
 
 transactionStart ($asSavepoint=false)
 
 loadNextObject ($class='stdClass')
 
 loadNextAssoc ()
 
 loadNextRow ()
 
 __sleep ()
 
 __wakeup ()
 
- Fonctions membres publiques hérités de FOFDatabaseDriver
 __call ($method, $args)
 
 __construct ($options)
 
 alterDbCharacterSet ($dbName)
 
 alterTableCharacterSet ($tableName, $rethrow=false)
 
 connect ()
 
 connected ()
 
 createDatabase ($options, $utf=true)
 
 disconnect ()
 
 addDisconnectHandler ($callable)
 
 dropTable ($table, $ifExists=true)
 
 escape ($text, $extra=false)
 
 getAffectedRows ()
 
 getAlterDbCharacterSet ($dbName)
 
 getAlterTableCharacterSet ($tableName)
 
 convertUtf8mb4QueryToUtf8 ($query)
 
 getCollation ()
 
 getConnectionCollation ()
 
 getConnection ()
 
 getCount ()
 
 getDateFormat ()
 
 getLog ()
 
 getTimings ()
 
 getCallStacks ()
 
 getMinimum ()
 
 getNullDate ()
 
 getNumRows ($cursor=null)
 
 getPrefix ()
 
 getExporter ()
 
 getImporter ()
 
 getName ()
 
 getServerType ()
 
 getQuery ($new=false)
 
 getIterator ($column=null, $class='stdClass')
 
 getTableColumns ($table, $typeOnly=true)
 
 getTableCreate ($tables)
 
 getTableKeys ($tables)
 
 getTableList ()
 
 getUTFSupport ()
 
 hasUTFSupport ()
 
 hasUTF8mb4Support ()
 
 getVersion ()
 
 insertid ()
 
 insertObject ($table, &$object, $key=null)
 
 isMinimumVersion ()
 
 loadAssoc ()
 
 loadAssocList ($key=null, $column=null)
 
 loadColumn ($offset=0)
 
 loadNextObject ($class='stdClass')
 
 loadNextRow ()
 
 loadObject ($class='stdClass')
 
 loadObjectList ($key='', $class='stdClass')
 
 loadResult ()
 
 loadRow ()
 
 loadRowList ($key=null)
 
 lockTable ($tableName)
 
 quote ($text, $escape=true)
 
 quoteName ($name, $as=null)
 
 replacePrefix ($sql, $prefix='#__')
 
 renameTable ($oldTable, $newTable, $backup=null, $prefix=null)
 
 select ($database)
 
 setDebug ($level)
 
 setQuery ($query, $offset=0, $limit=0)
 
 setUtf ()
 
 transactionCommit ($toSavepoint=false)
 
 transactionRollback ($toSavepoint=false)
 
 transactionStart ($asSavepoint=false)
 
 truncateTable ($table)
 
 updateObject ($table, &$object, $key, $nulls=false)
 
 execute ()
 
 unlockTables ()
 
- Fonctions membres publiques hérités de FOFDatabase
 query ()
 
 getErrorMsg ($escaped=false)
 
 getErrorNum ()
 
 stderr ($showSQL=false)
 

Fonctions membres publiques statiques

static isSupported ()
 
- Fonctions membres publiques statiques hérités de FOFDatabaseDriverPdo
static isSupported ()
 
- Fonctions membres publiques statiques hérités de FOFDatabaseDriver
static getConnectors ()
 
static getInstance ($options=array())
 
static splitSql ($sql)
 
- Fonctions membres publiques statiques hérités de FOFDatabase
static getConnectors ()
 
static getInstance ($options=array())
 
static splitSql ($query)
 
static test ()
 

Champs de données

 $name = 'pdomysql'
 
 $serverType = 'mysql'
 
- Champs de données hérités de FOFDatabaseDriverPdo
 $name = 'pdo'
 
- Champs de données hérités de FOFDatabaseDriver
 $name
 
 $serverType
 

Attributs protégés

 $nameQuote = '`'
 
 $nullDate = '0000-00-00 00:00:00'
 
- Attributs protégés hérités de FOFDatabaseDriverPdo
 $connection
 
 $nameQuote = "'"
 
 $nullDate = '0000-00-00 00:00:00'
 
 $prepared
 
 $executed = false
 
- Attributs protégés hérités de FOFDatabaseDriver
 $connection
 
 $count = 0
 
 $cursor
 
 $debug = false
 
 $limit = 0
 
 $log = array()
 
 $timings = array()
 
 $callStacks = array()
 
 $nameQuote
 
 $nullDate
 
 $offset = 0
 
 $options
 
 $sql
 
 $tablePrefix
 
 $utf = true
 
 $utf8mb4 = false
 
 $errorNum = 0
 
 $errorMsg
 
 $transactionDepth = 0
 
 $disconnectHandlers = array()
 

Attributs protégés statiques

static $dbMinimum = '5.0.4'
 
- Attributs protégés statiques hérités de FOFDatabaseDriver
static $instances = array()
 
static $dbMinimum
 

Membres hérités additionnels

- Fonctions membres protégées hérités de FOFDatabaseDriverPdo
 fetchArray ($cursor=null)
 
 fetchAssoc ($cursor=null)
 
 fetchObject ($cursor=null, $class='stdClass')
 
 freeResult ($cursor=null)
 
 getErrorNumber ()
 
 getErrorMessage ($query)
 
- Fonctions membres protégées hérités de FOFDatabaseDriver
 fetchArray ($cursor=null)
 
 fetchAssoc ($cursor=null)
 
 fetchObject ($cursor=null, $class='stdClass')
 
 freeResult ($cursor=null)
 
 getCreateDatabaseQuery ($options, $utf)
 
 getDatabase ()
 
 quoteNameStr ($strArr)
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options)

Constructor.

Paramètres
array$optionsArray of database options with keys: host, user, password, database, select.
Depuis
3.4

Pre-populate the UTF-8 Multibyte compatibility flag. Unfortunately PDO won't report the server version unless we're connected to it and we cannot connect to it unless we know if it supports utf8mb4 which requires us knowing the server version. Between this chicken and egg issue we assume it's supported and we'll just catch any problems at connection time.

Références $options.

Documentation des fonctions membres

◆ connect()

connect ( )

Connects to the database if needed.

Renvoie
void Returns void if the database connected successfully.
Depuis
3.4
Exceptions
RuntimeException

If the connection failed and I was trying to use the utf8mb4 charset then it is likely that the server doesn't support utf8mb4 despite claiming otherwise.

This happens on old MySQL server versions (less than 5.5.3) using the mysqlnd PHP driver. Since mysqlnd masks the server version and reports only its own we can not be sure if the server actually does support UTF-8 Multibyte (i.e. it's MySQL 5.5.3 or later). Since the utf8mb4 charset is undefined in this case we catch the error and determine that utf8mb4 is not supported!

◆ dropTable()

dropTable (   $tableName,
  $ifExists = true 
)

Drops a table from the database.

Paramètres
string$tableNameThe name of the database table to drop.
boolean$ifExistsOptionally specify that the table must exist before it is dropped.
Renvoie
FOFDatabaseDriverPdomysql Returns this object to support chaining.
Depuis
3.4
Exceptions
RuntimeException

Références $query.

◆ escape()

escape (   $text,
  $extra = false 
)

Method to escape a string for usage in an SQL statement.

Oracle escaping reference: http://www.orafaq.com/wiki/SQL_FAQ#How_does_one_escape_special_characters_when_writing_SQL_queries.3F

SQLite escaping notes: http://www.sqlite.org/faq.html#q14

Method body is as implemented by the Zend Framework

Note: Using query objects with bound variables is preferable to the below.

Paramètres
string$textThe string to be escaped.
boolean$extraUnused optional parameter to provide extra escaping.
Renvoie
string The escaped string.
Depuis
3.4

Références $text.

◆ getCollation()

getCollation ( )

Method to get the database collation in use by sampling a text field of a table in the database.

Renvoie
mixed The collation in use by the database (string) or boolean false if not supported.
Depuis
3.4
Exceptions
RuntimeException

◆ getConnectionCollation()

getConnectionCollation ( )

Method to get the database connection collation, as reported by the driver. If the connector doesn't support reporting this value please return an empty string.

Renvoie
string

◆ getTableColumns()

getTableColumns (   $table,
  $typeOnly = true 
)

Retrieves field information about a given table.

Paramètres
string$tableThe name of the database table.
boolean$typeOnlyTrue to only return field types.
Renvoie
array An array of fields for the database table.
Depuis
3.4
Exceptions
RuntimeException

Références $field, et $fields.

◆ getTableCreate()

getTableCreate (   $tables)

Shows the table CREATE statement that creates the given tables.

Paramètres
mixed$tablesA table name or a list of table names.
Renvoie
array A list of the create SQL for the tables.
Depuis
3.4
Exceptions
RuntimeException

Références $row.

◆ getTableKeys()

getTableKeys (   $table)

Get the details list of keys for a table.

Paramètres
string$tableThe name of the table.
Renvoie
array An array of the column specification for the table.
Depuis
3.4
Exceptions
RuntimeException

◆ getTableList()

getTableList ( )

Method to get an array of all tables in the database.

Renvoie
array An array of all the tables in the database.
Depuis
3.4
Exceptions
RuntimeException

◆ getVersion()

getVersion ( )

Get the version of the database connector.

Renvoie
string The database connector version.
Depuis
3.4

◆ isSupported()

static isSupported ( )
static

Test to see if the MySQL connector is available.

Renvoie
boolean True on success, false otherwise.
Depuis
3.4

Implémente JDatabaseInterface.

Référencé par FOFDatabaseDriver\getInstance().

◆ lockTable()

lockTable (   $table)

Locks a table in the database.

Paramètres
string$tableThe name of the table to unlock.
Renvoie
FOFDatabaseDriverPdomysql Returns this object to support chaining.
Depuis
3.4
Exceptions
RuntimeException

◆ renameTable()

renameTable (   $oldTable,
  $newTable,
  $backup = null,
  $prefix = null 
)

Renames a table in the database.

Paramètres
string$oldTableThe name of the table to be renamed
string$newTableThe new name for the table.
string$backupNot used by MySQL.
string$prefixNot used by MySQL.
Renvoie
FOFDatabaseDriverPdomysql Returns this object to support chaining.
Depuis
3.4
Exceptions
RuntimeException

◆ select()

select (   $database)

Select a database for use.

Paramètres
string$databaseThe name of the database to select for use.
Renvoie
boolean True if the database was successfully selected.
Depuis
3.4
Exceptions
RuntimeException

◆ transactionCommit()

transactionCommit (   $toSavepoint = false)

Method to commit a transaction.

Paramètres
boolean$toSavepointIf true, commit to the last savepoint.
Renvoie
void
Depuis
3.4
Exceptions
RuntimeException

◆ transactionRollback()

transactionRollback (   $toSavepoint = false)

Method to roll back a transaction.

Paramètres
boolean$toSavepointIf true, rollback to the last savepoint.
Renvoie
void
Depuis
3.4
Exceptions
RuntimeException

◆ transactionStart()

transactionStart (   $asSavepoint = false)

Method to initialize a transaction.

Paramètres
boolean$asSavepointIf true and a transaction is already active, a savepoint will be created.
Renvoie
void
Depuis
3.4
Exceptions
RuntimeException

◆ unlockTables()

unlockTables ( )

Unlocks tables in the database.

Renvoie
FOFDatabaseDriverPdomysql Returns this object to support chaining.
Depuis
3.4
Exceptions
RuntimeException

Documentation des champs

◆ $dbMinimum

$dbMinimum = '5.0.4'
staticprotected

◆ $name

$name = 'pdomysql'

◆ $nameQuote

$nameQuote = '`'
protected

◆ $nullDate

$nullDate = '0000-00-00 00:00:00'
protected

◆ $serverType

$serverType = 'mysql'

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