<email>mike@php.net</email>
<active>yes</active>
</lead>
- <date>2013-03-22</date>
+ <date>2013-04-13</date>
<version>
- <release>0.1.0</release>
+ <release>0.2.0dev</release>
<api>0.1.0</api>
</version>
<stability>
</stability>
<license>BSD, revised</license>
<notes><![CDATA[
-* Initial release
+* Implemented get_properties() object handler.
]]></notes>
<contents>
<dir name="/">
#ifndef PHP_PQ_H
#define PHP_PQ_H
-#define PHP_PQ_EXT_VERSION "0.1.0"
+#define PHP_PQ_EXT_VERSION "0.2.0dev"
int pq_module_number;
zend_module_entry pq_module_entry;
if (addref) {
Z_ADDREF_P(property);
}
- zend_hash_add(ht, pi->name, pi->name_length + 1, (void *) &property, sizeof(zval *), NULL);
+ zend_hash_update(ht, pi->name, pi->name_length + 1, (void *) &property, sizeof(zval *), NULL);
return ZEND_HASH_APPLY_KEEP;
}
return ht;
}
+HashTable *php_pq_object_properties(zval *object TSRMLS_DC)
+{
+ HashTable *ht = zend_get_std_object_handlers()->get_properties(object TSRMLS_CC);
+ php_pq_object_t *obj = zend_object_store_get_object(object TSRMLS_CC);
+
+ zend_hash_apply_with_arguments(&obj->zo.ce->properties_info TSRMLS_CC, apply_pi_to_ht, 4, ht, object, obj, 1);
+
+ return ht;
+}
+
zend_class_entry *ancestor(zend_class_entry *ce)
{
while (ce->parent) {
void php_pq_object_addref(void *o TSRMLS_DC);
void php_pq_object_delref(void *o TSRMLS_DC);
HashTable *php_pq_object_debug_info(zval *object, int *temp TSRMLS_DC);
+HashTable *php_pq_object_properties(zval *object TSRMLS_DC);
zend_class_entry *ancestor(zend_class_entry *ce);
zval *php_pq_object_read_prop(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
void php_pq_object_write_prop(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
php_pqcancel_object_handlers.write_property = php_pq_object_write_prop;
php_pqcancel_object_handlers.clone_obj = NULL;
php_pqcancel_object_handlers.get_property_ptr_ptr = NULL;
+ php_pqcancel_object_handlers.get_properties = php_pq_object_properties;
php_pqcancel_object_handlers.get_debug_info = php_pq_object_debug_info;
zend_hash_init(&php_pqcancel_object_prophandlers, 1, NULL, NULL, 1);
php_pqconn_object_handlers.write_property = php_pq_object_write_prop;
php_pqconn_object_handlers.clone_obj = NULL;
php_pqconn_object_handlers.get_property_ptr_ptr = NULL;
+ php_pqconn_object_handlers.get_properties = php_pq_object_properties;
php_pqconn_object_handlers.get_debug_info = php_pq_object_debug_info;
zend_hash_init(&php_pqconn_object_prophandlers, 14, NULL, NULL, 1);
php_pqcopy_object_handlers.write_property = php_pq_object_write_prop;
php_pqcopy_object_handlers.clone_obj = NULL;
php_pqcopy_object_handlers.get_property_ptr_ptr = NULL;
+ php_pqcopy_object_handlers.get_properties = php_pq_object_properties;
php_pqcopy_object_handlers.get_debug_info = php_pq_object_debug_info;
zend_hash_init(&php_pqcopy_object_prophandlers, 4, NULL, NULL, 1);
php_pqlob_object_handlers.write_property = php_pq_object_write_prop;
php_pqlob_object_handlers.clone_obj = NULL;
php_pqlob_object_handlers.get_property_ptr_ptr = NULL;
+ php_pqlob_object_handlers.get_properties = php_pq_object_properties;
php_pqlob_object_handlers.get_debug_info = php_pq_object_debug_info;
zend_hash_init(&php_pqlob_object_prophandlers, 3, NULL, NULL, 1);
php_pqres_object_handlers.clone_obj = NULL;
php_pqres_object_handlers.get_property_ptr_ptr = NULL;
php_pqres_object_handlers.get_debug_info = php_pq_object_debug_info;
+ php_pqres_object_handlers.get_properties = php_pq_object_properties;
php_pqres_object_handlers.count_elements = php_pqres_count_elements;
zend_hash_init(&php_pqres_object_prophandlers, 6, NULL, NULL, 1);
php_pqstm_object_handlers.write_property = php_pq_object_write_prop;
php_pqstm_object_handlers.clone_obj = NULL;
php_pqstm_object_handlers.get_property_ptr_ptr = NULL;
+ php_pqstm_object_handlers.get_properties = php_pq_object_properties;
php_pqstm_object_handlers.get_debug_info = php_pq_object_debug_info;
zend_hash_init(&php_pqstm_object_prophandlers, 2, NULL, NULL, 1);
php_pqtxn_object_handlers.write_property = php_pq_object_write_prop;
php_pqtxn_object_handlers.clone_obj = NULL;
php_pqtxn_object_handlers.get_property_ptr_ptr = NULL;
+ php_pqtxn_object_handlers.get_properties = php_pq_object_properties;
php_pqtxn_object_handlers.get_debug_info = php_pq_object_debug_info;
zend_hash_init(&php_pqtxn_object_prophandlers, 4, NULL, NULL, 1);
php_pqtypes_object_handlers.write_property = php_pq_object_write_prop;
php_pqtypes_object_handlers.clone_obj = NULL;
php_pqtypes_object_handlers.get_property_ptr_ptr = NULL;
+ php_pqtypes_object_handlers.get_properties = php_pq_object_properties;
php_pqtypes_object_handlers.get_debug_info = php_pq_object_debug_info;
php_pqtypes_object_handlers.has_dimension = php_pqtypes_object_has_dimension;
php_pqtypes_object_handlers.read_dimension = php_pqtypes_object_read_dimension;