helly Sun Mar 4 00:36:08 2007 UTC
Modified files:
/php-src/ext/spl spl_directory.c spl_directory.h
Log:
- Reverting glob on child logic makes globbing work better with the example
code
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.128&r2=1.129&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.128
php-src/ext/spl/spl_directory.c:1.129
--- php-src/ext/spl/spl_directory.c:1.128 Sun Mar 4 00:23:07 2007
+++ php-src/ext/spl/spl_directory.c Sun Mar 4 00:36:08 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.c,v 1.128 2007/03/04 00:23:07 helly Exp $ */
+/* $Id: spl_directory.c,v 1.129 2007/03/04 00:36:08 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -1207,7 +1207,7 @@
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 @@
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 @@
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;
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.h?r1=1.32&r2=1.33&diff_format=u
Index: php-src/ext/spl/spl_directory.h
diff -u php-src/ext/spl/spl_directory.h:1.32
php-src/ext/spl/spl_directory.h:1.33
--- php-src/ext/spl/spl_directory.h:1.32 Sun Mar 4 00:23:07 2007
+++ php-src/ext/spl/spl_directory.h Sun Mar 4 00:36:08 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.h,v 1.32 2007/03/04 00:23:07 helly Exp $ */
+/* $Id: spl_directory.h,v 1.33 2007/03/04 00:36:08 helly Exp $ */
#ifndef SPL_DIRECTORY_H
#define SPL_DIRECTORY_H
@@ -122,7 +122,7 @@
#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 */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php