cDBConnection
The Database connection is responsible for binding the settings defined in the preferences to the database components of the form. In the preferences, a basic setup to a database is made. These settings define the type of database (any PDO supporting database), user id, password, instance, and more. These settings are copied into the properties of the database component and locally stored.
This will not apply for production situations where the database credentials can differ from development. As database settings stored readable in a config file is considered to be unsafe, PHsPeed provides a way of storing the data encrypted. It is up to the designer to deploy a config application (users need to log in and supply connection data), or generate the encrypted config file locally and deploy that one.
Properties
|
Description |
autoconfig |
Setting this property to true will cause the component to search for the config file when the applications start |
autoconnect |
Setting this property will immediately open the database when the application starts. Otherwise, the database will be opened on first access |
charset |
UTF8 (standard) or iso8859-1. This settings is initially copied when dbconnection is set. |
database |
Name of the database in a database instance. |
dbconnection |
Selector of the predefined database connections. Setting this will copy some of the settings into this component. |
dbdateformat |
Format of the data in the database This settings is initially copied when dbconnection is set. |
odbcdriver |
Reference to the installed odbc drivers (only applicable to databases that require an odbc / ado driver |
password |
Database password (This settings is initially copied when dbconnection is set.) |
pdo |
PDO reference. This settings is initially copied when dbconnection is set. It is a placeholder for a pdo string to connect to the pdo database |
persistent |
Sets persistent database connection for ODBC database. Under normal situations this setting is done in the ODBC driver, but not all drivers support this setting. |
port |
Port to connect to the database (3306 for mySQL, none for SQLite) |
server |
Ip of the database server if required |
userid |
UserId for the database. |
PHP Events
|
Description |
onAfterConnect |
Triggers when the connection is active |
OnAfterDisconnect |
Triggers when the connection is dropped |
onBeforeConnect |
Triggers just before connecting |
onBeforeDisconnect |
Triggers before disconnecting |
onConnectionError |
Triggers when a connect error takes place |
JavaScript Events
No additional events.