Closed
Description
Hi Jens,
In our application (Laravel4) use two connections to Postgres databases and MongoDB.
Using PHP 5.3 we had no problems, but using PHP 5.4.9 have a problem with the instance of the connection to the DB you are getting 'jenssegers/mongodb/src/Jenssegers/Mongodb/Model.php'. I do not understand why it is that you are getting the connection to the Postgres database in 5.4 but work in 5.3.
We tested the PHP Mongo client 5.4 on a standalone application and it works.
The exception is:
{"error""type":"ErrorException","message":"Argument 1 passed to Jenssegers\\Mongodb\\Builder::__construct() must be an instance of Jenssegers\\Mongodb\\Connection, instance of Illuminate\\Database\\PostgresConnection given, called in /vendor\/jenssegers\/mongodb\/src\/Jenssegers\/Mongodb\/Model.php on line 186 and defined","file":"/vendor\/jenssegers\/mongodb\/src\/Jenssegers\/Mongodb\/Builder.php","line":37}}
In my case I have defined:
Provider:
'Jenssegers\Mongodb\MongodbServiceProvider'
Alias of the Laravel Eloquent Model:
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
Example of a Jenssegers model:
use Jenssegers\Mongodb\Model as Eloquent;
MongoData class extends Eloquent {
protected $ collection = 'data';
}
And finally,
The connections to the DB:
'default' => 'pgsql'
'mongodb' => array (
'driver' => 'mongodb',
'host' => 'localhost',
'port' => 27017,
'username' => 'user',
'password' => 'password',
'database' => 'database'
)
'pgsql' => array (
'driver' => 'pgsql',
'host' => 'localhost',
'port' => 5432,
'database' => 'database',
'username' => 'user',
'password' => 'password',
'charset' => 'utf8',
'prefix' =>'',
'schema' => 'public',
)
Metadata
Metadata
Assignees
Labels
No labels