Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed PHP-804: Deprecate Mongo::connectUtil. #436

Closed
wants to merge 1 commit into from

2 participants

@derickr
Owner

No description provided.

@bjori
Owner

According to 7990091 the ctor is supposed to be deprecated too

@derickr
Owner

Right, good to catch that really important deprecation! It's unrelated to this issue and PR though. I've created PHP-818 and #443 instead to deal with it.

@bjori
Owner

LGTM

@derickr derickr referenced this pull request from a commit
@derickr derickr Merged pull request #436 ad20555
@derickr derickr closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 8, 2013
  1. @derickr
This page is out of date. Refresh to see the latest.
Showing with 24 additions and 1 deletion.
  1. +1 −1  mongo.c
  2. +23 −0 tests/generic/bug00804.phpt
View
2  mongo.c
@@ -50,7 +50,7 @@ static zend_function_entry mongo_methods[] = {
PHP_ME(Mongo, __construct, arginfo___construct, ZEND_ACC_PUBLIC)
/* All these methods only exist in Mongo, and no longer in MongoClient */
- PHP_ME(Mongo, connectUtil, arginfo_no_parameters, ZEND_ACC_PROTECTED)
+ PHP_ME(Mongo, connectUtil, arginfo_no_parameters, ZEND_ACC_PROTECTED|ZEND_ACC_DEPRECATED)
PHP_ME(Mongo, getSlaveOkay, arginfo_no_parameters, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
PHP_ME(Mongo, setSlaveOkay, arginfo_setSlaveOkay, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
PHP_ME(Mongo, lastError, arginfo_no_parameters, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
View
23 tests/generic/bug00804.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Test for PHP-804: Deprecate Mongo::connectUtil.
+--SKIPIF--
+<?php require "tests/utils/standalone.inc";?>
+--FILE--
+<?php
+require_once "tests/utils/server.inc";
+
+class MyMongo extends Mongo
+{
+ public function connectUtil()
+ {
+ return parent::connectUtil();
+ }
+}
+
+$dsn = MongoShellServer::getStandaloneInfo();
+
+$m = new MyMongo($dsn);
+$m->connectUtil();
+?>
+--EXPECTF--
+%s: Function Mongo::connectUtil() is deprecated in %sbug00804.php on line %d
Something went wrong with that request. Please try again.