@@ -86,20 +86,25 @@ static void aggregate_methods(zend_class_entry *ce, zend_class_entry *from_ce, i
86
86
uint func_name_len ;
87
87
ulong num_key ;
88
88
zval * list_hash = NULL ;
89
+ #if HAVE_PCRE || HAVE_BUNDLED_PCRE
89
90
pcre * re = NULL ;
90
91
pcre_extra * re_extra = NULL ;
91
92
int re_options = 0 ;
93
+ #endif
92
94
93
95
/*
94
96
* Flip the array for easy lookup, or compile the regexp.
95
97
*/
96
98
if (aggr_type == AGGREGATE_BY_LIST ) {
97
99
list_hash = array_to_hash (aggr_filter );
98
- } else if (aggr_type == AGGREGATE_BY_REGEXP ) {
100
+ }
101
+ #if HAVE_PCRE || HAVE_BUNDLED_PCRE
102
+ else if (aggr_type == AGGREGATE_BY_REGEXP ) {
99
103
if ((re = pcre_get_compiled_regex (Z_STRVAL_P (aggr_filter ), & re_extra , & re_options )) == NULL ) {
100
104
return ;
101
105
}
102
106
}
107
+ #endif
103
108
104
109
/*
105
110
* "Just because it's not nice doesn't mean it's not miraculous."
@@ -122,9 +127,13 @@ static void aggregate_methods(zend_class_entry *ce, zend_class_entry *from_ce, i
122
127
/* 2. private methods (heh, like we really have them) */
123
128
func_name [0 ] == '_' ||
124
129
/* 3. explicitly excluded methods */
125
- (aggr_type == AGGREGATE_BY_LIST && zend_hash_exists (Z_ARRVAL_P (list_hash ), func_name , func_name_len )) ||
130
+ (aggr_type == AGGREGATE_BY_LIST && zend_hash_exists (Z_ARRVAL_P (list_hash ), func_name , func_name_len ))
131
+ #if HAVE_PCRE || HAVE_BUNDLED_PCRE
132
+ ||
126
133
/* 4. methods matching regexp as modified by the exclusion flag */
127
- (aggr_type == AGGREGATE_BY_REGEXP && (pcre_exec (re , re_extra , func_name , func_name_len - 1 , 0 , 0 , NULL , 0 ) < 0 ) ^ exclude ) == 1 ) {
134
+ (aggr_type == AGGREGATE_BY_REGEXP && (pcre_exec (re , re_extra , func_name , func_name_len - 1 , 0 , 0 , NULL , 0 ) < 0 ) ^ exclude ) == 1
135
+ #endif
136
+ ) {
128
137
zend_hash_move_forward_ex (& from_ce -> function_table , & pos );
129
138
continue ;
130
139
}
@@ -178,9 +187,11 @@ static void aggregate_properties(zval *obj, zend_class_entry *from_ce, int aggr_
178
187
uint prop_name_len ;
179
188
ulong num_key ;
180
189
zval * list_hash = NULL ;
190
+ #if HAVE_PCRE || HAVE_BUNDLED_PCRE
181
191
pcre * re = NULL ;
182
192
pcre_extra * re_extra = NULL ;
183
193
int re_options = 0 ;
194
+ #endif
184
195
185
196
if (!from_ce -> constants_updated ) {
186
197
zend_hash_apply_with_argument (& from_ce -> default_properties , (apply_func_arg_t ) zval_update_constant , (void * ) 1 TSRMLS_CC );
@@ -192,11 +203,14 @@ static void aggregate_properties(zval *obj, zend_class_entry *from_ce, int aggr_
192
203
*/
193
204
if (aggr_type == AGGREGATE_BY_LIST ) {
194
205
list_hash = array_to_hash (aggr_filter );
195
- } else if (aggr_type == AGGREGATE_BY_REGEXP ) {
206
+ }
207
+ #if HAVE_PCRE || HAVE_BUNDLED_PCRE
208
+ else if (aggr_type == AGGREGATE_BY_REGEXP ) {
196
209
if ((re = pcre_get_compiled_regex (Z_STRVAL_P (aggr_filter ), & re_extra , & re_options )) == NULL ) {
197
210
return ;
198
211
}
199
212
}
213
+ #endif
200
214
201
215
/*
202
216
* "Just because it's not nice doesn't mean it's not miraculous."
@@ -217,9 +231,13 @@ static void aggregate_properties(zval *obj, zend_class_entry *from_ce, int aggr_
217
231
* 1. private properties (heh, like we really have them) */
218
232
if (prop_name [0 ] == '_' ||
219
233
/* 2. explicitly excluded properties */
220
- (aggr_type == AGGREGATE_BY_LIST && zend_hash_exists (Z_ARRVAL_P (list_hash ), prop_name , prop_name_len )) ||
234
+ (aggr_type == AGGREGATE_BY_LIST && zend_hash_exists (Z_ARRVAL_P (list_hash ), prop_name , prop_name_len ))
235
+ #if HAVE_PCRE || HAVE_BUNDLED_PCRE
236
+ ||
221
237
/* 3. properties matching regexp as modified by the exclusion flag */
222
- (aggr_type == AGGREGATE_BY_REGEXP && (pcre_exec (re , re_extra , prop_name , prop_name_len - 1 , 0 , 0 , NULL , 0 ) < 0 ) ^ exclude ) == 1 ) {
238
+ (aggr_type == AGGREGATE_BY_REGEXP && (pcre_exec (re , re_extra , prop_name , prop_name_len - 1 , 0 , 0 , NULL , 0 ) < 0 ) ^ exclude ) == 1
239
+ #endif
240
+ ) {
223
241
zend_hash_move_forward_ex (& from_ce -> default_properties , & pos );
224
242
continue ;
225
243
}
@@ -478,15 +496,6 @@ PHP_FUNCTION(aggregate_methods_by_list)
478
496
/* }}} */
479
497
480
498
481
- /* {{{ proto void aggregate_methods_by_regexp(object obj, string class, string regexp [, bool exclude])
482
- */
483
- PHP_FUNCTION (aggregate_methods_by_regexp )
484
- {
485
- aggregate (INTERNAL_FUNCTION_PARAM_PASSTHRU , AGGREGATE_METHODS , AGGREGATE_BY_REGEXP );
486
- }
487
- /* }}} */
488
-
489
-
490
499
/* {{{ proto void aggregate_properties(object obj, string class)
491
500
*/
492
501
PHP_FUNCTION (aggregate_properties )
@@ -504,6 +513,15 @@ PHP_FUNCTION(aggregate_properties_by_list)
504
513
}
505
514
/* }}} */
506
515
516
+ #if HAVE_PCRE || HAVE_BUNDLED_PCRE
517
+ /* {{{ proto void aggregate_methods_by_regexp(object obj, string class, string regexp [, bool exclude])
518
+ */
519
+ PHP_FUNCTION (aggregate_methods_by_regexp )
520
+ {
521
+ aggregate (INTERNAL_FUNCTION_PARAM_PASSTHRU , AGGREGATE_METHODS , AGGREGATE_BY_REGEXP );
522
+ }
523
+ /* }}} */
524
+
507
525
508
526
/* {{{ proto void aggregate_properties_by_regexp(object obj, string class, string regexp [, bool exclude])
509
527
*/
@@ -512,6 +530,7 @@ PHP_FUNCTION(aggregate_properties_by_regexp)
512
530
aggregate (INTERNAL_FUNCTION_PARAM_PASSTHRU , AGGREGATE_PROPERTIES , AGGREGATE_BY_REGEXP );
513
531
}
514
532
/* }}} */
533
+ #endif
515
534
516
535
517
536
/* {{{ proto array aggregation_info(object obj)
0 commit comments