@@ -211,7 +211,6 @@ static inline bool spl_intern_is_glob(const spl_filesystem_object *intern)
211
211
212
212
PHPAPI zend_string * spl_filesystem_object_get_path (const spl_filesystem_object * intern ) /* {{{ */
213
213
{
214
- #ifdef HAVE_GLOB
215
214
if (intern -> type == SPL_FS_DIR && spl_intern_is_glob (intern )) {
216
215
size_t len = 0 ;
217
216
char * tmp = php_glob_stream_get_path (intern -> u .dir .dirp , & len );
@@ -220,7 +219,6 @@ PHPAPI zend_string *spl_filesystem_object_get_path(const spl_filesystem_object *
220
219
}
221
220
return zend_string_init (tmp , len , /* persistent */ false);
222
221
}
223
- #endif
224
222
if (!intern -> path ) {
225
223
return NULL ;
226
224
}
@@ -641,14 +639,12 @@ static inline HashTable *spl_filesystem_object_get_debug_info(zend_object *objec
641
639
spl_set_private_debug_info_property (spl_ce_SplFileInfo , "fileName" , strlen ("fileName" ), debug_info , & tmp );
642
640
}
643
641
if (intern -> type == SPL_FS_DIR ) {
644
- #ifdef HAVE_GLOB
645
642
if (spl_intern_is_glob (intern )) {
646
643
ZVAL_STR_COPY (& tmp , intern -> path );
647
644
} else {
648
645
ZVAL_FALSE (& tmp );
649
646
}
650
647
spl_set_private_debug_info_property (spl_ce_DirectoryIterator , "glob" , strlen ("glob" ), debug_info , & tmp );
651
- #endif
652
648
if (intern -> u .dir .sub_path ) {
653
649
ZVAL_STR_COPY (& tmp , intern -> u .dir .sub_path );
654
650
} else {
@@ -721,13 +717,11 @@ static void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_l
721
717
722
718
/* spl_filesystem_dir_open() may emit an E_WARNING */
723
719
zend_replace_error_handling (EH_THROW , spl_ce_UnexpectedValueException , & error_handling );
724
- #ifdef HAVE_GLOB
725
720
if (SPL_HAS_FLAG (ctor_flags , DIT_CTOR_GLOB ) && !zend_string_starts_with_literal (path , "glob://" )) {
726
721
path = zend_strpprintf (0 , "glob://%s" , ZSTR_VAL (path ));
727
722
spl_filesystem_dir_open (intern , path );
728
723
zend_string_release (path );
729
724
} else
730
- #endif
731
725
{
732
726
spl_filesystem_dir_open (intern , path );
733
727
@@ -1582,7 +1576,6 @@ PHP_METHOD(RecursiveDirectoryIterator, __construct)
1582
1576
}
1583
1577
/* }}} */
1584
1578
1585
- #ifdef HAVE_GLOB
1586
1579
/* {{{ Cronstructs a new dir iterator from a glob expression (no glob:// needed). */
1587
1580
PHP_METHOD (GlobIterator , __construct )
1588
1581
{
@@ -1607,7 +1600,6 @@ PHP_METHOD(GlobIterator, count)
1607
1600
RETURN_LONG (php_glob_stream_get_count (intern -> u .dir .dirp , NULL ));
1608
1601
}
1609
1602
/* }}} */
1610
- #endif /* HAVE_GLOB */
1611
1603
1612
1604
/* {{{ forward declarations to the iterator handlers */
1613
1605
static void spl_filesystem_dir_it_dtor (zend_object_iterator * iter );
@@ -2782,11 +2774,9 @@ PHP_MINIT_FUNCTION(spl_directory)
2782
2774
spl_filesystem_object_check_handlers .clone_obj = NULL ;
2783
2775
spl_filesystem_object_check_handlers .get_method = spl_filesystem_object_get_method_check ;
2784
2776
2785
- #ifdef HAVE_GLOB
2786
2777
spl_ce_GlobIterator = register_class_GlobIterator (spl_ce_FilesystemIterator , zend_ce_countable );
2787
2778
spl_ce_GlobIterator -> create_object = spl_filesystem_object_new ;
2788
2779
spl_ce_GlobIterator -> default_object_handlers = & spl_filesystem_object_check_handlers ;
2789
- #endif
2790
2780
2791
2781
spl_ce_SplFileObject = register_class_SplFileObject (spl_ce_SplFileInfo , spl_ce_RecursiveIterator , spl_ce_SeekableIterator );
2792
2782
spl_ce_SplFileObject -> default_object_handlers = & spl_filesystem_object_check_handlers ;
0 commit comments