Hi All,
I am having some issues understanding the naming conventions for a
custom datasource.
datasource file name: gti_api_source.php
class name GtiApiSource
Database Config
var $gti_api = array(
'driver' => 'gti_api',
'url' => 'http://swright-dev:1337/',
);
Model
public $useDbConfig = 'gti_api';
public $useTable = false;
This is giving me errors. I did a var dump in
ConnectionManager::loadDataSource to see what it was asking for. I get
this:
array
'filename' => string 'dbo/dbo_gti_api' (length=15)
'classname' => string 'DboGtiApi' (length=9)
'parent' =>
array
'filename' => string 'dbo_source' (length=10)
'classname' => string 'DboSource' (length=9)
'parent' => null
'plugin' => null
'plugin' => null
array
'filename' => string 'dbo_source' (length=10)
'classname' => string 'DboSource' (length=9)
'parent' => null
'plugin' => null
Fatal Error (256): ConnectionManager::loadDataSource - Unable to
import DataSource class .DboGtiApi [CORE/cake/libs/model/
connection_manager.php, line 185
I believe the problem is that I am defining a driver so the connection
tacks on the Dbo string to my class names and then looks for a driver.
This does not exist so it dies. I removed the driver definition from
the database def:
var $gti_api = array(
'url' => 'http://swright-dev:1337/',
);
And now I get this error:
array
'filename' => string 'dbo_source' (length=10)
'classname' => string 'DboSource' (length=9)
'parent' => null
'plugin' => null
( ! ) Fatal error: Call to undefined method DboSource::connect() in /
var/www/html/_libraries/cake_1_3/cake/libs/model/datasources/
dbo_source.php on line 143
So its still apparently wrong. The examples on the Cake site
http://book.cakephp.org/view/1077/An-Example dont really speak to
this.
Does anyone know where I am going wrong?
Thanks
Steve
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php