소스 검색

Work around syntax uniqueness in PHP 5.5

Andreas Braun 10 년 전
부모
커밋
c29d9bff97
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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);