[PHP-CVS-DAILY] cvs: php-src / ChangeLog
changelog Sat May 17 01:31:42 2008 UTC Modified files: /php-srcChangeLog Log: ChangeLog update http://cvs.php.net/viewvc.cgi/php-src/ChangeLog?r1=1.3048r2=1.3049diff_format=u Index: php-src/ChangeLog diff -u php-src/ChangeLog:1.3048 php-src/ChangeLog:1.3049 --- php-src/ChangeLog:1.3048Fri May 16 01:31:52 2008 +++ php-src/ChangeLog Sat May 17 01:31:41 2008 @@ -1,3 +1,78 @@ +2008-05-16 Zoe Slattery [EMAIL PROTECTED] + +* ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt + ext/dom/tests/DOMDocument_loadHTML_basic.phpt + ext/dom/tests/DOMDocument_save_basic.phpt + ext/dom/tests/DOMNode_hasChildNodes_basic.phpt + ext/dom/tests/DOMNode_replaceChild_basic.phpt: + Tests from Testfest 2008 + +* ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt + ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt + ext/dom/tests/DOMDocument_loadHTML_basic.phpt + ext/dom/tests/DOMDocument_loadHTML_basic.phpt + ext/dom/tests/DOMDocument_save_basic.phpt + ext/dom/tests/DOMDocument_save_basic.phpt + ext/dom/tests/DOMNode_hasChildNodes_basic.phpt + ext/dom/tests/DOMNode_hasChildNodes_basic.phpt + ext/dom/tests/DOMNode_replaceChild_basic.phpt + ext/dom/tests/DOMNode_replaceChild_basic.phpt: + + file DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt was initially + added on branch PHP_5_3. + +2008-05-16 Dmitry Stogov [EMAIL PROTECTED] + +* (PHP_5_3) + ZendEngine2/bench.php: + Make it backward compatibility + +2008-05-16 Etienne Kneuss [EMAIL PROTECTED] + +* ext/spl/spl_directory.c + ext/spl/spl_directory.h + ext/spl/tests/dit_004.phpt + ext/spl/tests/dit_005.phpt: + Fix FilesystemIterator with ./.. + +2008-05-16 Felipe Pena [EMAIL PROTECTED] + +* (PHP_5_3) + ext/standard/file.c: + - Changed 'Z' to 's' (parameter parsing), the code didn't check if the + parameter is a string. + +* (PHP_5_3) + ext/standard/dl.c + ext/standard/dl.h: + - MFH: Improved fix (used 's' in parameter parsing) + +* ext/standard/dl.c + ext/standard/dl.h: + - Improved fix (used 's' in parameter parsing) + +* ext/standard/dl.c: + - MFB: Added conversion to string. + +* (PHP_5_3) + ext/standard/dl.c: + - Added conversion to string. + +2008-05-16 Greg Beaver [EMAIL PROTECTED] + +* (PHP_5_3) + ext/phar/config.m4: + cosmetics + +* (PHP_5_3) + ext/phar/config.m4 + ext/phar/config.w32: + as discussed on internals, enable phar by default for testing purposes. + Phar is enabled as a shared extension by default in order to allow + zlib/bz2 to be built shared. If phar is statically built, + both zlib and bz2 must be statically built in order for phar to use them, + so default compile as shared is much more flexible + 2008-05-15 Greg Beaver [EMAIL PROTECTED] * ext/phar/phar_object.c
[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog
changelog Sat May 17 01:31:45 2008 UTC Modified files: /ZendEngine2ChangeLog Log: ChangeLog update http://cvs.php.net/viewvc.cgi/ZendEngine2/ChangeLog?r1=1.1301r2=1.1302diff_format=u Index: ZendEngine2/ChangeLog diff -u ZendEngine2/ChangeLog:1.1301 ZendEngine2/ChangeLog:1.1302 --- ZendEngine2/ChangeLog:1.1301Thu May 15 01:31:51 2008 +++ ZendEngine2/ChangeLog Sat May 17 01:31:44 2008 @@ -1,3 +1,9 @@ +2008-05-16 Dmitry Stogov [EMAIL PROTECTED] + +* (PHP_5_3) + bench.php: + Make it backward compatibility + 2008-05-14 Antony Dovgal [EMAIL PROTECTED] * (PHP_5_2) @@ -23255,7 +23261,7 @@ 2003-06-10 Jani Taskinen [EMAIL PROTECTED] * zend_multiply.h: - - Missing $Id: ChangeLog,v 1.1301 2008/05/15 01:31:51 changelog Exp $ tag + - Missing $Id: ChangeLog,v 1.1302 2008/05/17 01:31:44 changelog Exp $ tag 2003-06-10 James Cox [EMAIL PROTECTED] @@ -24979,7 +24985,7 @@ zend_types.h zend_variables.c zend_variables.h: - - Added some missing CVS $Id: ChangeLog,v 1.1301 2008/05/15 01:31:51 changelog Exp $ tags, headers and footers. + - Added some missing CVS $Id: ChangeLog,v 1.1302 2008/05/17 01:31:44 changelog Exp $ tags, headers and footers. 2003-01-30 Ilia Alshanetsky [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php-src /ext/standard dl.c
On 16.05.2008 07:11, Felipe Pena wrote: - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, filename) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z/, filename) == FAILURE) { return; } + + convert_to_string(filename); Why not use s ? That would also give you nice notices when you pass in non-scalar values. -- Wbr, Antony Dovgal -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/dom DOMDocument_createAttribute_basic.phpt DOMDocument_createAttribute_error.phpt DOMDocument_createAttribute_error1.phpt DOMDocument_createAttribute_variation
On Thu, May 15, 2008 at 2:23 PM, Zoe Slattery [EMAIL PROTECTED] wrote: zoe Thu May 15 12:23:47 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/domDOMDocument_createAttribute_basic.phpt DOMDocument_createAttribute_error1.phpt DOMDocument_createAttribute_error.phpt DOMDocument_createAttribute_variation.phpt Wrong directory -Hannes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/standard dl.c
Em Sex, 2008-05-16 às 11:40 +0400, Antony Dovgal escreveu: On 16.05.2008 07:11, Felipe Pena wrote: - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, filename) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z/, filename) == FAILURE) { return; } + + convert_to_string(filename); Why not use s ? That would also give you nice notices when you pass in non-scalar values. Because php_dl() expects zval* and i thought to keep it. But, i'll change, whereas php_dl() doesn't make anything with zvals. -- Regards, Felipe Pena. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard dl.c dl.h
felipe Fri May 16 12:11:15 2008 UTC Modified files: /php-src/ext/standard dl.c dl.h Log: - Improved fix (used 's' in parameter parsing) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.126r2=1.127diff_format=u Index: php-src/ext/standard/dl.c diff -u php-src/ext/standard/dl.c:1.126 php-src/ext/standard/dl.c:1.127 --- php-src/ext/standard/dl.c:1.126 Fri May 16 03:11:56 2008 +++ php-src/ext/standard/dl.c Fri May 16 12:11:15 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: dl.c,v 1.126 2008/05/16 03:11:56 felipe Exp $ */ +/* $Id: dl.c,v 1.127 2008/05/16 12:11:15 felipe Exp $ */ #include php.h #include dl.h @@ -54,15 +54,14 @@ Load a PHP extension at runtime */ PHP_FUNCTION(dl) { - zval *filename; + char *filename; + int filename_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z/, filename) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, filename, filename_len, ZEND_U_CONVERTER(UG(filesystem_encoding_conv))) == FAILURE) { return; } - - convert_to_string(filename); - if (Z_STRLEN_P(filename) = MAXPATHLEN) { + if (filename_len = MAXPATHLEN) { php_error_docref(NULL TSRMLS_CC, E_WARNING, File name exceeds the maximum allowed length of %d characters, MAXPATHLEN); RETURN_FALSE; } @@ -72,10 +71,10 @@ (strncmp(sapi_module.name, embed, 5) != 0) ) { #ifdef ZTS - php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported in multithreaded Web servers - use extension=%s in your php.ini, Z_STRVAL_P(filename)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported in multithreaded Web servers - use extension=%s in your php.ini, filename); RETURN_FALSE; #else - php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, dl() is deprecated - use extension=%s in your php.ini, Z_STRVAL_P(filename)); + php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, dl() is deprecated - use extension=%s in your php.ini, filename); #endif } @@ -243,29 +242,14 @@ /* {{{ php_dl */ -PHPAPI void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC) +PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC) { - char *filename; - int filename_len; - - if (Z_TYPE_P(file) == IS_UNICODE) { - if (FAILURE == php_stream_path_encode(NULL, filename, filename_len, Z_USTRVAL_P(file), Z_USTRLEN_P(file), REPORT_ERRORS, FG(default_context))) { - return; - } - } else { - filename = Z_STRVAL_P(file); - } - /* Load extension */ - if (php_load_extension(filename, type, start_now TSRMLS_CC) == FAILURE) { + if (php_load_extension(file, type, start_now TSRMLS_CC) == FAILURE) { RETVAL_FALSE; } else { RETVAL_TRUE; } - - if (Z_TYPE_P(file) == IS_UNICODE) { - efree(filename); - } } /* }}} */ @@ -276,9 +260,9 @@ #else -PHPAPI void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC) +PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot dynamically load %R - dynamic modules are not supported, Z_TYPE_P(file), Z_UNIVAL_P(file)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot dynamically load %s - dynamic modules are not supported, file); RETURN_FALSE; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.h?r1=1.28r2=1.29diff_format=u Index: php-src/ext/standard/dl.h diff -u php-src/ext/standard/dl.h:1.28 php-src/ext/standard/dl.h:1.29 --- php-src/ext/standard/dl.h:1.28 Mon Dec 31 07:12:15 2007 +++ php-src/ext/standard/dl.h Fri May 16 12:11:15 2008 @@ -18,13 +18,13 @@ +--+ */ -/* $Id: dl.h,v 1.28 2007/12/31 07:12:15 sebastian Exp $ */ +/* $Id: dl.h,v 1.29 2008/05/16 12:11:15 felipe Exp $ */ #ifndef DL_H #define DL_H PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC); -PHPAPI void php_dl(zval *file,int type, zval *return_value, int start_now TSRMLS_DC); +PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC); /* dynamic loading functions */ PHPAPI PHP_FUNCTION(dl); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard dl.c dl.h
felipe Fri May 16 12:18:43 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard dl.c dl.h Log: - MFH: Improved fix (used 's' in parameter parsing) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.106.2.1.2.5.2.7r2=1.106.2.1.2.5.2.8diff_format=u Index: php-src/ext/standard/dl.c diff -u php-src/ext/standard/dl.c:1.106.2.1.2.5.2.7 php-src/ext/standard/dl.c:1.106.2.1.2.5.2.8 --- php-src/ext/standard/dl.c:1.106.2.1.2.5.2.7 Fri May 16 03:01:20 2008 +++ php-src/ext/standard/dl.c Fri May 16 12:18:43 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: dl.c,v 1.106.2.1.2.5.2.7 2008/05/16 03:01:20 felipe Exp $ */ +/* $Id: dl.c,v 1.106.2.1.2.5.2.8 2008/05/16 12:18:43 felipe Exp $ */ #include php.h #include dl.h @@ -53,13 +53,12 @@ Load a PHP extension at runtime */ PHP_FUNCTION(dl) { - zval *filename; + char *filename; + int filename_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z/, filename) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, filename, filename_len) == FAILURE) { return; } - - convert_to_string(filename); if (!PG(enable_dl)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Dynamically loaded extensions aren't enabled); @@ -69,7 +68,7 @@ RETURN_FALSE; } - if (Z_STRLEN_P(filename) = MAXPATHLEN) { + if (filename_len = MAXPATHLEN) { php_error_docref(NULL TSRMLS_CC, E_WARNING, File name exceeds the maximum allowed length of %d characters, MAXPATHLEN); RETURN_FALSE; } @@ -79,10 +78,10 @@ (strncmp(sapi_module.name, embed, 5) != 0) ) { #ifdef ZTS - php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported in multithreaded Web servers - use extension=%s in your php.ini, Z_STRVAL_P(filename)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Not supported in multithreaded Web servers - use extension=%s in your php.ini, filename); RETURN_FALSE; #else - php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, dl() is deprecated - use extension=%s in your php.ini, Z_STRVAL_P(filename)); + php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, dl() is deprecated - use extension=%s in your php.ini, filename); #endif } @@ -250,14 +249,10 @@ /* {{{ php_dl */ -PHPAPI void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC) +PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC) { - char *filename; - - filename = Z_STRVAL_P(file); - /* Load extension */ - if (php_load_extension(filename, type, start_now TSRMLS_CC) == FAILURE) { + if (php_load_extension(file, type, start_now TSRMLS_CC) == FAILURE) { RETVAL_FALSE; } else { RETVAL_TRUE; @@ -272,9 +267,9 @@ #else -PHPAPI void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC) +PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot dynamically load %s - dynamic modules are not supported, Z_STRVAL_P(file)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot dynamically load %s - dynamic modules are not supported, file); RETURN_FALSE; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.h?r1=1.23.2.1.2.1.2.2r2=1.23.2.1.2.1.2.3diff_format=u Index: php-src/ext/standard/dl.h diff -u php-src/ext/standard/dl.h:1.23.2.1.2.1.2.2 php-src/ext/standard/dl.h:1.23.2.1.2.1.2.3 --- php-src/ext/standard/dl.h:1.23.2.1.2.1.2.2 Mon Dec 31 07:17:14 2007 +++ php-src/ext/standard/dl.h Fri May 16 12:18:43 2008 @@ -18,13 +18,13 @@ +--+ */ -/* $Id: dl.h,v 1.23.2.1.2.1.2.2 2007/12/31 07:17:14 sebastian Exp $ */ +/* $Id: dl.h,v 1.23.2.1.2.1.2.3 2008/05/16 12:18:43 felipe Exp $ */ #ifndef DL_H #define DL_H PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC); -PHPAPI void php_dl(zval *file,int type, zval *return_value, int start_now TSRMLS_DC); +PHPAPI void php_dl(char *file, int type, zval *return_value, int start_now TSRMLS_DC); /* dynamic loading functions */ PHP_FUNCTION(dl); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard file.c
felipe Fri May 16 12:44:11 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard file.c Log: - Changed 'Z' to 's' (parameter parsing), the code didn't check if the parameter is a string. http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.28.2.13r2=1.409.2.6.2.28.2.14diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.409.2.6.2.28.2.13 php-src/ext/standard/file.c:1.409.2.6.2.28.2.14 --- php-src/ext/standard/file.c:1.409.2.6.2.28.2.13 Sun May 4 21:17:32 2008 +++ php-src/ext/standard/file.c Fri May 16 12:44:11 2008 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.409.2.6.2.28.2.13 2008/05/04 21:17:32 colder Exp $ */ +/* $Id: file.c,v 1.409.2.6.2.28.2.14 2008/05/16 12:44:11 felipe Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1717,24 +1717,26 @@ Copy a file */ PHP_FUNCTION(copy) { - zval **source, **target, *zcontext = NULL; + char *source, *target; + int source_len, target_len; + zval *zcontext = NULL; php_stream_context *context; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ZZ|r, source, target, zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|r, source, source_len, target, target_len, zcontext) == FAILURE) { return; } - if (PG(safe_mode) (!php_checkuid(Z_STRVAL_PP(source), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { + if (PG(safe_mode) (!php_checkuid(source, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { RETURN_FALSE; } - if (php_check_open_basedir(Z_STRVAL_PP(source) TSRMLS_CC)) { + if (php_check_open_basedir(source TSRMLS_CC)) { RETURN_FALSE; } context = php_stream_context_from_zval(zcontext, 0); - if (php_copy_file(Z_STRVAL_PP(source), Z_STRVAL_PP(target) TSRMLS_CC) == SUCCESS) { + if (php_copy_file(source, target TSRMLS_CC) == SUCCESS) { RETURN_TRUE; } else { RETURN_FALSE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_directory.c spl_directory.h /ext/spl/tests dit_004.phpt dit_005.phpt
colder Fri May 16 13:22:02 2008 UTC Added files: /php-src/ext/spl/tests dit_004.phpt dit_005.phpt Modified files: /php-src/ext/splspl_directory.c spl_directory.h Log: Fix FilesystemIterator with ./.. http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.153r2=1.154diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.153 php-src/ext/spl/spl_directory.c:1.154 --- php-src/ext/spl/spl_directory.c:1.153 Thu May 15 17:22:03 2008 +++ php-src/ext/spl/spl_directory.c Fri May 16 13:22:02 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.153 2008/05/15 17:22:03 colder Exp $ */ +/* $Id: spl_directory.c,v 1.154 2008/05/16 13:22:02 colder Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -212,11 +212,18 @@ #define IS_SLASH_AT(type, zs, pos) (type == IS_UNICODE ? IS_U_SLASH(zs.u[pos]) : IS_SLASH(zs.s[pos])) +static inline int spl_filesystem_is_dot(const char * d_name) /* {{{ */ +{ + return !strcmp(d_name, .) || !strcmp(d_name, ..); +} +/* }}} */ + /* {{{ spl_filesystem_dir_open */ /* open a directory resource */ static void spl_filesystem_dir_open(spl_filesystem_object* intern, zend_uchar type, zstr path, int path_len TSRMLS_DC) { int options = REPORT_ERRORS; + int skip_dots = intern-flags SPL_FILE_DIR_SKIPDOTS; #if HELLY_0 if (php_stream_is(intern-u.dir.dirp, php_glob_stream_ops)) { @@ -240,7 +247,9 @@ /* throw exception: should've been already happened */ intern-u.dir.entry.d_name[0] = '\0'; } else { - spl_filesystem_dir_read(intern TSRMLS_CC); + do { + spl_filesystem_dir_read(intern TSRMLS_CC); + } while (skip_dots spl_filesystem_is_dot(intern-u.dir.entry.d_name)); } } /* }}} */ @@ -299,13 +308,18 @@ spl_filesystem_object *intern; spl_filesystem_object *source; int index; + int skip_dots; old_object = zend_objects_get_address(zobject TSRMLS_CC); source = (spl_filesystem_object*)old_object; + skip_dots = source-flags SPL_FILE_DIR_SKIPDOTS; + new_obj_val = spl_filesystem_object_new_ex(old_object-ce, intern TSRMLS_CC); new_object = intern-std; + intern-flags = source-flags; + switch (source-type) { case SPL_FS_INFO: intern-_path_type = source-_path_type; @@ -319,7 +333,9 @@ spl_filesystem_dir_open(intern, source-_path_type, source-_path, source-_path_len TSRMLS_CC); /* read until we hit the position in which we were before */ for(index = 0; index source-u.dir.index; ++index) { - spl_filesystem_dir_read(intern TSRMLS_CC); + do { + spl_filesystem_dir_read(intern TSRMLS_CC); + } while (skip_dots spl_filesystem_is_dot(intern-u.dir.entry.d_name)); } intern-u.dir.index = index; break; @@ -330,7 +346,6 @@ intern-file_class = source-file_class; intern-info_class = source-info_class; - intern-flags = source-flags; intern-oth = source-oth; intern-oth_handler = source-oth_handler; @@ -514,12 +529,6 @@ return NULL; } /* }}} */ -static inline int spl_filesystem_is_dot(const char * d_name) /* {{{ */ -{ - return !strcmp(d_name, .) || !strcmp(d_name, ..); -} -/* }}} */ - static int spl_filesystem_is_invalid_or_dot(const char * d_name) /* {{{ */ { return d_name[0] == '\0' || spl_filesystem_is_dot(d_name); @@ -614,6 +623,11 @@ flags = SPL_FILE_DIR_KEY_AS_PATHNAME|SPL_FILE_DIR_CURRENT_AS_SELF; parsed = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t, path, len, path_type); } + + if (ctor_flags SPL_FILE_DIR_SKIPDOTS) { + flags |= SPL_FILE_DIR_SKIPDOTS; + } + if (parsed == FAILURE) { php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; @@ -625,6 +639,8 @@ } intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + intern-flags = flags; + if ((ctor_flags DIT_CTOR_GLOB) ( (path_type == IS_STRING strstr(path.s, glob://) != path.s) || (path_type == IS_UNICODE u_strstr(path.u, u_glob) != path.u) @@ -637,7 +653,6 @@ } intern-u.dir.is_recursive = instanceof_function(intern-std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0; - intern-flags = flags; php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } @@ -692,9 +707,12 @@ SPL_METHOD(DirectoryIterator, next) { spl_filesystem_object *intern =
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/dom/tests DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt DOMDocument_loadHTML_basic.phpt DOMDocument_save_basic.phpt DOMNode_hasChildNodes_basic.phpt DOMNo
zoe Fri May 16 17:13:42 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/dom/tests DOMNode_hasChildNodes_basic.phpt DOMDocument_save_basic.phpt DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt DOMNode_replaceChild_basic.phpt DOMDocument_loadHTML_basic.phpt Log: Tests from Londn test fest http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMNode_hasChildNodes_basic.phpt?view=markuprev=1.1 Index: php-src/ext/dom/tests/DOMNode_hasChildNodes_basic.phpt +++ php-src/ext/dom/tests/DOMNode_hasChildNodes_basic.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_save_basic.phpt?view=markuprev=1.1 Index: php-src/ext/dom/tests/DOMDocument_save_basic.phpt +++ php-src/ext/dom/tests/DOMDocument_save_basic.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt?view=markuprev=1.1 Index: php-src/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt +++ php-src/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMNode_replaceChild_basic.phpt?view=markuprev=1.1 Index: php-src/ext/dom/tests/DOMNode_replaceChild_basic.phpt +++ php-src/ext/dom/tests/DOMNode_replaceChild_basic.phpt http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_loadHTML_basic.phpt?view=markuprev=1.1 Index: php-src/ext/dom/tests/DOMDocument_loadHTML_basic.phpt +++ php-src/ext/dom/tests/DOMDocument_loadHTML_basic.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/dom/tests DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt DOMDocument_loadHTML_basic.phpt DOMDocument_save_basic.phpt DOMNode_hasChildNodes_basic.phpt DOMNode_replac
zoe Fri May 16 17:14:58 2008 UTC Modified files: /php-src/ext/dom/tests DOMNode_replaceChild_basic.phpt DOMDocument_loadHTML_basic.phpt DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt DOMDocument_save_basic.phpt DOMNode_hasChildNodes_basic.phpt Log: Tests from Testfest 2008 http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMNode_replaceChild_basic.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/dom/tests/DOMNode_replaceChild_basic.phpt diff -u /dev/null php-src/ext/dom/tests/DOMNode_replaceChild_basic.phpt:1.2 --- /dev/null Fri May 16 17:14:58 2008 +++ php-src/ext/dom/tests/DOMNode_replaceChild_basic.phpt Fri May 16 17:14:57 2008 @@ -0,0 +1,44 @@ +--TEST-- +Replacing a child node +--SKIPIF-- +?php require_once('skipif.inc'); ? +--CREDITS-- +Matt Raines [EMAIL PROTECTED] +#London TestFest 2008 +--FILE-- +?php +$document = new DOMDocument(); +$document-loadXML('?xml version=1.0 encoding=utf-8? +rootfoobar/baz//foospameggs/eggs//spam/root'); + +// Replaces the child node oldChild with newChild in the list of children, and +// returns the oldChild node. +$parent = $document-getElementsByTagName('foo')-item(0); +$new_child = $document-createElement('qux'); +$old_child = $parent-replaceChild($new_child, $parent-firstChild); +echo New child replaces old child:\n . $document-saveXML(); +echo Old child is returned:\n . $old_child-tagName . \n; + +// If the newChild is already in the tree, it is first removed. +$parent = $document-getElementsByTagName('spam')-item(0); +$parent-replaceChild($new_child, $parent-firstChild); +echo Existing child is removed from tree:\n . $document-saveXML(); + +// Children are inserted in the correct order. +$new_child = $document-getElementsByTagName('spam')-item(0); +$parent = $document-getElementsByTagName('foo')-item(0); +$parent-replaceChild($new_child, $parent-firstChild); +echo Children are inserted in order:\n . $document-saveXML(); +? +--EXPECT-- +New child replaces old child: +?xml version=1.0 encoding=utf-8? +rootfooqux/baz//foospameggs/eggs//spam/root +Old child is returned: +bar +Existing child is removed from tree: +?xml version=1.0 encoding=utf-8? +rootfoobaz//foospamqux/eggs//spam/root +Children are inserted in order: +?xml version=1.0 encoding=utf-8? +rootfoospamqux/eggs//spam/foo/root http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_loadHTML_basic.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/dom/tests/DOMDocument_loadHTML_basic.phpt diff -u /dev/null php-src/ext/dom/tests/DOMDocument_loadHTML_basic.phpt:1.2 --- /dev/null Fri May 16 17:14:58 2008 +++ php-src/ext/dom/tests/DOMDocument_loadHTML_basic.phpt Fri May 16 17:14:57 2008 @@ -0,0 +1,18 @@ +--TEST-- +DOMDocument::loadHTML +--CREDITS-- +Frank Cassedanne [EMAIL PROTECTED] +#London TestFest 2008 +--SKIPIF-- +?php +require_once('skipif.inc'); +? +--FILE-- +?php +$doc = new DOMDocument(); +$doc-loadHTML(htmlbodypTestbr/p/body/html); +echo $doc-saveHTML(); +? +--EXPECTF-- +!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/REC-html40/loose.dtd; +htmlbodypTestbr/p/body/html http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt diff -u /dev/null php-src/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt:1.2 --- /dev/null Fri May 16 17:14:58 2008 +++ php-src/ext/dom/tests/DOMDocumentFragment_appendXML_hasChildNodes_basic.phpt Fri May 16 17:14:57 2008 @@ -0,0 +1,21 @@ +--TEST-- +Testing DOMDocumentFragment::appendXML and DOMDocumentFragment::hasChildNodes +--FILE-- +?php +$doc = new DOMDocument(); + +$fragment = $doc-createDocumentFragment(); +if ($fragment-hasChildNodes()) { + echo has child nodes\n; +} else { + echo has no child nodes\n; +} +$fragment-appendXML('foobar/foo'); +if ($fragment-hasChildNodes()) { + echo has child nodes\n; +} else { + echo has no child nodes\n; +} +--EXPECT-- +has no child nodes +has child nodes http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMDocument_save_basic.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/dom/tests/DOMDocument_save_basic.phpt diff -u /dev/null php-src/ext/dom/tests/DOMDocument_save_basic.phpt:1.2 --- /dev/null Fri May 16 17:14:58 2008 +++ php-src/ext/dom/tests/DOMDocument_save_basic.phpt Fri May 16 17:14:57 2008 @@ -0,0 +1,33 @@ +--TEST-- +DOMDocument::save Test basic function of save method +--SKIPIF-- +?php +require_once('skipif.inc'); +? +--FILE-- +?php +$doc = new DOMDocument('1.0'); +$doc-formatOutput = true; + +$root = $doc-createElement('book'); + +$root = $doc-appendChild($root); + +$title = $doc-createElement('title'); +$title = $root-appendChild($title); + +$text = $doc-createTextNode('This is the