Eustáquio Rangel edited this page Aug 3, 2017 · 7 revisions

How install and configure

Next: Models

Using include

Just include the torm.php file. All the other files TORM needs to work are there.

Using composer

Change (or create, if needed) your Composer file to include TORM:

    "require": {
        "taq/torm": ">=1.0"

Then you're ready to access all the TORM classes:

require __DIR__ . '/vendor/autoload.php';                                                                                                                                                 
var_dump(new TORM\Model());                                                                                                                                                               


We need PDO to use TORM. Take a look on the PHP official docs about it, to make it work.

Supported databases

Take a look on the drivers directory, all the supported databases are there.

Configure your environment

We can use 3 environments to store our connections and drivers: development, test and production. We can set the correct environment on some ways:

  1. Sending the environment name after the PDO connection object: TORM\Connection::setConnection($con,"test");
  2. Using an environment variable: TORM_ENV;
  3. Or, with Apache, to select the current enviroment, for example, to production, on an Apache server with .htaccess allowed, insert into the .htaccess file: SetEnv TORM_ENV production

Specify connection and environment

Like this:


Next: Models

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.