Bläddra i källkod

Work around syntax uniqueness in PHP 5.5

Andreas Braun 10 år sedan
förälder
incheckning
c29d9bff97
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      lib/Mongo/MongoClient.php

+ 5 - 1
lib/Mongo/MongoClient.php

@@ -66,8 +66,12 @@ class MongoClient
      * @param array $driverOptions An array of options for the MongoDB driver.
      * @throws MongoConnectionException
      */
-    public function __construct($server = 'mongodb://' . self::DEFAULT_HOST . ':' . self::DEFAULT_PORT, array $options = ["connect" => true], array $driverOptions = [])
+    public function __construct($server = 'default', array $options = ["connect" => true], array $driverOptions = [])
     {
+        if ($server === 'default') {
+            $server = 'mongodb://' . self::DEFAULT_HOST . ':' . self::DEFAULT_PORT;
+        }
+
         $this->server = $server;
         $this->client = new Client($server, $options, $driverOptions);