mongoDB-Datasource
mongoDB-Datasource copied to clipboard
This plugin is not working with Cakephp 2.1.0 Stable
I followed every instruction methodically, and I keep getting this error:
Error: Datasource class mongodb.mongodbSource could not be found.
I thought it had to do with the naming conventions on folders. I tried renaming each folder to Uppercase the first letter but it didn't work.
The path to the model needs to be updated to Model/Datasource/MongodbSource.php. This fixed the issue for me. Other paths may need to be updated, as well.
Yep, you have to update your paths described by @mikeradvak:
YourApp/app/Plugin/Mongodb/Model/Datasource/MongodbSource.php YourApp/app/Plugin/Mongodb/Model/Behavior/Schemaless.php YourApp/app/Plugin/Mongodb/Model/Behavior/SqlCompatible.php
From there you will have to update bootstrap.php:
CakePlugin::load('Mongodb');
Then in MongodbSource.php:
App::uses('DboSource', 'Model/Datasource');
This got me going on Cakephp 2. Hope that helps.
EDIT: Or you could just do this in your app/Plugin/Mongodb directory: 'git checkout -b cake2.0 origin/cake2.0'
Also, forked and updated to be 2.0 compatible: https://github.com/mikeradvak/mongoDB-Datasource
It would be good to update the readme for this fork (got me for a while)
Please include in README.markdown:
git clone -b cake2.0 git://github.com/ichikaway/cakephp-mongodb.git Mongodb
This whole thing should actually be re-written to use MongoClient rather than the Mongo object, as Mongo is being deprecated. I may fork and do this if I ever have time or find myself with the smarts to make the change!
http://www.php.net/manual/en/class.mongo.php
Can I say that this plugin is no longer being maintained for the latest changes of CakePHP and as @benirose mentioned, the new MongoClient class? Am having problems with naming conventions by following the installation instructions, and the last commit was 2 years ago.