Web Gear is a free, lightweight open source web development platform written in PHP, aimed at developing fast web applications, based on a well defined MVC structure.

Database

Factory

The DB_Factory class allows you to create a new database library (or connector, as referenced sometimes) object instance. It only creates an object, which it returns to you for manipulation.

You can feed it the name of the connector you'd wish to take control of (always spawns a new instance), by default (and only) being "mysql". It must be the suffix of the connector's file name (which it also is a part of the connector's class name declaration). The database connectors are located into the includes/libraries/Database/connectors/ directory. Always.

After calling

DB_Factory::getInstance([string name = 'mysql'])

you must explicitly set the connector's parameters in order to successfully establish a connection to your database. Check the next pages for reference.