From: Marcus Boerger Date: Sun, 4 Mar 2007 00:36:08 +0000 (+0000) Subject: - Reverting glob on child logic makes globbing work better with the example X-Git-Tag: RELEASE_1_0_1~106 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ee90718e91cd4ac6a502c2291ef6e74b7a47f6d;p=php - Reverting glob on child logic makes globbing work better with the example code --- diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 9e0c355a6a..61be19c669 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1207,7 +1207,7 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren) INIT_PZVAL(&zflags); INIT_PZVAL(&zpath); - if ((intern->flags & (SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_NO_GLOB_CHILD)) == SPL_FILE_DIR_USE_GLOB) { + if ((intern->flags & (SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_CHILD_GLOB)) == (SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_CHILD_GLOB)) { ZVAL_LONG(&zflags, intern->flags); Z_TYPE(zpath) = IS_STRING; Z_STRLEN(zpath) = spprintf(&Z_STRVAL(zpath), 0, "%R%c%s", @@ -1215,7 +1215,7 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren) DEFAULT_SLASH, php_glob_stream_get_pattern(intern->u.dir.dirp, 0, NULL)); } else { - ZVAL_LONG(&zflags, intern->flags & ~SPL_FILE_DIR_USE_GLOB); + ZVAL_LONG(&zflags, intern->flags & ~(SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_CHILD_GLOB)); ZVAL_ZSTRL(&zpath, intern->file_name_type, intern->file_name, intern->file_name_len, 1); } @@ -2508,7 +2508,7 @@ PHP_MINIT_FUNCTION(spl_directory) zend_class_implements(spl_ce_DirectoryIterator TSRMLS_CC, 1, zend_ce_iterator); REGISTER_SPL_CLASS_CONST_LONG(DirectoryIterator, "USE_GLOB", SPL_FILE_DIR_USE_GLOB); - REGISTER_SPL_CLASS_CONST_LONG(DirectoryIterator, "NO_GLOB_CHILD", SPL_FILE_DIR_NO_GLOB_CHILD); + REGISTER_SPL_CLASS_CONST_LONG(DirectoryIterator, "CHILD_GLOB", SPL_FILE_DIR_CHILD_GLOB); spl_ce_DirectoryIterator->get_iterator = spl_filesystem_dir_get_iterator; diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h index 53709767ca..15c4f75fff 100755 --- a/ext/spl/spl_directory.h +++ b/ext/spl/spl_directory.h @@ -122,7 +122,7 @@ static inline spl_filesystem_object* spl_filesystem_iterator_to_object(spl_files #define SPL_FILE_DIR_USE_GLOB 0x00001000 /* use glob for open dir*/ #define SPL_FILE_DIR_GLOB_REFETCH_PATH 0x00002000 /* whether we need to refetch the path in glob mode */ -#define SPL_FILE_DIR_NO_GLOB_CHILD 0x00004000 /* do not use glob on childs */ +#define SPL_FILE_DIR_CHILD_GLOB 0x00004000 /* do use glob on childs */ #endif /* SPL_DIRECTORY_H */