Просмотр исходного кода

Throw warning in MongoCursor::timeout()

Andreas Braun 9 лет назад
Родитель
Сommit
a589134bfb
2 измененных файлов с 5 добавлено и 1 удалено
  1. 3 0
      README.md
  2. 2 1
      lib/Alcaeus/MongoDbAdapter/AbstractCursor.php

+ 3 - 0
README.md

@@ -125,6 +125,9 @@ unserializing them.
  authentication information.
  - The [setFlag](https://php.net/manual/en/mongocursor.setflag.php)
  method is not yet implemented.
+ - The [timeout](https://php.net/manual/en/mongocursor.timeout.php) method will
+ not change any query options. Client-side timeouts are no longer supported by
+ the new driver. Use the maxTimeMS setting as a replacement.
 
 ## MongoCommandCursor
  - The [createFromDocument](https://php.net/manual/en/mongocommandcursor.createfromdocument.php)

+ 2 - 1
lib/Alcaeus/MongoDbAdapter/AbstractCursor.php

@@ -246,7 +246,8 @@ abstract class AbstractCursor
      */
     public function timeout($ms)
     {
-        $this->notImplemented();
+        trigger_error('The ' . __METHOD__ . ' method is not implemented in mongo-php-adapter', E_USER_WARNING);
+        return $this;
     }
 
     /**