[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/database/src/Mysqli/ -> MysqliDriver.php (summary)

Part of the Joomla Framework Database Package

Copyright: Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 1117 lines (28 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

MysqliDriver:: (35 methods):
  __construct()
  connect()
  convertUtf8mb4QueryToUtf8()
  disconnect()
  escape()
  isSupported()
  connected()
  getAlterDbCharacterSet()
  getCollation()
  getConnectionCollation()
  getConnectionEncryption()
  isConnectionEncryptionSupported()
  getCreateDatabaseQuery()
  getTableCreate()
  getTableColumns()
  getTableKeys()
  getTableList()
  getVersion()
  getMinimum()
  hasUTF8mb4Support()
  isMariaDb()
  insertid()
  insertObject()
  lockTable()
  renameTable()
  select()
  setUtf()
  transactionCommit()
  transactionRollback()
  transactionStart()
  executeUnpreparedQuery()
  prepareStatement()
  unlockTables()
  serverClaimsUtf8mb4Support()
  getNullDate()


Class: MysqliDriver  - X-Ref

MySQLi Database Driver

__construct(array $options)   X-Ref
Constructor.

param: array  $options  List of options used to configure the connection

connect()   X-Ref
Connects to the database if needed.

return: void  Returns void if the database connected successfully.

convertUtf8mb4QueryToUtf8($query)   X-Ref
Automatically downgrade a CREATE TABLE or ALTER TABLE query from utf8mb4 (UTF-8 Multibyte) to plain utf8.

Used when the server doesn't support UTF-8 Multibyte.

param: string  $query  The query to convert
return: string  The converted query

disconnect()   X-Ref
Disconnects the database.

return: void

escape($text, $extra = false)   X-Ref
Method to escape a string for usage in an SQL statement.

param: string   $text   The string to be escaped.
param: boolean  $extra  Optional parameter to provide extra escaping.
return: string  The escaped string.

isSupported()   X-Ref
Test to see if the MySQLi connector is available.

return: boolean  True on success, false otherwise.

connected()   X-Ref
Determines if the connection to the server is active.

return: boolean  True if connected to the database engine.

getAlterDbCharacterSet($dbName)   X-Ref
Return the query string to alter the database character set.

param: string  $dbName  The database name
return: string  The query that alter the database query string

getCollation()   X-Ref
Method to get the database collation in use by sampling a text field of a table in the database.

return: string|boolean  The collation in use by the database (string) or boolean false if not supported.

getConnectionCollation()   X-Ref
Method to get the database connection collation in use by sampling a text field of a table in the database.

return: string|boolean  The collation in use by the database connection (string) or boolean false if not supported.

getConnectionEncryption()   X-Ref
Method to get the database encryption details (cipher and protocol) in use.

return: string  The database encryption details.

isConnectionEncryptionSupported()   X-Ref
Method to test if the database TLS connections encryption are supported.

return: boolean  Whether the database supports TLS connections encryption.

getCreateDatabaseQuery($options, $utf)   X-Ref
Return the query string to create new Database.

param: stdClass  $options  Object used to pass user and database name to database driver. This object must have "db_name" and "db_user" set.
param: boolean   $utf      True if the database supports the UTF-8 character set.
return: string  The query that creates database

getTableCreate($tables)   X-Ref
Shows the table CREATE statement that creates the given tables.

param: mixed  $tables  A table name or a list of table names.
return: array  A list of the create SQL for the tables.

getTableColumns($table, $typeOnly = true)   X-Ref
Retrieves field information about a given table.

param: string   $table     The name of the database table.
param: boolean  $typeOnly  True to only return field types.
return: array  An array of fields for the database table.

getTableKeys($table)   X-Ref
Get the details list of keys for a table.

param: string  $table  The name of the table.
return: array  An array of the column specification for the table.

getTableList()   X-Ref
Method to get an array of all tables in the database.

return: array  An array of all the tables in the database.

getVersion()   X-Ref
Get the version of the database connector.

return: string  The database connector version.

getMinimum()   X-Ref
Get the minimum supported database version.

return: string

hasUTF8mb4Support()   X-Ref
Determine whether the database engine support the UTF-8 Multibyte (utf8mb4) character encoding.

return: boolean  True if the database engine supports UTF-8 Multibyte.

isMariaDb()   X-Ref
Determine if the database engine is MariaDB.

return: boolean

insertid()   X-Ref
Method to get the auto-incremented value from the last INSERT statement.

return: mixed  The value of the auto-increment field from the last inserted row.

insertObject($table, &$object, $key = null)   X-Ref
Inserts a row into a table based on an object's properties.

param: string  $table   The name of the database table to insert into.
param: object  $object  A reference to an object whose public properties match the table fields.
param: string  $key     The name of the primary key. If provided the object property is updated.
return: boolean

lockTable($table)   X-Ref
Locks a table in the database.

param: string  $table  The name of the table to unlock.
return: $this

renameTable($oldTable, $newTable, $backup = null, $prefix = null)   X-Ref
Renames a table in the database.

param: string  $oldTable  The name of the table to be renamed
param: string  $newTable  The new name for the table.
param: string  $backup    Not used by MySQL.
param: string  $prefix    Not used by MySQL.
return: $this

select($database)   X-Ref
Select a database for use.

param: string  $database  The name of the database to select for use.
return: boolean  True if the database was successfully selected.

setUtf()   X-Ref
Set the connection to use UTF-8 character encoding.

return: boolean  True on success.

transactionCommit($toSavepoint = false)   X-Ref
Method to commit a transaction.

param: boolean  $toSavepoint  If true, commit to the last savepoint.
return: void

transactionRollback($toSavepoint = false)   X-Ref
Method to roll back a transaction.

param: boolean  $toSavepoint  If true, rollback to the last savepoint.
return: void

transactionStart($asSavepoint = false)   X-Ref
Method to initialize a transaction.

param: boolean  $asSavepoint  If true and a transaction is already active, a savepoint will be created.
return: void

executeUnpreparedQuery($sql)   X-Ref
Internal method to execute queries which cannot be run as prepared statements.

param: string  $sql  SQL statement to execute.
return: boolean

prepareStatement(string $query)   X-Ref
Prepares a SQL statement for execution

param: string  $query  The SQL query to be prepared.
return: StatementInterface

unlockTables()   X-Ref
Unlocks tables in the database.

return: $this

serverClaimsUtf8mb4Support()   X-Ref
Does the database server claim to have support for UTF-8 Multibyte (utf8mb4) collation?

libmysql supports utf8mb4 since 5.5.3 (same version as the MySQL server). mysqlnd supports utf8mb4 since 5.0.9.

return: boolean

getNullDate()   X-Ref
Get the null or zero representation of a timestamp for the database driver.

return: string



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer