CakePHP 1.3 and Firebird

After searching the internet for a decent walk through or tutorial, I came up with very little and so I decided to collate what have learned in this post with the hope that someone else can benefit from it.

Firstly you will need to obtain the datasources plugin from github and stick it in your application’s plugin folder (app/plugins) – make sure you get the master branch and not the 2.0 as it needs to be compatible with your version of CakePHP (1.3 ideally)

The next thing you need to do is edit the databases config file (app/config/database.php):

var $defaultarray(
        'driver' => 'Datasources.DboFirebird'//references the datasources plugin
        'persistent' => false,
        'host' => 'localhost'//the host name of your database
        'login' => 'sysdba',
        'password' => 'masterkey',
        'database' => 'C:\\path\\to\\database.gdb'//path to the database - note the double backslashes
        'prefix' => '',
        //'encoding' => 'utf8',
    );

The two important things you should note of is the driver key-value pair which references the datasource plugin namespace, and secondly the double backslashes for the database file path.

All the models you create for your application should now access the corresponding tables through the FireBird SQL connection.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

One comment

  • hi, i followed your post but as i am using a table with a prefix
    i’m havig this notice

    Notice (8): Undefined index: tglclient [APP/plugins/datasources/models/datasources/dbo/dbo_firebird.php, line 514]

    and nothing works… any ideas how to solve this?

Leave a Reply