2
votes

I developed a site with CakePHP version 1.2.5 and everything worked fine by then. But now, I'm trying to re-implement my site with CakePHP version 2.2.1.

But the connection to the database (firebird) is not working anymore.

Here is my cake/app/Config/database.php file:

class DATABASE_CONFIG {

var $default = array(
    'driver' => 'firebird',
    'persistent' => false,
    'host' => 'localhost',
    'login' => 'SYSDBA',
    'password' => 'masterkey',
    'database' => 'd:\\IBDatabase\\DATA.GDB',
    'port' => '3050',
    'connect' => 'ibase_connect'
);

var $test = array(
    'driver' => 'firebird',
    'persistent' => false,
    'host' => 'localhost',
    'login' => 'SYSDBA',
    'password' => 'masterkey',
    'database' => 'd:\\IBDatabase\\DATA.GDB',
    'prefix' => '',
);
}

And here is the error I'm getting:

Missing Datasource
Error: Datasource class could not be found.

Notice: If you want to customize this error message, create app\View\Errors\missing_datasource.ctp

Stack Trace
CORE\Cake\Model\ConnectionManager.php line 97 → ConnectionManager::loadDataSource(string)
CORE\Cake\Model\Model.php line 3158 → ConnectionManager::getDataSource(string)
CORE\Cake\Model\Model.php line 1092Model->setDataSource(string)
CORE\Cake\Model\Model.php line 3180Model->setSource(string)
CORE\Cake\Model\Model.php line 1301Model->getDataSource()
CORE\Cake\Model\Model.php line 1389Model->schema()
CORE\Cake\Controller\Component\PaginatorComponent.php line 354Model->hasField(string)
CORE\Cake\Controller\Component\PaginatorComponent.php line 125 → PaginatorComponent->validateSort(Professionals, array, array)
CORE\Cake\Controller\Controller.php line 1082 → PaginatorComponent->paginate(null, array, array)
APP\Controller\ProfessionalsController.php line 12 → Controller->paginate()
[internal function] → ProfessionalsController->index()
CORE\Cake\Controller\Controller.php line 485 → ReflectionMethod->invokeArgs(ProfessionalsController, array)
CORE\Cake\Routing\Dispatcher.php line 186 → Controller->invokeAction(CakeRequest)
CORE\Cake\Routing\Dispatcher.php line 161 → Dispatcher->_invoke(ProfessionalsController, CakeRequest, CakeResponse)
APP\webroot\index.php line 92 → Dispatcher->dispatch(CakeRequest, CakeResponse)

Does anyone know what I should do? Thanks!!

1
Grab the datasource from github.com/cakephp/datasourcestigrang
Also your database.php config keys need to be changed, read the migration guideCeeram

1 Answers

1
votes

After a lot of research, I've found that Cake 2.x is not compatible with firebird.