If you have MongoClient class available and use persist option you will have a bad time and get a MongoConnectionException
For example if you have:
<?php
$options = array(
'replicaSet' => false,
'persist' => false,
'connect' => false
);
return new \Mongo('mongodb://...', $options);
?>
This will not work if you have the mongo client class a better way to handle this if your not sure what is on the server this code is running on is the following:
<?php
$options = array(
'replicaSet' => false,
'connect' => false
);
if(!class_exists('MongoClient')){
$options['persist'] = false;
}
return new \Mongo('mongodb:/...', $options);
?>
This will only add it in the case where MongoClient doesn't exist and it needs it. Hope this saves anyone some heart ache.