My MongoDB datasource is located in plugins/mongodb.
According to the new class loader in 2.0 I should do this:
App::uses('MongodbSource', 'Mongodb.Model/Datasource');
But how do I initiate it?
Or is it best practice to use the ConnectionManager? If so, how do I import it?
If you WANT to use your way and loading this datasource “by hand” and not like Matt said, you would initiate it like this:
Within your file where you load it you can do this:
But as said, the databsae configuration would be the better way:
Now you just have so add
CakePlugin::load('Mongodb');to yourbootstrap.phpso your plugin will be loaded.