Source API for the «PorteDrivers_Mysql_Connection» class
Mysql connection implementation using persistant methods.
PHP magic methods
- __construct
-
Construct the connection from a configuration array.
-
- return
- null
- $config
- array
- __isset
-
Determine if a property exists.
- __get
-
Retrieve connection properties.
Public methods
- connect
-
Create a new connection object or resource with the databasse. Note, a new connection will only be create if it does not yet exist or if the configuration used to create the existing connection has changed since its creation. The method also deals with connection encoding.
- connectFromParams
-
Mysql implementation of the "connectFromParams" method.
- exec
-
Mysql implementation of the "exec" method.
- query
-
Mysql implementation of the "query" method.
- prepare
-
Mysql implementation of the "prepare" method.
- quote
-
Mysql implementation of the "quote" method.
- lastInsertId
-
Mysql implementation of the "lastInsertId" method.
- databaseCreate
-
Create a database of it does not already exists. This function does not check if the database already exists.
- tableClear
-
Empty a table completely and reset its internal counter.
- tableCreate
-
Create a table of it does not already exists. This function does not check if the table
already exists, in which case an error is thrown.
- tableDrop
-
Drop a table of it exists.
- tableShowColumns
-
This method is not yet documented.
- tableShowIndexes
-
This method is not yet documented.
- tableExists
-
This method is not yet documented.
- supportCrossDatabaseQueries
-
This method is not yet documented.
- makeColumnTypeInt
-
This method is not yet documented.
- makeColumnTypeBoolean
-
This method is not yet documented.
- host
-
Set or get the host name.
If no argument is provided, it returns the host name.
If one argument is provided, it create a new connection with the provided host name, or throw an exception on failure. -
- return
- string
- Host name
- getHost
-
Return the host name of the current connection.
- setHost
-
Create a new connection with the provided host name, or throw an exception on failure
- port
-
Set or get the port of the database connection.
If no argument is provided, it returns the current port.
If one argument is provided, it create a new connection with the provided port or throw an exception on failure. -
- return
- string
- Port name
- getPort
-
Return the port used by the current connection.
- setPort
-
Create a new connection with the provided server port, or throw an exception on failure.
- sock
-
Set or get the path to the socket of the database connection.
If no argument is provided, it returns the current socket.
If one argument is provided, it create a new connection with the provided socket or throw an exception on failure. -
- return
- string
- Socket path
- getSock
-
Return the socket used by the current connection.
- setSock
-
Create a new connection with the provided socket, or throw an exception on failure.
- username
-
Set or get the username of the database connection.
If no argument is provided, it returns the current username.
If one argument is provided, it create a new connection with the provided username or throw an exception on failure. -
- return
- string
- Database connection username
- getUsername
-
Return the server username of the current connection.
- setUsername
-
Create a new connection with the provided server username, or throw an exception on failure.
- database
-
Set or get the current database use by the connection.
If no argument is provided, it returns the current database.
If one argument is provided, it set the provided database as the current database used by the connection. -
- return
- string
- Server name
- getDatabase
-
Return the current database use by the connection.
- setDatabase
-
Set the provided database as the current database used by the connection.
- encoding
-
Set or get the current encoding use by the connection.
If no argument is provided, it returns the current encoding.
If one argument is provided, it set the provided encoding as the current encoding used by the connection. -
- return
- string
- Server name
- getEncoding
-
Return the current encoding use by the connection.
- setEncoding
-
Set the provided encoding as the current encoding used by the connection.