44
44
45
45
PHONGO_API zend_class_entry * php_phongo_timestamp_ce ;
46
46
47
+ zend_object_handlers php_phongo_handler_timestamp ;
48
+
47
49
/* {{{ proto BSON\Timestamp Timestamp::__construct(integer $increment, int $timestamp)
48
50
Construct a new BSON Timestamp (4bytes increment, 4bytes timestamp) */
49
51
PHP_METHOD (Timestamp , __construct )
@@ -129,10 +131,27 @@ zend_object_value php_phongo_timestamp_create_object(zend_class_entry *class_typ
129
131
object_properties_init (& intern -> std , class_type );
130
132
131
133
retval .handle = zend_objects_store_put (intern , (zend_objects_store_dtor_t ) zend_objects_destroy_object , php_phongo_timestamp_free_object , NULL TSRMLS_CC );
132
- retval .handlers = phongo_get_std_object_handlers () ;
134
+ retval .handlers = & php_phongo_handler_timestamp ;
133
135
134
136
return retval ;
135
137
} /* }}} */
138
+
139
+ HashTable * php_phongo_timestamp_get_debug_info (zval * object , int * is_temp TSRMLS_DC ) /* {{{ */
140
+ {
141
+ php_phongo_timestamp_t * intern ;
142
+ zval retval = zval_used_for_init ;
143
+
144
+
145
+ * is_temp = 1 ;
146
+ intern = (php_phongo_timestamp_t * )zend_object_store_get_object (object TSRMLS_CC );
147
+
148
+ array_init (& retval );
149
+
150
+ add_assoc_long_ex (& retval , ZEND_STRS ("increment" ), intern -> increment );
151
+ add_assoc_long_ex (& retval , ZEND_STRS ("timestamp" ), intern -> timestamp );
152
+
153
+ return Z_ARRVAL (retval );
154
+ } /* }}} */
136
155
/* }}} */
137
156
138
157
/* {{{ PHP_MINIT_FUNCTION */
@@ -147,6 +166,9 @@ PHP_MINIT_FUNCTION(Timestamp)
147
166
148
167
zend_class_implements (php_phongo_timestamp_ce TSRMLS_CC , 1 , php_phongo_type_ce );
149
168
169
+ memcpy (& php_phongo_handler_timestamp , phongo_get_std_object_handlers (), sizeof (zend_object_handlers ));
170
+ php_phongo_handler_timestamp .get_debug_info = php_phongo_timestamp_get_debug_info ;
171
+
150
172
151
173
return SUCCESS ;
152
174
}
0 commit comments