Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix PHP-597 (Remove undocumented and disabled by default INI option)

  • Loading branch information...
commit fa984c2275a2c11779398620ceed72fe80d518cb 1 parent 9c0135b
@bjori bjori authored derickr committed
Showing with 10 additions and 20 deletions.
  1. +10 −18 mongo_types.c
  2. +0 −1  php_mongo.c
  3. +0 −1  php_mongo.h
View
28 mongo_types.c
@@ -202,9 +202,7 @@ void mongo_init_MongoId(TSRMLS_D) {
mongo_ce_Id = zend_register_internal_class(&id TSRMLS_CC);
- if (!MonGlo(no_id)) {
- zend_declare_property_null(mongo_ce_Id, "$id", strlen("$id"), ZEND_ACC_PUBLIC TSRMLS_CC);
- }
+ zend_declare_property_null(mongo_ce_Id, "$id", strlen("$id"), ZEND_ACC_PUBLIC TSRMLS_CC);
}
/* {{{ MongoId::__construct()
@@ -238,9 +236,7 @@ PHP_METHOD(MongoId, __construct) {
this_id->id[i] = digit1*16+digit2;
}
- if (!MonGlo(no_id)) {
- zend_update_property(mongo_ce_Id, getThis(), "$id", strlen("$id"), id TSRMLS_CC);
- }
+ zend_update_property(mongo_ce_Id, getThis(), "$id", strlen("$id"), id TSRMLS_CC);
}
else if (id &&
Z_TYPE_P(id) == IS_OBJECT &&
@@ -248,22 +244,18 @@ PHP_METHOD(MongoId, __construct) {
mongo_id *that_id = (mongo_id*)zend_object_store_get_object(id TSRMLS_CC);
memcpy(this_id->id, that_id->id, OID_SIZE);
- if (!MonGlo(no_id)) {
- zval *str = zend_read_property(mongo_ce_Id, id, "$id", strlen("$id"), NOISY TSRMLS_CC);
- zend_update_property(mongo_ce_Id, getThis(), "$id", strlen("$id"), str TSRMLS_CC);
- }
+ zval *str = zend_read_property(mongo_ce_Id, id, "$id", strlen("$id"), NOISY TSRMLS_CC);
+ zend_update_property(mongo_ce_Id, getThis(), "$id", strlen("$id"), str TSRMLS_CC);
}
else {
- generate_id(this_id->id TSRMLS_CC);
+ generate_id(this_id->id TSRMLS_CC);
- if (!MonGlo(no_id)) {
- MAKE_STD_ZVAL(str);
- ZVAL_NULL(str);
+ MAKE_STD_ZVAL(str);
+ ZVAL_NULL(str);
- MONGO_METHOD(MongoId, __toString, str, getThis());
- zend_update_property(mongo_ce_Id, getThis(), "$id", strlen("$id"), str TSRMLS_CC);
- zval_ptr_dtor(&str);
- }
+ MONGO_METHOD(MongoId, __toString, str, getThis());
+ zend_update_property(mongo_ce_Id, getThis(), "$id", strlen("$id"), str TSRMLS_CC);
+ zval_ptr_dtor(&str);
}
}
/* }}} */
View
1  php_mongo.c
@@ -126,7 +126,6 @@ STD_PHP_INI_ENTRY("mongo.utf8", "1", PHP_INI_ALL, OnUpdateLong, utf8, zend_mongo
STD_PHP_INI_ENTRY("mongo.native_long", "0", PHP_INI_ALL, OnUpdateLong, native_long, zend_mongo_globals, mongo_globals)
STD_PHP_INI_ENTRY("mongo.long_as_object", "0", PHP_INI_ALL, OnUpdateLong, long_as_object, zend_mongo_globals, mongo_globals)
STD_PHP_INI_ENTRY("mongo.allow_empty_keys", "0", PHP_INI_ALL, OnUpdateLong, allow_empty_keys, zend_mongo_globals, mongo_globals)
-STD_PHP_INI_ENTRY("mongo.no_id", "0", PHP_INI_SYSTEM, OnUpdateLong, no_id, zend_mongo_globals, mongo_globals)
PHP_INI_ENTRY("mongo.ping_interval", NULL, PHP_INI_ALL, OnUpdatePingInterval)
PHP_INI_ENTRY("mongo.is_master_interval", NULL, PHP_INI_ALL, OnUpdateIsMasterInterval)
View
1  php_mongo.h
@@ -573,7 +573,6 @@ int utf8;
int native_long;
int long_as_object;
int allow_empty_keys;
-int no_id;
// _id generation helpers
int inc, pid, machine;
Please sign in to comment.
Something went wrong with that request. Please try again.