note 110718 modified in class.mongoclient by derick
| From: | derick@php.net | Date: | Thu, 29 Nov 2012 12:56:36 +0000 |
| Subject: | note 110718 modified in class.mongoclient by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192193@lists.php.net to get a copy of this message | ||
Seeing as the Mongo class has been deprecated, I'm using the following code to allow
compatibility with the pre 1.3.0 driver successfully.
<?php
$class = 'MongoClient';
if(!class_exists($class)){
$class = 'Mongo';
}
$conn = new $class($hosts, $args);
?>
--was--
Seeing as the Mongo class has been deprecated, I'm using the following code to allow
compatibility with the pre 1.3.0 driver successfully.
<?php
$class = 'MongoClient';
if(!class_exists($class)){
$class = 'Mongo';
}
$conn = new $class($hosts), $args);
?>
http://php.net/manual/en/class.mongoclient.php