44
44
45
45
PHONGO_API zend_class_entry * php_phongo_binary_ce ;
46
46
47
+ zend_object_handlers php_phongo_handler_binary ;
48
+
47
49
/* {{{ proto BSON\Binary Binary::__construct(string $data, int $subtype)
48
50
Construct a new BSON Binary type */
49
51
PHP_METHOD (Binary , __construct )
@@ -152,10 +154,25 @@ zend_object_value php_phongo_binary_create_object(zend_class_entry *class_type T
152
154
object_properties_init (& intern -> std , class_type );
153
155
154
156
retval .handle = zend_objects_store_put (intern , (zend_objects_store_dtor_t ) zend_objects_destroy_object , php_phongo_binary_free_object , NULL TSRMLS_CC );
155
- retval .handlers = phongo_get_std_object_handlers () ;
157
+ retval .handlers = & php_phongo_handler_binary ;
156
158
157
159
return retval ;
158
160
} /* }}} */
161
+
162
+ HashTable * php_phongo_binary_get_debug_info (zval * object , int * is_temp TSRMLS_DC ) /* {{{ */
163
+ {
164
+ php_phongo_binary_t * intern ;
165
+ zval retval = zval_used_for_init ;
166
+
167
+ intern = (php_phongo_binary_t * )zend_object_store_get_object (object TSRMLS_CC );
168
+ * is_temp = 1 ;
169
+ array_init_size (& retval , 2 );
170
+
171
+ add_assoc_stringl_ex (& retval , ZEND_STRS ("data" ), intern -> data , intern -> data_len , 1 );
172
+ add_assoc_long_ex (& retval , ZEND_STRS ("subtype" ), intern -> subtype );
173
+
174
+ return Z_ARRVAL (retval );
175
+ } /* }}} */
159
176
/* }}} */
160
177
161
178
/* {{{ PHP_MINIT_FUNCTION */
@@ -170,6 +187,9 @@ PHP_MINIT_FUNCTION(Binary)
170
187
171
188
zend_class_implements (php_phongo_binary_ce TSRMLS_CC , 1 , php_phongo_type_ce );
172
189
190
+ memcpy (& php_phongo_handler_binary , phongo_get_std_object_handlers (), sizeof (zend_object_handlers ));
191
+ php_phongo_handler_binary .get_debug_info = php_phongo_binary_get_debug_info ;
192
+
173
193
zend_declare_class_constant_long (php_phongo_binary_ce , ZEND_STRL ("TYPE_GENERIC" ), BSON_SUBTYPE_BINARY TSRMLS_CC );
174
194
zend_declare_class_constant_long (php_phongo_binary_ce , ZEND_STRL ("TYPE_FUNCTION" ), BSON_SUBTYPE_FUNCTION TSRMLS_CC );
175
195
zend_declare_class_constant_long (php_phongo_binary_ce , ZEND_STRL ("TYPE_OLD_BINARY" ), BSON_SUBTYPE_BINARY_DEPRECATED TSRMLS_CC );
0 commit comments