. session_is_registered(), session_register() and session_unregister()
functions. (Kalle)
. y2k_compliance ini option. (Kalle)
-
+
+- Fixed PDO objects binary incompatibility. (Dmitry)
+
?? ??? 20??, PHP 5.3.3
- Upgraded bundled PCRE to version 8.01. (Ilia)
memcpy((char *)pdbh->persistent_id, hashkey, plen+1);
pdbh->persistent_id_len = plen+1;
pdbh->refcount = 1;
- pdbh->properties = NULL;
+ pdbh->std.properties = NULL;
}
}
if (pdbh) {
/* let's copy the emalloc bits over from the other handle */
- if (pdbh->properties) {
- zend_hash_destroy(dbh->properties);
- efree(dbh->properties);
+ if (pdbh->std.properties) {
+ zend_hash_destroy(dbh->std.properties);
+ efree(dbh->std.properties);
} else {
- pdbh->ce = dbh->ce;
+ pdbh->std.ce = dbh->std.ce;
pdbh->def_stmt_ce = dbh->def_stmt_ce;
pdbh->def_stmt_ctor_args = dbh->def_stmt_ctor_args;
- pdbh->properties = dbh->properties;
+ pdbh->std.properties = dbh->std.properties;
}
/* kill the non-persistent thingamy */
efree(dbh);
ifunc->type = ZEND_INTERNAL_FUNCTION;
ifunc->handler = funcs->handler;
ifunc->function_name = (char*)funcs->fname;
- ifunc->scope = dbh->ce;
+ ifunc->scope = dbh->std.ce;
ifunc->prototype = NULL;
if (funcs->arg_info) {
ifunc->arg_info = (zend_arg_info*)funcs->arg_info + 1;
dbh->methods->rollback(dbh TSRMLS_CC);
dbh->in_txn = 0;
}
-
- if (dbh->properties) {
- zend_hash_destroy(dbh->properties);
- efree(dbh->properties);
- dbh->properties = NULL;
- }
if (dbh->is_persistent && dbh->methods && dbh->methods->persistent_shutdown) {
dbh->methods->persistent_shutdown(dbh TSRMLS_CC);
}
+ zend_object_std_dtor(&dbh->std TSRMLS_CC);
+ dbh->std.properties = NULL;
dbh_free(dbh TSRMLS_CC);
}
dbh = emalloc(sizeof(*dbh));
memset(dbh, 0, sizeof(*dbh));
- dbh->ce = ce;
+ zend_object_std_init(&dbh->std, ce TSRMLS_CC);
+ zend_hash_copy(dbh->std.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
dbh->refcount = 1;
- ALLOC_HASHTABLE(dbh->properties);
- zend_hash_init(dbh->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_copy(dbh->properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
dbh->def_stmt_ce = pdo_dbstmt_ce;
retval.handle = zend_objects_store_put(dbh, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbh_free_storage, NULL TSRMLS_CC);
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
stmt = ecalloc(1, sizeof(*stmt));
- stmt->ce = Z_OBJCE_P(zobject);
+ zend_object_std_init(&stmt->std, Z_OBJCE_P(zobject) TSRMLS_CC);
+ zend_hash_copy(stmt->std.properties, &stmt->std.ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
stmt->refcount = 1;
- ALLOC_HASHTABLE(stmt->properties);
- zend_hash_init(stmt->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_copy(stmt->properties, &stmt->ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
old_stmt = (pdo_stmt_t *)zend_object_store_get_object(zobject TSRMLS_CC);
static void free_statement(pdo_stmt_t *stmt TSRMLS_DC)
{
- if (stmt->properties) {
- zend_hash_destroy(stmt->properties);
- efree(stmt->properties);
- stmt->properties = NULL;
- }
-
if (stmt->bound_params) {
zend_hash_destroy(stmt->bound_params);
FREE_HASHTABLE(stmt->bound_params);
if (stmt->dbh) {
php_pdo_dbh_delref(stmt->dbh TSRMLS_CC);
}
+ zend_object_std_dtor(&stmt->std TSRMLS_CC);
efree(stmt);
}
pdo_stmt_t *stmt;
stmt = emalloc(sizeof(*stmt));
memset(stmt, 0, sizeof(*stmt));
- stmt->ce = ce;
+ zend_object_std_init(&stmt->std, ce TSRMLS_CC);
+ zend_hash_copy(stmt->std.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
stmt->refcount = 1;
- ALLOC_HASHTABLE(stmt->properties);
- zend_hash_init(stmt->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_copy(stmt->properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
retval.handle = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbstmt_free_storage, (zend_objects_store_clone_t)dbstmt_clone_obj TSRMLS_CC);
retval.handlers = &pdo_dbstmt_object_handlers;
MAKE_STD_ZVAL(val);
fetch_value(stmt, val, i, NULL TSRMLS_CC);
- zend_hash_update(stmt->properties, stmt->columns[i].name, stmt->columns[i].namelen + 1, (void *)&val, sizeof(zval *), NULL);
+ zend_hash_update(stmt->std.properties, stmt->columns[i].name, stmt->columns[i].namelen + 1, (void *)&val, sizeof(zval *), NULL);
}
- return stmt->properties;
+ return stmt->std.properties;
}
static union _zend_function *row_method_get(
to allow the extending class to escape all the custom handlers
that PDO declares.
*/
- zend_class_entry *ce;
- HashTable *properties;
- unsigned int in_get:1;
- unsigned int in_set:1;
+ zend_object std;
/* driver specific methods */
struct pdo_dbh_methods *methods;
to allow the extending class to escape all the custom handlers
that PDO declares.
*/
- zend_class_entry *ce;
- HashTable *properties;
- unsigned int in_get:1;
- unsigned int in_set:1;
+ zend_object std;
/* driver specifics */
struct pdo_stmt_methods *methods;