Re: [PHP-CVS] cvs: php-src(PHP_5_2) / configure.in
Hello Nuno, do we still need to patch anything with 1.6? marcus Friday, October 5, 2007, 4:51:36 PM, you wrote: nlopess Fri Oct 5 14:51:36 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcconfigure.in Log: allow lcov 1.6 http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.579.2.52.2.77r2=1.579.2.52.2.78diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.579.2.52.2.77 php-src/configure.in:1.579.2.52.2.78 --- php-src/configure.in:1.579.2.52.2.77Thu Aug 30 07:40:13 2007 +++ php-src/configure.inFri Oct 5 14:51:36 2007 @@ -1,4 +1,4 @@ -## $Id: configure.in,v 1.579.2.52.2.77 2007/08/30 07:40:13 sebastian Exp $ -*- autoconf -*- +## $Id: configure.in,v 1.579.2.52.2.78 2007/10/05 14:51:36 nlopess Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -646,7 +646,7 @@ AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.]) fi - ltp_version_list=1.5 + ltp_version_list=1.5 1.6 AC_CHECK_PROG(LTP, lcov, lcov) AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml) Best regards, Marcus -- 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/tests/strings nl2br_error.phpt nl2br_variation1.phpt nl2br_variation2.phpt nl2br_variation3.phpt nl2br_variation4.phpt nl2br_variation5.phpt
Hello Raghubansh, maybe safe a few keystrokes and go with the suggested *_001 instead or *_variation1 style. Either way I hope you continue. If you do we sooner or later get like 80% coverage - yeah!! marcus Friday, October 5, 2007, 8:47:47 PM, you wrote: kraghubaFri Oct 5 18:47:47 2007 UTC Modified files: /php-src/ext/standard/tests/strings nl2br_error.phpt nl2br_variation1.phpt nl2br_variation2.phpt nl2br_variation3.phpt nl2br_variation4.phpt nl2br_variation5.phpt Log: New testcases for nl2br() function Best regards, Marcus -- 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/standard/tests/network ip_x86_64.phpt
Hello Jani, right. Copying the tests is dangerous as people will forget to change all versions simply because they don't see them failing because they don't execute them. - +1 on __EXPECT(F|REGEX)?(_(32|64))?__ marcus Tuesday, October 2, 2007, 1:53:44 PM, you wrote: On Tue, 2007-10-02 at 15:44 +0400, Antony Dovgal wrote: On 02.10.2007 15:29, Jani Taskinen wrote: Oh..there was one for 64bit too..of course I missed that one since I tested on 32bit only. Yet another reason to not separate tests.. ;) (EXPECT64 :) Well, I think of suffixes more and more (test_name_64bit.phpt, test_name32bit.phpt). It becomes a real issue since the number of tests constantly increases and we have to parse execute more and more SKIPIF sections. Well, as the platform shouldn't matter and same code should be used, just sometimes it gives different expected result, having separate 32/64 bit expected result in same script would be more useful than having multiple copies of tests.. --Jani -- Patches/Donations: http://pecl.php.net/~jani/ Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/spl spl_directory.c spl_directory.h /ext/standard file.c file.h /ext/standard/tests/file bug40501.csv bug40501.phpt fgetcsv_error.phpt
Hello David, can you MFH this to 5.3. marcus Wednesday, October 3, 2007, 12:31:04 PM, you wrote: http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.136r2=1.137diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.136 php-src/ext/spl/spl_directory.c:1.137 --- php-src/ext/spl/spl_directory.c:1.136 Thu Sep 27 18:28:42 2007 +++ php-src/ext/spl/spl_directory.c Wed Oct 3 10:31:03 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.136 2007/09/27 18:28:42 dmitry Exp $ */ +/* $Id: spl_directory.c,v 1.137 2007/10/03 10:31:03 dsp Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1771,7 +1771,7 @@ spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2 TSRMLS_CC); \ } -static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char delimiter, char enclosure, zval *return_value TSRMLS_DC) /* {{{ */ +static int spl_filesystem_file_read_csv(spl_filesystem_object *intern, char delimiter, char enclosure, char escape, zval *return_value TSRMLS_DC) /* {{{ */ { int ret = SUCCESS; @@ -1788,7 +1788,7 @@ } ALLOC_INIT_ZVAL(intern-u.file.current_zval); - php_fgetcsv(intern-u.file.stream, delimiter, enclosure, buf_len, buf, intern-u.file.current_zval TSRMLS_CC); + php_fgetcsv(intern-u.file.stream, delimiter, enclosure, escape, buf_len, buf, intern-u.file.current_zval TSRMLS_CC); if (return_value) { if (Z_TYPE_P(return_value) != IS_NULL) { zval_dtor(return_value); @@ -1814,7 +1814,7 @@ return FAILURE; } if (intern-flags SPL_FILE_OBJECT_READ_CSV) { - return spl_filesystem_file_read_csv(intern, intern-u.file.delimiter, intern-u.file.enclosure, NULL TSRMLS_CC); + return spl_filesystem_file_read_csv(intern, intern-u.file.delimiter, intern-u.file.enclosure, intern-u.file.escape, NULL TSRMLS_CC); } else { zend_call_method_with_0_params(this_ptr, Z_OBJCE_P(getThis()), intern-u.file.func_getCurr, getCurrentLine, retval); } @@ -2149,13 +2149,20 @@ SPL_METHOD(SplFileObject, fgetcsv) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - char delimiter = intern-u.file.delimiter, enclosure = intern-u.file.enclosure; - char *delim, *enclo; - int d_len, e_len; + char delimiter = intern-u.file.delimiter, enclosure = intern-u.file.enclosure, escape = intern-u.file.escape; + char *delim, *enclo, *esc; + int d_len, e_len, esc_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |ss, delim, d_len, enclo, e_len) == SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |sss, delim, d_len, enclo, e_len, esc, esc_len) == SUCCESS) { switch(ZEND_NUM_ARGS()) { + case 3: + if (esc_len != 1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, escape must be a character); + RETURN_FALSE; + } + escape = esc[0]; + case 2: if (e_len != 1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, enclosure must be a character); @@ -2173,23 +2180,30 @@ case 0: break; } - spl_filesystem_file_read_csv(intern, delimiter, enclosure, return_value TSRMLS_CC); + spl_filesystem_file_read_csv(intern, delimiter, enclosure, escape, return_value TSRMLS_CC); } } /* }}} */ -/* {{{ proto void SplFileObject::setCsvControl([string delimiter = ',' [, string enclosure = '']]) +/* {{{ proto void SplFileObject::setCsvControl([string delimiter = ',' [, string enclosure = '' [, string escape = '\\']]]) Set the delimiter and enclosure character used in fgetcsv */ SPL_METHOD(SplFileObject, setCsvControl) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - char delimiter = ',', enclosure = ''; - char *delim, *enclo; - int d_len, e_len; + char delimiter = ',', enclosure = '', escape='\\'; + char *delim, *enclo, *esc; + int d_len, e_len, esc_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |ss, delim, d_len, enclo, e_len) == SUCCESS) { + if
Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings chunk_split_variation2.phpt chunk_split_variation5.phpt chunk_split_variation8.phpt
Hello Antony, this is not about fixing BUGS as in PHP behaves wrong. This is about consistency. We decided on a format for all error messages and Jani was enforcing that. Anyway, it does not matter how long something wrong is in the codebase. Longer errors are not better errors. They only tend to get loved and become features. The real issue here is in fact that you might want to write a strict rule for parsing errors, with some errors having dots and some not it is harder to get the real text. marcus Monday, October 1, 2007, 12:22:43 PM, you wrote: tony2001Mon Oct 1 10:22:43 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings chunk_split_variation2.phpt chunk_split_variation5.phpt chunk_split_variation8.phpt Log: these dots exist since PHP3 even though Jani removed them in 5_3, I can't see how they can cause any BUGS http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/chunk_split_variation2.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/standard/tests/strings/chunk_split_variation2.phpt diff -u php-src/ext/standard/tests/strings/chunk_split_variation2.phpt:1.1.2.1 php-src/ext/standard/tests/strings/chunk_split_variation2.phpt:1.1.2.2 --- php-src/ext/standard/tests/strings/chunk_split_variation2.phpt:1.1.2.1 Sat Sep 29 12:55:34 2007 +++ php-src/ext/standard/tests/strings/chunk_split_variation2.phpt Mon Oct 1 10:22:43 2007 @@ -95,21 +95,21 @@ string(28) This is ch*uklen vari*ation* -- Iteration 2 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 3 -- string(26) This is chuklen variation* -- Iteration 4 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 5 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 6 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 7 -- string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* @@ -121,39 +121,39 @@ string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 11 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 12 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 13 -- string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 14 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 15 -- string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 16 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 17 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 18 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 19 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 20 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 21 -- @@ -161,11 +161,11 @@ string(50) T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n* -- Iteration 22 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d +Warning: chunk_split(): Chunk length should be greater than zero. in %s on line %d bool(false) -- Iteration 23 -- -Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
Re: [PHP-CVS] cvs: php-src /ext/standard dl.c
Hello Stanislav, Thursday, September 13, 2007, 3:16:24 AM, you wrote: stasThu Sep 13 01:16:24 2007 UTC Modified files: /php-src/ext/standard dl.c Log: MFB: docs say dl() parameter can be filename only - enforce it http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.114r2=1.115diff_format=u Index: php-src/ext/standard/dl.c diff -u php-src/ext/standard/dl.c:1.114 php-src/ext/standard/dl.c:1.115 --- php-src/ext/standard/dl.c:1.114 Tue May 29 21:24:45 2007 +++ php-src/ext/standard/dl.c Thu Sep 13 01:16:24 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: dl.c,v 1.114 2007/05/29 21:24:45 tony2001 Exp $ */ +/* $Id: dl.c,v 1.115 2007/09/13 01:16:24 stas Exp $ */ #include php.h #include dl.h @@ -115,6 +115,13 @@ if (extension_dir extension_dir[0]){ int extension_dir_len = strlen(extension_dir); + if(type == MODULE_TEMPORARY) { + if(strchr(filename, '/') != NULL || strchr(filename, DEFAULT_SLASH) != NULL) { Wouldn't something with strcspn and a string build form '/' and DEFAULT_SLASH be faster? + php_error_docref(NULL TSRMLS_CC, E_WARNING, Temporary module name should contain only filename); + RETURN_FALSE; + } + } + if (IS_SLASH(extension_dir[extension_dir_len-1])) { spprintf(libpath, 0, %s%s, extension_dir, filename); /* SAFE */ } else { Best regards, Marcus -- 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 basic_functions.c /ext/standard/tests/network ip_x86_64.phpt
Hello Derick, Saturday, September 1, 2007, 8:37:27 PM, you wrote: derick Sat Sep 1 18:37:27 2007 UTC Added files: /php-src/ext/standard/tests/network ip_x86_64.phpt Modified files: /php-src/ext/standard basic_functions.c Log: - Fixed bug #42512 (ip2long('255.255.255.255') should return 4294967295 on 64-bit PHP). http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.870r2=1.871diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.870 php-src/ext/standard/basic_functions.c:1.871 --- php-src/ext/standard/basic_functions.c:1.870Fri Aug 31 10:45:54 2007 +++ php-src/ext/standard/basic_functions.c Sat Sep 1 18:37:27 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.870 2007/08/31 10:45:54 jani Exp $ */ +/* $Id: basic_functions.c,v 1.871 2007/09/01 18:37:27 derick Exp $ */ #include php.h #include php_streams.h @@ -4284,7 +4284,7 @@ */ if (addr_len == sizeof(255.255.255.255) - 1 !memcmp(addr, 255.255.255.255, sizeof(255.255.255.255) - 1)) { - RETURN_LONG(-1); + RETURN_LONG(0x); A Comment would be nice why this is neither -1 nor ~0. } RETURN_FALSE; http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/network/ip_x86_64.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/network/ip_x86_64.phpt +++ php-src/ext/standard/tests/network/ip_x86_64.phpt --TEST-- ip2long() long2ip() tests --SKIPIF-- ?php if (PHP_INT_SIZE == 4) die(skip this test is for 32bit platform only); ? --FILE-- ?php $array = array( 127.0.0.1, 10.0.0.1, 255.255.255.255, 255.255.255.0, 0.0.0.0, 66.163.161.116, ); foreach ($array as $ip) { var_dump($long = ip2long($ip)); var_dump(long2ip($long)); } var_dump(ip2long()); var_dump(ip2long()); var_dump(ip2long(777.777.777.777)); var_dump(ip2long(111.111.111.111)); var_dump(ip2long(array())); var_dump(long2ip()); var_dump(long2ip(-11)); var_dump(long2ip()); var_dump(long2ip(array())); echo Done\n; ? --EXPECTF-- int(2130706433) string(9) 127.0.0.1 int(167772161) string(8) 10.0.0.1 int(4294967295) string(15) 255.255.255.255 int(4294967040) string(13) 255.255.255.0 int(0) string(7) 0.0.0.0 int(1118019956) string(14) 66.163.161.116 Warning: Wrong parameter count for ip2long() in %s on line %d NULL bool(false) bool(false) int(1869573999) Notice: Array to string conversion in %s on line %d bool(false) Warning: Wrong parameter count for long2ip() in %s on line %d NULL string(13) 255.254.82.80 string(7) 0.0.0.0 Notice: Array to string conversion in %s on line %d string(7) 0.0.0.0 Done Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/reflection php_reflection.c
Hello Johannes, iirc this is based on fixing a bug, thus came in later. marcus Friday, August 17, 2007, 4:21:01 PM, you wrote: johannesFri Aug 17 14:21:01 2007 UTC Modified files: /php-src/ext/reflection php_reflection.c Log: - Mark the parameter for ReflectionProperty::GetValue as optional # [DOC] The documentation on this is wrong, too. The parameter is only # needed for getting the value of an object's property, not for static # ones. (I'm not sure if it has always been that way...) http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.280r2=1.281diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.280 php-src/ext/reflection/php_reflection.c:1.281 --- php-src/ext/reflection/php_reflection.c:1.280 Tue Jul 24 23:16:47 2007 +++ php-src/ext/reflection/php_reflection.c Fri Aug 17 14:21:00 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.280 2007/07/24 23:16:47 johannes Exp $ */ +/* $Id: php_reflection.c,v 1.281 2007/08/17 14:21:00 johannes Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -4817,7 +4817,7 @@ ZEND_END_ARG_INFO() static -ZEND_BEGIN_ARG_INFO(arginfo_reflection_property_getValue, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_property_getValue, 0, 0, 0) ZEND_ARG_INFO(0, object) ZEND_END_ARG_INFO() @@ -5022,7 +5022,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.280 2007/07/24 23:16:47 johannes Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.281 2007/08/17 14:21:00 johannes Exp $); php_info_print_table_end(); } /* }}} */ Best regards, Marcus -- 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_2) /sapi/apache2handler apache_config.c
Hello Stanislav, Friday, August 3, 2007, 3:14:23 AM, you wrote: stasFri Aug 3 01:14:23 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/sapi/apache2handlerapache_config.c Log: implement separate .htaccess stage http://cvs.php.net/viewvc.cgi/php-src/sapi/apache2handler/apache_config.c?r1=1.7.2.1.2.2r2=1.7.2.1.2.3diff_format=u Index: php-src/sapi/apache2handler/apache_config.c diff -u php-src/sapi/apache2handler/apache_config.c:1.7.2.1.2.2 php-src/sapi/apache2handler/apache_config.c:1.7.2.1.2.3 --- php-src/sapi/apache2handler/apache_config.c:1.7.2.1.2.2 Mon Jan 1 09:36:12 2007 +++ php-src/sapi/apache2handler/apache_config.c Fri Aug 3 01:14:23 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: apache_config.c,v 1.7.2.1.2.2 2007/01/01 09:36:12 sebastian Exp $ */ +/* $Id: apache_config.c,v 1.7.2.1.2.3 2007/08/03 01:14:23 stas Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -51,6 +51,7 @@ char *value; size_t value_len; char status; +char htaccess; Sorry for bickering, but how about WS here? } php_dir_entry; static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, const char *value, int status) @@ -67,7 +68,8 @@ e.value = apr_pstrdup(cmd-pool, value); e.value_len = strlen(value); e.status = status; - + e.htaccess = ((cmd-override (RSRC_CONF|ACCESS_CONF)) == 0); + zend_hash_update(d-config, (char *) name, strlen(name) + 1, e, sizeof(e), NULL); return NULL; } @@ -170,7 +172,7 @@ zend_hash_move_forward(d-config)) { zend_hash_get_current_data(d-config, (void **) data); phpapdebug((stderr, APPLYING (%s)(%s)\n, str, data-value)); - if (zend_alter_ini_entry(str, str_len, data-value, data-value_len, data-status, PHP_INI_STAGE_ACTIVATE) == FAILURE) { + if (zend_alter_ini_entry(str, str_len, data-value, data-value_len, data-status, data-htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) { phpapdebug((stderr, ..FAILED\n)); } } Best regards, Marcus -- 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_2) / NEWS /ext/pdo_sqlite sqlite_statement.c
Hello Ilia, MFH? Thursday, August 2, 2007, 12:45:32 AM, you wrote: iliaa Wed Aug 1 22:45:32 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pdo_sqlite sqlite_statement.c /php-srcNEWS Log: Fixed bug #41831 (pdo_sqlite prepared statements convert resources to strings). http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/sqlite_statement.c?r1=1.18.2.4.2.2r2=1.18.2.4.2.3diff_format=u Index: php-src/ext/pdo_sqlite/sqlite_statement.c diff -u php-src/ext/pdo_sqlite/sqlite_statement.c:1.18.2.4.2.2 php-src/ext/pdo_sqlite/sqlite_statement.c:1.18.2.4.2.3 --- php-src/ext/pdo_sqlite/sqlite_statement.c:1.18.2.4.2.2 Mon Jan 1 09:36:05 2007 +++ php-src/ext/pdo_sqlite/sqlite_statement.c Wed Aug 1 22:45:31 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: sqlite_statement.c,v 1.18.2.4.2.2 2007/01/01 09:36:05 sebastian Exp $ */ +/* $Id: sqlite_statement.c,v 1.18.2.4.2.3 2007/08/01 22:45:31 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -109,7 +109,7 @@ php_stream *stm; php_stream_from_zval_no_verify(stm, param-parameter); if (stm) { - SEPARATE_ZVAL_IF_NOT_REF(param-parameter); + SEPARATE_ZVAL(param-parameter); Z_TYPE_P(param-parameter) = IS_STRING; Z_STRLEN_P(param-parameter) = php_stream_copy_to_mem(stm, Z_STRVAL_P(param-parameter), PHP_STREAM_COPY_ALL, 0); http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.871r2=1.2027.2.547.2.872diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.871 php-src/NEWS:1.2027.2.547.2.872 --- php-src/NEWS:1.2027.2.547.2.871 Wed Aug 1 10:56:45 2007 +++ php-src/NEWSWed Aug 1 22:45:31 2007 @@ -122,6 +122,8 @@ date_create or new DateTime). (Derick) - Fixed bug #41833 (addChild() on a non-existent node, no node created, getName() segfaults). (Rob) +- Fixed bug #41831 (pdo_sqlite prepared statements convert resources to + strings). (Ilia) - Fixed bug #41815 (Concurrent read/write fails when EOF is reached). (Sascha) - Fixed bug #41813 (segmentation fault when using string offset as an object). (judas dot iscariote at gmail dot com, Tony) Best regards, Marcus -- 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_2) /ext/standard url_scanner_ex.c
Hello Jani, we have .re files that are being generated only manually. For one instance look into date lib. best regards marcus Thursday, June 7, 2007, 2:41:10 AM, you wrote: What do you mean with not all .re files have rules ?? --Jani Marcus Boerger kirjoitti: Hello Nuno, not all .re files have rules. MAybe we could collect the .re files in the buildconf or configure process and automatically generate a makefile target re2c if re2c is available. This rulesset might as well check if we develop using gcc and pass -g to re2c in that case. best regards marcus Wednesday, June 6, 2007, 6:29:27 PM, you wrote: yep. letting 'make' regenerate the files should do the trick. Thanks, Nuno - Original Message - I guess you need to generate the files the correct way It should happen automatically when you do the test build..? (just don't run re2c manually) --Jani Antony Dovgal kirjoitti: On 06.06.2007 20:00, Ilia Alshanetsky wrote: Nuno, What does the gcov build need that my re2c is not doing so that I can fix it for the future. Apparently it needs full path, not just filename. Best regards, Marcus Best regards, Marcus -- 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_2) /ext/standard url_scanner_ex.c
Hello Nuno, not all .re files have rules. MAybe we could collect the .re files in the buildconf or configure process and automatically generate a makefile target re2c if re2c is available. This rulesset might as well check if we develop using gcc and pass -g to re2c in that case. best regards marcus Wednesday, June 6, 2007, 6:29:27 PM, you wrote: yep. letting 'make' regenerate the files should do the trick. Thanks, Nuno - Original Message - I guess you need to generate the files the correct way It should happen automatically when you do the test build..? (just don't run re2c manually) --Jani Antony Dovgal kirjoitti: On 06.06.2007 20:00, Ilia Alshanetsky wrote: Nuno, What does the gcov build need that my re2c is not doing so that I can fix it for the future. Apparently it needs full path, not just filename. Best regards, Marcus -- 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_2) / NEWS /ext/gd gd.c /ext/gd/libgd gd.h
Hello Pierre-Alain, it is [DOC] - we all seem to make that mistake and get it wrong somehow. Should we simply allow more than just [DOC] ? Sunday, June 3, 2007, 7:46:18 PM, you wrote: pajoye Sun Jun 3 17:46:18 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/gd gd.c /php-src/ext/gd/libgd gd.h Log: - MFH: @DOC add constants GD_MAJOR_VERSION, GD_MINOR_VERSION, GD_RELEASE_VERSION GD_EXTRA_VERSION and GD_VERSION_STRING http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.750r2=1.2027.2.547.2.751diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.750 php-src/NEWS:1.2027.2.547.2.751 --- php-src/NEWS:1.2027.2.547.2.750 Sun Jun 3 16:19:14 2007 +++ php-src/NEWSSun Jun 3 17:46:17 2007 @@ -2,6 +2,8 @@ ||| ?? ??? 2007, PHP 5.2.4 - Improved fix for MOPB-02-2007. (Ilia) +- Added GD version constants GD_MAJOR_VERSION, GD_MINOR_VERSION + GD_RELEASE_VERSION, GD_EXTRA_VERSION and GD_VERSION_STRING (Pierre) - Fixed bug #41518 (file_exists() warns of open_basedir restriction on non-existent file). (Tony) - Fixed bug #39330 (apache2handler does not call shutdown actions before http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.312.2.20.2.27r2=1.312.2.20.2.28diff_format=u Index: php-src/ext/gd/gd.c diff -u php-src/ext/gd/gd.c:1.312.2.20.2.27 php-src/ext/gd/gd.c:1.312.2.20.2.28 --- php-src/ext/gd/gd.c:1.312.2.20.2.27 Sat Jun 2 15:38:09 2007 +++ php-src/ext/gd/gd.c Sun Jun 3 17:46:18 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: gd.c,v 1.312.2.20.2.27 2007/06/02 15:38:09 pajoye Exp $ */ +/* $Id: gd.c,v 1.312.2.20.2.28 2007/06/03 17:46:18 pajoye Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -1288,6 +1288,7 @@ REGISTER_LONG_CONSTANT(IMG_EFFECT_NORMAL, gdEffectNormal, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_EFFECT_OVERLAY, gdEffectOverlay, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(GD_BUNDLED, 1, CONST_CS | CONST_PERSISTENT); + /* Section Filters */ REGISTER_LONG_CONSTANT(IMG_FILTER_NEGATE, IMAGE_FILTER_NEGATE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(IMG_FILTER_GRAYSCALE, IMAGE_FILTER_GRAYSCALE, CONST_CS | CONST_PERSISTENT); @@ -1305,6 +1306,18 @@ REGISTER_LONG_CONSTANT(GD_BUNDLED, 0, CONST_CS | CONST_PERSISTENT); #endif +#ifdef GD_VERSION_STRING + REGISTER_STRING_CONSTANT(GD_VERSION, GD_VERSION_STRING, CONST_CS | CONST_PERSISTENT); +#endif + +#if defined(GD_MAJOR_VERSION) defined(GD_MINOR_VERSION) defined(GD_RELEASE_VERSION) defined(GD_EXTRA_VERSION) + REGISTER_LONG_CONSTANT(GD_MAJOR_VERSION, GD_MAJOR_VERSION, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(GD_MINOR_VERSION, GD_MINOR_VERSION, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(GD_RELEASE_VERSION, GD_RELEASE_VERSION, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT(GD_EXTRA_VERSION, GD_EXTRA_VERSION, CONST_CS | CONST_PERSISTENT); +#endif + + #ifdef HAVE_GD_PNG /* http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.h?r1=1.26.2.3.2.4r2=1.26.2.3.2.5diff_format=u Index: php-src/ext/gd/libgd/gd.h diff -u php-src/ext/gd/libgd/gd.h:1.26.2.3.2.4 php-src/ext/gd/libgd/gd.h:1.26.2.3.2.5 --- php-src/ext/gd/libgd/gd.h:1.26.2.3.2.4 Mon Apr 23 15:17:47 2007 +++ php-src/ext/gd/libgd/gd.h Sun Jun 3 17:46:18 2007 @@ -11,6 +11,12 @@ #include php_compat.h +#define GD_MAJOR_VERSION 2 +#define GD_MINOR_VERSION 0 +#define GD_RELEASE_VERSION 35 +#define GD_EXTRA_VERSION +#define GD_VERSION_STRING 2.0.35 + #ifdef NETWARE /* default fontpath for netware systems */ #define DEFAULT_FONTPATH sys:/java/nwgfx/lib/x11/fonts/ttf;. Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: CVSROOT / avail
helly Wed May 23 17:36:15 2007 UTC Modified files: /CVSROOTavail Log: - Upgrade Zoe http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1272r2=1.1273diff_format=u Index: CVSROOT/avail diff -u CVSROOT/avail:1.1272 CVSROOT/avail:1.1273 --- CVSROOT/avail:1.1272Fri May 18 15:50:49 2007 +++ CVSROOT/avail Wed May 23 17:36:15 2007 @@ -57,7 +57,7 @@ # The PHP Quality Assurance Team maintains their own website. -avail|ilia,jalal,zak,andre,lyric,jmoore,ronabop,sebastian,joey,sniper,torben,hellekin,cnewbill,bate,yohgaki,jan,imajes,derick,msopacua,nohn,edink,iliaa,helly,sean,nlopess,tony2001|qaweb +avail|ilia,jalal,zak,andre,lyric,jmoore,ronabop,sebastian,joey,sniper,torben,hellekin,cnewbill,bate,yohgaki,jan,imajes,derick,msopacua,nohn,edink,iliaa,helly,sean,nlopess,tony2001,zoe|qaweb # Some people get only access to specific languages for phpdoc avail|elf,shimooka,masugata|phpdoc-ja -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / README.PARAMETER_PARSING_API
helly Wed May 23 18:48:16 2007 UTC Modified files: /php-srcREADME.PARAMETER_PARSING_API Log: - Fix f http://cvs.php.net/viewvc.cgi/php-src/README.PARAMETER_PARSING_API?r1=1.20r2=1.21diff_format=u Index: php-src/README.PARAMETER_PARSING_API diff -u php-src/README.PARAMETER_PARSING_API:1.20 php-src/README.PARAMETER_PARSING_API:1.21 --- php-src/README.PARAMETER_PARSING_API:1.20 Mon Feb 5 17:59:11 2007 +++ php-src/README.PARAMETER_PARSING_APIWed May 23 18:48:16 2007 @@ -43,7 +43,7 @@ C - class (zend_class_entry*) d - double (double) f - function or array containing php method call info (returned as - zend_fcall_info* and zend_fcall_info_cache*) + zend_fcall_info and zend_fcall_info_cache) h - array (returned as HashTable*) l - long (long) o - object of any type (zval*) -- 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_2) /ext/sybase_ct/tests test.inc
Hello Timm, how about taking the configuration from environment if present. Something like PHP_TEST_SYBASE_CT_* environment variables. best regards marcus Tuesday, May 22, 2007, 1:36:55 PM, you wrote: thekid Tue May 22 11:36:55 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct/teststest.inc Log: - Added constant TEMPDB, defaulting to tempdb # This constant is used by some of the tests and should point # to a database where the user has create proc|table permissions http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/tests/test.inc?r1=1.4.6.2r2=1.4.6.3diff_format=u Index: php-src/ext/sybase_ct/tests/test.inc diff -u php-src/ext/sybase_ct/tests/test.inc:1.4.6.2 php-src/ext/sybase_ct/tests/test.inc:1.4.6.3 --- php-src/ext/sybase_ct/tests/test.inc:1.4.6.2Sun Mar 11 12:56:44 2007 +++ php-src/ext/sybase_ct/tests/test.incTue May 22 11:36:55 2007 @@ -1,13 +1,14 @@ ?php /* This file is part of PHP test framework for ext/sybase_ct * - * $Id: test.inc,v 1.4.6.2 2007/03/11 12:56:44 tony2001 Exp $ + * $Id: test.inc,v 1.4.6.3 2007/05/22 11:36:55 thekid Exp $ */ // Change if needed define('HOST', ''); define('USER', ''); define('PASSWORD', ''); + define('TEMPDB', 'tempdb'); // {{{ bool sybase_msg_handler(int msgnumber, int severity, int state, int line, string text) // Handles server messages Best regards, Marcus -- 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/tests/general_functions gettype_settype_basic.phpt
Hello Antony, why not simply put precision=14 into th elist of hardcoded ini settings in run-tests.php ? best regards marcus Tuesday, May 22, 2007, 6:57:18 PM, you wrote: tony2001Tue May 22 16:57:18 2007 UTC Modified files: /php-src/ext/standard/tests/general_functions gettype_settype_basic.phpt Log: fix test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/gettype_settype_basic.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/standard/tests/general_functions/gettype_settype_basic.phpt diff -u php-src/ext/standard/tests/general_functions/gettype_settype_basic.phpt:1.2 php-src/ext/standard/tests/general_functions/gettype_settype_basic.phpt:1.3 --- php-src/ext/standard/tests/general_functions/gettype_settype_basic.phpt:1.2 Tue May 22 16:06:44 2007 +++ php-src/ext/standard/tests/general_functions/gettype_settype_basic.phpt Tue May 22 16:57:18 2007 @@ -1,5 +1,7 @@ --TEST-- Test gettype() settype() functions : basic functionalities +--INI-- +precision=14 --FILE-- ?php /* Prototype: string gettype ( mixed $var ); Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / run-tests.php
helly Sun May 20 18:24:16 2007 UTC Modified files: /php-srcrun-tests.php Log: - Make it executeable http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.321r2=1.322diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.321 php-src/run-tests.php:1.322 --- php-src/run-tests.php:1.321 Wed May 2 15:25:32 2007 +++ php-src/run-tests.php Sun May 20 18:24:15 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/php ?php /* +--+ @@ -23,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.321 2007/05/02 15:25:32 tony2001 Exp $ */ +/* $Id: run-tests.php,v 1.322 2007/05/20 18:24:15 helly Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -405,7 +406,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.321 $'.\n; + echo '$Revision: 1.322 $'.\n; exit(1); default: echo Illegal switch specified!\n; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / run-tests.php
helly Sun May 20 18:29:43 2007 UTC Modified files: /php-srcrun-tests.php Log: - Update copyright http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.322r2=1.323diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.322 php-src/run-tests.php:1.323 --- php-src/run-tests.php:1.322 Sun May 20 18:24:15 2007 +++ php-src/run-tests.php Sun May 20 18:29:43 2007 @@ -4,7 +4,7 @@ +--+ | PHP Version 5| +--+ - | Copyright (c) 1997-2006 The PHP Group| + | Copyright (c) 1997-2007 The PHP Group| +--+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is| @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.322 2007/05/20 18:24:15 helly Exp $ */ +/* $Id: run-tests.php,v 1.323 2007/05/20 18:29:43 helly Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -406,7 +406,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.322 $'.\n; + echo '$Revision: 1.323 $'.\n; exit(1); default: echo Illegal switch specified!\n; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / .gdbinit
helly Sun May 20 21:46:17 2007 UTC Modified files: (Branch: PHP_5_2) /php-src.gdbinit Log: - MFH Add print_htptr, print_htstr http://cvs.php.net/viewvc.cgi/php-src/.gdbinit?r1=1.10.4.3r2=1.10.4.3.2.1diff_format=u Index: php-src/.gdbinit diff -u php-src/.gdbinit:1.10.4.3 php-src/.gdbinit:1.10.4.3.2.1 --- php-src/.gdbinit:1.10.4.3 Fri May 5 15:49:41 2006 +++ php-src/.gdbinitSun May 20 21:46:17 2007 @@ -8,7 +8,7 @@ end document executor_globals - portable way of accessing executor_globals + portable way of accessing executor_globals, set $eg ZTS detection is automatically based on ext/standard module struct end @@ -39,14 +39,18 @@ end document printzv - prints content of zval + prints zval contents end define printzv_contents set $zvalue = $arg0 set $type = $zvalue-type - printf (refcount=%d) , $zvalue-refcount + printf (refcount=%d, $zvalue-refcount + if $zvalue-is_ref + printf ,is_ref + end + printf ) if $type == 0 printf NULL end @@ -69,7 +73,7 @@ if ! $arg1 printf {\n set $ind = $ind + 1 - print_ht $zvalue-value.ht + print_ht $zvalue-value.ht 1 set $ind = $ind - 1 set $i = $ind while $i 0 @@ -103,7 +107,7 @@ printf (%d): , $ht-nNumOfElements printf {\n set $ind = $ind + 1 - print_ht $ht + print_ht $ht 1 set $ind = $ind - 1 set $i = $ind while $i 0 @@ -188,12 +192,10 @@ end define print_ht - set $ht = $arg0 + set $ht = (HashTable*)$arg0 set $p = $ht-pListHead while $p != 0 - set $zval = *(zval **)$p-pData - set $i = $ind while $i 0 printf @@ -206,8 +208,18 @@ else printf %d = , $p-h end + + if $arg1 == 0 + printf %p\n, (void*)$p-pData + end + if $arg1 == 1 + set $zval = *(zval **)$p-pData + printzv $zval 1 + end + if $arg1 == 2 + printf %s\n, (char*)$p-pData + end - printzv $zval 1 set $p = $p-pListNext end end @@ -215,7 +227,7 @@ define print_ht set $ind = 1 printf [0x%08x] {\n, $arg0 - print_ht $arg0 + print_ht $arg0 1 printf }\n end @@ -223,6 +235,28 @@ dumps elements of HashTable made of zval end +define print_htptr + set $ind = 1 + printf [0x%08x] {\n, $arg0 + print_ht $arg0 0 + printf }\n +end + +document print_htptr + dumps elements of HashTable made of pointers +end + +define print_htstr + set $ind = 1 + printf [0x%08x] {\n, $arg0 + print_ht $arg0 2 + printf }\n +end + +document print_htstr + dumps elements of HashTable made of strings +end + define print_ft set $ht = $arg0 set $p = $ht-pListHead -- 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_iterators.c spl_iterators.h
helly Fri May 11 00:14:37 2007 UTC Modified files: /php-src/ext/splspl_iterators.c spl_iterators.h Log: -Addvert optionto RegexIterator http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.160r2=1.161diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.160 php-src/ext/spl/spl_iterators.c:1.161 --- php-src/ext/spl/spl_iterators.c:1.160 Sun Mar 4 12:06:55 2007 +++ php-src/ext/spl/spl_iterators.c Fri May 11 00:14:36 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.160 2007/03/04 12:06:55 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.161 2007/05/11 00:14:36 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1453,6 +1453,10 @@ } } + if (intern-u.regex.flags REGIT_INVERTED) { + RETVAL_BOOL(Z_LVAL_P(return_value)); + } + if (use_copy) { efree(subject); } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.h?r1=1.41r2=1.42diff_format=u Index: php-src/ext/spl/spl_iterators.h diff -u php-src/ext/spl/spl_iterators.h:1.41 php-src/ext/spl/spl_iterators.h:1.42 --- php-src/ext/spl/spl_iterators.h:1.41Thu Feb 8 20:13:49 2007 +++ php-src/ext/spl/spl_iterators.h Fri May 11 00:14:36 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.h,v 1.41 2007/02/08 20:13:49 helly Exp $ */ +/* $Id: spl_iterators.h,v 1.42 2007/05/11 00:14:36 helly Exp $ */ #ifndef SPL_ITERATORS_H #define SPL_ITERATORS_H @@ -94,6 +94,7 @@ enum { /* public */ REGIT_USE_KEY= 0x0001, + REGIT_INVERTED = 0x0002, }; typedef enum { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl spl_iterators.c spl_iterators.h
helly Fri May 11 00:15:25 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/splspl_iterators.c spl_iterators.h Log: - MFH Add invert option to RegexIterator http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30.2.27r2=1.73.2.30.2.28diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30.2.27 php-src/ext/spl/spl_iterators.c:1.73.2.30.2.28 --- php-src/ext/spl/spl_iterators.c:1.73.2.30.2.27 Sun Mar 4 14:01:06 2007 +++ php-src/ext/spl/spl_iterators.c Fri May 11 00:15:25 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.73.2.30.2.27 2007/03/04 14:01:06 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.73.2.30.2.28 2007/05/11 00:15:25 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1426,6 +1426,10 @@ } } + if (intern-u.regex.flags REGIT_INVERTED) { + RETVAL_BOOL(Z_LVAL_P(return_value)); + } + if (use_copy) { efree(subject); } http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.h?r1=1.18.2.7.2.11r2=1.18.2.7.2.12diff_format=u Index: php-src/ext/spl/spl_iterators.h diff -u php-src/ext/spl/spl_iterators.h:1.18.2.7.2.11 php-src/ext/spl/spl_iterators.h:1.18.2.7.2.12 --- php-src/ext/spl/spl_iterators.h:1.18.2.7.2.11 Thu Feb 8 22:17:40 2007 +++ php-src/ext/spl/spl_iterators.h Fri May 11 00:15:25 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.h,v 1.18.2.7.2.11 2007/02/08 22:17:40 helly Exp $ */ +/* $Id: spl_iterators.h,v 1.18.2.7.2.12 2007/05/11 00:15:25 helly Exp $ */ #ifndef SPL_ITERATORS_H #define SPL_ITERATORS_H @@ -94,6 +94,7 @@ enum { /* public */ REGIT_USE_KEY= 0x0001, + REGIT_INVERTED = 0x0002, }; typedef enum { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/dba/tests bug36436.phpt /ext/dbase/tests bug31754.phpt /ext/dom/tests bug36756.phpt /ext/filter/tests bug39846.phpt /ext/ftp/tests bug27809.phpt bug37799.phpt bug394
Hello Antony, w, thanks! Monday, May 7, 2007, 7:23:05 PM, you wrote: http://cvs.php.net/viewvc.cgi/php-src/ext/dba/tests/bug36436.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/dba/tests/bug36436.phpt diff -u php-src/ext/dba/tests/bug36436.phpt:1.1 php-src/ext/dba/tests/bug36436.phpt:1.2 --- php-src/ext/dba/tests/bug36436.phpt:1.1 Sat Feb 18 16:58:50 2006 +++ php-src/ext/dba/tests/bug36436.phpt Mon May 7 17:23:02 2007 @@ -1,5 +1,5 @@ --TEST-- -Bug #36436 DBA problem with Berkeley DB4 +Bug #36436 (DBA problem with Berkeley DB4) --SKIPIF-- ?php $handler = 'db4'; http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/bug36756.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/dom/tests/bug36756.phpt diff -u php-src/ext/dom/tests/bug36756.phpt:1.3 php-src/ext/dom/tests/bug36756.phpt:1.4 --- php-src/ext/dom/tests/bug36756.phpt:1.3 Sat Aug 5 12:35:35 2006 +++ php-src/ext/dom/tests/bug36756.phpt Mon May 7 17:23:02 2007 @@ -1,5 +1,5 @@ --TEST-- -Bug #36756: (DOMDocument::removeChild corrupts node) +Bug #36756 (DOMDocument::removeChild corrupts node) --SKIPIF-- ?php require_once('skipif.inc'); ? --FILE-- http://cvs.php.net/viewvc.cgi/php-src/ext/ftp/tests/bug7216-2.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/ftp/tests/bug7216-2.phpt diff -u php-src/ext/ftp/tests/bug7216-2.phpt:1.3 php-src/ext/ftp/tests/bug7216-2.phpt:1.4 --- php-src/ext/ftp/tests/bug7216-2.phpt:1.3Fri Nov 24 15:50:45 2006 +++ php-src/ext/ftp/tests/bug7216-2.phptMon May 7 17:23:02 2007 @@ -1,5 +1,5 @@ --TEST-- -Bug #7216: ftp_mkdir returns nothing (2) +Bug #7216 (ftp_mkdir returns nothing (2)) --SKIPIF-- ?php require 'skipif.inc'; http://cvs.php.net/viewvc.cgi/php-src/ext/ftp/tests/bug37799.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/ftp/tests/bug37799.phpt diff -u php-src/ext/ftp/tests/bug37799.phpt:1.3 php-src/ext/ftp/tests/bug37799.phpt:1.4 --- php-src/ext/ftp/tests/bug37799.phpt:1.3 Wed Feb 21 19:22:56 2007 +++ php-src/ext/ftp/tests/bug37799.phpt Mon May 7 17:23:02 2007 @@ -1,5 +1,5 @@ --TEST-- -Bug #37799: ftp_ssl_connect() falls back to non-ssl connection +Bug #37799 (ftp_ssl_connect() falls back to non-ssl connection) --SKIPIF-- ?php $ssl = 1; http://cvs.php.net/viewvc.cgi/php-src/ext/ftp/tests/bug27809.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/ftp/tests/bug27809.phpt diff -u php-src/ext/ftp/tests/bug27809.phpt:1.2 php-src/ext/ftp/tests/bug27809.phpt:1.3 --- php-src/ext/ftp/tests/bug27809.phpt:1.2 Thu Nov 23 20:48:21 2006 +++ php-src/ext/ftp/tests/bug27809.phpt Mon May 7 17:23:02 2007 @@ -1,5 +1,5 @@ --TEST-- -Bug #27809: ftp_systype returns null +Bug #27809 (ftp_systype returns null) --SKIPIF-- ?php require 'skipif.inc'; http://cvs.php.net/viewvc.cgi/php-src/ext/ftp/tests/bug39583.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/ftp/tests/bug39583.phpt diff -u php-src/ext/ftp/tests/bug39583.phpt:1.3 php-src/ext/ftp/tests/bug39583.phpt:1.4 --- php-src/ext/ftp/tests/bug39583.phpt:1.3 Fri Nov 24 20:20:51 2006 +++ php-src/ext/ftp/tests/bug39583.phpt Mon May 7 17:23:02 2007 @@ -1,5 +1,5 @@ --TEST-- -Bug #39583: FTP always transfers in binary mode +Bug #39583 (FTP always transfers in binary mode) --SKIPIF-- ?php require 'skipif.inc'; http://cvs.php.net/viewvc.cgi/php-src/ext/ftp/tests/bug39458.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/ftp/tests/bug39458.phpt diff -u php-src/ext/ftp/tests/bug39458.phpt:1.2 php-src/ext/ftp/tests/bug39458.phpt:1.3 --- php-src/ext/ftp/tests/bug39458.phpt:1.2 Fri Dec 1 16:42:48 2006 +++ php-src/ext/ftp/tests/bug39458.phpt Mon May 7 17:23:02 2007 @@ -1,5 +1,5 @@ --TEST-- -Bug #39458: ftp_nlist() returns false on empty directories +Bug #39458 (ftp_nlist() returns false on empty directories) --SKIPIF-- ?php require 'skipif.inc'; http://cvs.php.net/viewvc.cgi/php-src/ext/ftp/tests/bug7216.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/ftp/tests/bug7216.phpt diff -u php-src/ext/ftp/tests/bug7216.phpt:1.2 php-src/ext/ftp/tests/bug7216.phpt:1.3 --- php-src/ext/ftp/tests/bug7216.phpt:1.2 Thu Nov 23 20:48:21 2006 +++ php-src/ext/ftp/tests/bug7216.phpt Mon May 7 17:23:02 2007 @@ -1,5 +1,5 @@ --TEST-- -Bug #7216: ftp_mkdir returns nothing +Bug #7216 (ftp_mkdir returns nothing) --SKIPIF-- ?php require 'skipif.inc'; http://cvs.php.net/viewvc.cgi/php-src/ext/ftp/tests/bug39583-2.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/ftp/tests/bug39583-2.phpt diff -u php-src/ext/ftp/tests/bug39583-2.phpt:1.2 php-src/ext/ftp/tests/bug39583-2.phpt:1.3 --- php-src/ext/ftp/tests/bug39583-2.phpt:1.2 Fri Nov 24 15:50:45 2006 +++ php-src/ext/ftp/tests/bug39583-2.phpt Mon May 7 17:23:02 2007 @@ -1,5 +1,5 @@ --TEST-- -Bug #39583: FTP always transfers in binary mode +Bug #39583 (FTP always transfers in binary mode) --SKIPIF-- ?php require 'skipif.inc';
[PHP-CVS] cvs: php-src /sapi/cli php_cli.c
helly Sat May 5 12:09:21 2007 UTC Modified files: /php-src/sapi/cli php_cli.c Log: - Simplify/use consts http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.176r2=1.177diff_format=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.176 php-src/sapi/cli/php_cli.c:1.177 --- php-src/sapi/cli/php_cli.c:1.176Fri May 4 22:09:30 2007 +++ php-src/sapi/cli/php_cli.c Sat May 5 12:09:21 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_cli.c,v 1.176 2007/05/04 22:09:30 helly Exp $ */ +/* $Id: php_cli.c,v 1.177 2007/05/05 12:09:21 helly Exp $ */ #include php.h #include php_globals.h @@ -168,10 +168,10 @@ {'-', 0, NULL} /* end of args */ }; -static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC) +static int print_module_info(zend_module_entry *module TSRMLS_DC) { php_printf(%s\n, module-name); - return 0; + return ZEND_HASH_APPLY_KEEP; } static int module_name_cmp(const void *a, const void *b TSRMLS_DC) @@ -191,14 +191,14 @@ zend_hash_init(sorted_registry, 50, NULL, NULL, 1); zend_hash_copy(sorted_registry, module_registry, NULL, tmp, sizeof(zend_module_entry)); zend_hash_sort(sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply_with_argument(sorted_registry, (apply_func_arg_t) print_module_info, NULL TSRMLS_CC); + zend_hash_apply(sorted_registry, (apply_func_t) print_module_info TSRMLS_CC); zend_hash_destroy(sorted_registry); } static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) { php_printf(%s\n, ext-name); - return 0; + return ZEND_HASH_APPLY_KEEP; } static int extension_name_cmp(const zend_llist_element **f, @@ -215,7 +215,7 @@ zend_llist_copy(sorted_exts, zend_extensions); sorted_exts.dtor = NULL; zend_llist_sort(sorted_exts, extension_name_cmp TSRMLS_CC); - zend_llist_apply_with_argument(sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC); + zend_llist_apply(sorted_exts, (llist_apply_func_t) print_extension_info TSRMLS_CC); zend_llist_destroy(sorted_exts); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / acinclude.m4
helly Sat May 5 12:14:20 2007 UTC Modified files: /php-srcacinclude.m4 Log: - Fix re2c check and bump requirement to 0.12.0 http://cvs.php.net/viewvc.cgi/php-src/acinclude.m4?r1=1.363r2=1.364diff_format=u Index: php-src/acinclude.m4 diff -u php-src/acinclude.m4:1.363 php-src/acinclude.m4:1.364 --- php-src/acinclude.m4:1.363 Sun Mar 25 10:21:43 2007 +++ php-src/acinclude.m4Sat May 5 12:14:20 2007 @@ -1,5 +1,5 @@ dnl -dnl $Id: acinclude.m4,v 1.363 2007/03/25 10:21:43 sniper Exp $ +dnl $Id: acinclude.m4,v 1.364 2007/05/05 12:14:20 helly Exp $ dnl dnl This file contains local autoconf functions. dnl @@ -2067,11 +2067,11 @@ AC_CHECK_PROG(RE2C, re2c, re2c) if test -n $RE2C; then AC_CACHE_CHECK([for re2c version], php_cv_re2c_version, [ - re2c_vernum=`echo | re2c --vernum 2/dev/null` - if test -z $re2c_vernum || test $re2c_vernum -lt 911; then + re2c_vernum=`re2c --vernum 2/dev/null` + if test -z $re2c_vernum || test $re2c_vernum -lt 1200; then php_cv_re2c_version=invalid else -php_cv_re2c_version=`echo | re2c --version | cut -d ' ' -f 2 2/dev/null` (ok) +php_cv_re2c_version=`re2c --version | cut -d ' ' -f 2 2/dev/null` (ok) fi ]) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / acinclude.m4
helly Sat May 5 12:24:46 2007 UTC Modified files: /php-srcacinclude.m4 Log: - Update version in error message as well http://cvs.php.net/viewvc.cgi/php-src/acinclude.m4?r1=1.364r2=1.365diff_format=u Index: php-src/acinclude.m4 diff -u php-src/acinclude.m4:1.364 php-src/acinclude.m4:1.365 --- php-src/acinclude.m4:1.364 Sat May 5 12:14:20 2007 +++ php-src/acinclude.m4Sat May 5 12:24:45 2007 @@ -1,5 +1,5 @@ dnl -dnl $Id: acinclude.m4,v 1.364 2007/05/05 12:14:20 helly Exp $ +dnl $Id: acinclude.m4,v 1.365 2007/05/05 12:24:45 helly Exp $ dnl dnl This file contains local autoconf functions. dnl @@ -2077,7 +2077,7 @@ fi case $php_cv_re2c_version in |invalid[)] - AC_MSG_WARN([You will need re2c 0.9.11 or later if you want to regenerate PHP parsers.]) + AC_MSG_WARN([You will need re2c 0.12.0 or later if you want to regenerate PHP parsers.]) RE2C=exit 0; ;; esac -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cli php_cli.c
helly Sat May 5 12:46:30 2007 UTC Modified files: /php-src/sapi/cli php_cli.c Log: - Fix function signature http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.177r2=1.178diff_format=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.177 php-src/sapi/cli/php_cli.c:1.178 --- php-src/sapi/cli/php_cli.c:1.177Sat May 5 12:09:21 2007 +++ php-src/sapi/cli/php_cli.c Sat May 5 12:46:30 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_cli.c,v 1.177 2007/05/05 12:09:21 helly Exp $ */ +/* $Id: php_cli.c,v 1.178 2007/05/05 12:46:30 helly Exp $ */ #include php.h #include php_globals.h @@ -195,7 +195,7 @@ zend_hash_destroy(sorted_registry); } -static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) +static int print_extension_info(zend_extension *ext TSRMLS_DC) { php_printf(%s\n, ext-name); return ZEND_HASH_APPLY_KEEP; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /sapi/cli php_cli.c
helly Sat May 5 16:21:07 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/sapi/cli php_cli.c Log: - MFH --ri does not require ext/Reflection - MFH --ini to show ini files being used http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.129.2.13.2.18r2=1.129.2.13.2.19diff_format=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.129.2.13.2.18 php-src/sapi/cli/php_cli.c:1.129.2.13.2.19 --- php-src/sapi/cli/php_cli.c:1.129.2.13.2.18 Wed Apr 25 09:56:29 2007 +++ php-src/sapi/cli/php_cli.c Sat May 5 16:21:07 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_cli.c,v 1.129.2.13.2.18 2007/04/25 09:56:29 bjori Exp $ */ +/* $Id: php_cli.c,v 1.129.2.13.2.19 2007/05/05 16:21:07 helly Exp $ */ #include php.h #include php_globals.h @@ -91,6 +91,9 @@ #include php_getopt.h +PHPAPI extern char *php_ini_opened_path; +PHPAPI extern char *php_ini_scanned_files; + #ifndef O_BINARY #define O_BINARY 0 #endif @@ -106,6 +109,7 @@ #define PHP_MODE_REFLECTION_CLASS 9 #define PHP_MODE_REFLECTION_EXTENSION 10 #define PHP_MODE_REFLECTION_EXT_INFO11 +#define PHP_MODE_SHOW_INI_CONFIG12 #define HARDCODED_INI \ html_errors=0\n \ @@ -153,16 +157,17 @@ {11, 1, rclass}, {12, 1, re}, {12, 1, rextension}, +#endif {13, 1, ri}, {13, 1, rextinfo}, -#endif + {14, 0, ini}, {'-', 0, NULL} /* end of args */ }; -static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC) +static int print_module_info(zend_module_entry *module TSRMLS_DC) { php_printf(%s\n, module-name); - return 0; + return ZEND_HASH_APPLY_KEEP; } static int module_name_cmp(const void *a, const void *b TSRMLS_DC) @@ -182,14 +187,14 @@ zend_hash_init(sorted_registry, 50, NULL, NULL, 1); zend_hash_copy(sorted_registry, module_registry, NULL, tmp, sizeof(zend_module_entry)); zend_hash_sort(sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); - zend_hash_apply_with_argument(sorted_registry, (apply_func_arg_t) print_module_info, NULL TSRMLS_CC); + zend_hash_apply(sorted_registry, (apply_func_t) print_module_info TSRMLS_CC); zend_hash_destroy(sorted_registry); } static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) { php_printf(%s\n, ext-name); - return 0; + return ZEND_HASH_APPLY_KEEP; } static int extension_name_cmp(const zend_llist_element **f, @@ -206,7 +211,7 @@ zend_llist_copy(sorted_exts, zend_extensions); sorted_exts.dtor = NULL; zend_llist_sort(sorted_exts, extension_name_cmp TSRMLS_CC); - zend_llist_apply_with_argument(sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC); + zend_llist_apply(sorted_exts, (llist_apply_func_t) print_extension_info TSRMLS_CC); zend_llist_destroy(sorted_exts); } @@ -448,13 +453,15 @@ args... Arguments passed to script. Use -- args when first argument\n starts with - or script is read from stdin\n \n + --iniShow configuration file names\n + \n #if (HAVE_REFLECTION) --rf name Show information about function name.\n --rc name Show information about class name.\n --re name Show information about extension name.\n +#endif --ri name Show configuration for extension name.\n \n -#endif , prog, prog, prog, prog, prog, prog); } /* }}} */ @@ -959,11 +966,14 @@ behavior=PHP_MODE_REFLECTION_EXTENSION; reflection_what = php_optarg; break; +#endif case 13: behavior=PHP_MODE_REFLECTION_EXT_INFO; reflection_what = php_optarg; break; -#endif + case 14: + behavior = PHP_MODE_SHOW_INI_CONFIG; + break; default: break; } @@ -1231,6 +1241,8 @@ zend_execute_data execute_data; switch (behavior) { + default: + break; case
[PHP-CVS] cvs: php-src /sapi/cli php_cli.c
helly Fri May 4 22:09:31 2007 UTC Modified files: /php-src/sapi/cli php_cli.c Log: - WS/CS http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.175r2=1.176diff_format=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.175 php-src/sapi/cli/php_cli.c:1.176 --- php-src/sapi/cli/php_cli.c:1.175Wed Apr 25 09:53:20 2007 +++ php-src/sapi/cli/php_cli.c Fri May 4 22:09:30 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_cli.c,v 1.175 2007/04/25 09:53:20 bjori Exp $ */ +/* $Id: php_cli.c,v 1.176 2007/05/04 22:09:30 helly Exp $ */ #include php.h #include php_globals.h @@ -1306,7 +1306,7 @@ zend_module_entry *module; if (zend_hash_find(module_registry, lcname, len+1, (void**)module) == FAILURE) { - if(!strcmp(reflection_what, main)) { + if (!strcmp(reflection_what, main)) { display_ini_entries(NULL); } else { zend_printf(Extension '%s' not present.\n, reflection_what); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cli php.1.in php_cli.c
helly Mon Apr 23 20:17:20 2007 UTC Modified files: /php-src/sapi/cli php.1.in php_cli.c Log: - Add 'php --ini' to CLI which returns the INI file/dir configuration http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php.1.in?r1=1.17r2=1.18diff_format=u Index: php-src/sapi/cli/php.1.in diff -u php-src/sapi/cli/php.1.in:1.17 php-src/sapi/cli/php.1.in:1.18 --- php-src/sapi/cli/php.1.in:1.17 Tue Jan 23 20:02:29 2007 +++ php-src/sapi/cli/php.1.in Mon Apr 23 20:17:19 2007 @@ -304,6 +304,9 @@ .IR name Shows configuration for extension .B name +.TP +.B \-\-ini +Show ini configuration files .SH FILES .TP 15 .B php\-cli.ini http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.171r2=1.172diff_format=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.171 php-src/sapi/cli/php_cli.c:1.172 --- php-src/sapi/cli/php_cli.c:1.171Tue Apr 17 19:48:16 2007 +++ php-src/sapi/cli/php_cli.c Mon Apr 23 20:17:19 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_cli.c,v 1.171 2007/04/17 19:48:16 sniper Exp $ */ +/* $Id: php_cli.c,v 1.172 2007/04/23 20:17:19 helly Exp $ */ #include php.h #include php_globals.h @@ -91,21 +91,29 @@ #include php_getopt.h +PHPAPI extern char *php_ini_opened_path; +PHPAPI extern char *php_ini_scanned_files; + #ifndef O_BINARY #define O_BINARY 0 #endif -#define PHP_MODE_STANDARD 1 -#define PHP_MODE_HIGHLIGHT 2 -#define PHP_MODE_INDENT3 -#define PHP_MODE_LINT 4 -#define PHP_MODE_STRIP 5 -#define PHP_MODE_CLI_DIRECT6 -#define PHP_MODE_PROCESS_STDIN 7 -#define PHP_MODE_REFLECTION_FUNCTION8 -#define PHP_MODE_REFLECTION_CLASS 9 -#define PHP_MODE_REFLECTION_EXTENSION 10 -#define PHP_MODE_REFLECTION_EXT_INFO11 +enum behavior_mode { + PHP_MODE_STANDARD, + PHP_MODE_HIGHLIGHT, +#if 0 /* not yet operational, see also below ... */ + PHP_MODE_INDENT, +#endif + PHP_MODE_LINT, + PHP_MODE_STRIP, + PHP_MODE_CLI_DIRECT, + PHP_MODE_PROCESS_STDIN, + PHP_MODE_REFLECTION_FUNCTION, + PHP_MODE_REFLECTION_CLASS, + PHP_MODE_REFLECTION_EXTENSION, + PHP_MODE_REFLECTION_EXT_INFO, + PHP_MODE_SHOW_INI_CONFIG +}; #define HARDCODED_INI \ html_errors=0\n \ @@ -153,9 +161,10 @@ {11, 1, rclass}, {12, 1, re}, {12, 1, rextension}, +#endif {13, 1, ri}, {13, 1, rextinfo}, -#endif + {14, 0, ini}, {'-', 0, NULL} /* end of args */ }; @@ -459,13 +468,15 @@ args... Arguments passed to script. Use -- args when first argument\n starts with - or script is read from stdin\n \n + --iniShow ini configuration files\n + \n #if (HAVE_REFLECTION) --rf name Show information about function name.\n --rc name Show information about class name.\n --re name Show information about extension name.\n +#endif --ri name Show configuration for extension name.\n \n -#endif , prog, prog, prog, prog, prog, prog); } /* }}} */ @@ -583,7 +594,7 @@ int c; zend_file_handle file_handle; /* temporary locals */ - int behavior=PHP_MODE_STANDARD; + enum behavior_mode behavior = PHP_MODE_STANDARD; #ifdef HAVE_REFLECTION char *reflection_what = NULL; #endif @@ -971,11 +982,14 @@ behavior=PHP_MODE_REFLECTION_EXTENSION; reflection_what = php_optarg; break; +#endif case 13: behavior=PHP_MODE_REFLECTION_EXT_INFO; reflection_what = php_optarg; break; -#endif + case 14: + behavior = PHP_MODE_SHOW_INI_CONFIG; + break; default: break; } @@ -1243,6 +1257,8 @@ zend_execute_data execute_data; switch (behavior) { + default: + break; case PHP_MODE_REFLECTION_FUNCTION: if (strstr(reflection_what, ::)) { pce =
Re: [PHP-CVS] cvs: php-src /sapi/cli php.1.in php_cli.c
Hello doc, besides adding --ini this patch alwaysmakes --ri available evenwithout reflection. best regards marcus Monday, April 23, 2007, 10:17:20 PM, you wrote: helly Mon Apr 23 20:17:20 2007 UTC Modified files: /php-src/sapi/cli php.1.in php_cli.c Log: - Add 'php --ini' to CLI which returns the INI file/dir configuration http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php.1.in?r1=1.17r2=1.18diff_format=u Index: php-src/sapi/cli/php.1.in diff -u php-src/sapi/cli/php.1.in:1.17 php-src/sapi/cli/php.1.in:1.18 --- php-src/sapi/cli/php.1.in:1.17 Tue Jan 23 20:02:29 2007 +++ php-src/sapi/cli/php.1.in Mon Apr 23 20:17:19 2007 @@ -304,6 +304,9 @@ .IR name Shows configuration for extension .B name +.TP +.B \-\-ini +Show ini configuration files .SH FILES .TP 15 .B php\-cli.ini http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.171r2=1.172diff_format=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.171 php-src/sapi/cli/php_cli.c:1.172 --- php-src/sapi/cli/php_cli.c:1.171Tue Apr 17 19:48:16 2007 +++ php-src/sapi/cli/php_cli.c Mon Apr 23 20:17:19 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_cli.c,v 1.171 2007/04/17 19:48:16 sniper Exp $ */ +/* $Id: php_cli.c,v 1.172 2007/04/23 20:17:19 helly Exp $ */ #include php.h #include php_globals.h @@ -91,21 +91,29 @@ #include php_getopt.h +PHPAPI extern char *php_ini_opened_path; +PHPAPI extern char *php_ini_scanned_files; + #ifndef O_BINARY #define O_BINARY 0 #endif -#define PHP_MODE_STANDARD 1 -#define PHP_MODE_HIGHLIGHT 2 -#define PHP_MODE_INDENT3 -#define PHP_MODE_LINT 4 -#define PHP_MODE_STRIP 5 -#define PHP_MODE_CLI_DIRECT6 -#define PHP_MODE_PROCESS_STDIN 7 -#define PHP_MODE_REFLECTION_FUNCTION8 -#define PHP_MODE_REFLECTION_CLASS 9 -#define PHP_MODE_REFLECTION_EXTENSION 10 -#define PHP_MODE_REFLECTION_EXT_INFO11 +enum behavior_mode { + PHP_MODE_STANDARD, + PHP_MODE_HIGHLIGHT, +#if 0 /* not yet operational, see also below ... */ + PHP_MODE_INDENT, +#endif + PHP_MODE_LINT, + PHP_MODE_STRIP, + PHP_MODE_CLI_DIRECT, + PHP_MODE_PROCESS_STDIN, + PHP_MODE_REFLECTION_FUNCTION, + PHP_MODE_REFLECTION_CLASS, + PHP_MODE_REFLECTION_EXTENSION, + PHP_MODE_REFLECTION_EXT_INFO, + PHP_MODE_SHOW_INI_CONFIG +}; #define HARDCODED_INI \ html_errors=0\n \ @@ -153,9 +161,10 @@ {11, 1, rclass}, {12, 1, re}, {12, 1, rextension}, +#endif {13, 1, ri}, {13, 1, rextinfo}, -#endif + {14, 0, ini}, {'-', 0, NULL} /* end of args */ }; @@ -459,13 +468,15 @@ args... Arguments passed to script. Use -- args when first argument\n starts with - or script is read from stdin\n \n + --iniShow ini configuration files\n + \n #if (HAVE_REFLECTION) --rf name Show information about function name.\n --rc name Show information about class name.\n --re name Show information about extension name.\n +#endif --ri name Show configuration for extension name.\n \n -#endif , prog, prog, prog, prog, prog, prog); } /* }}} */ @@ -583,7 +594,7 @@ int c; zend_file_handle file_handle; /* temporary locals */ - int behavior=PHP_MODE_STANDARD; + enum behavior_mode behavior = PHP_MODE_STANDARD; #ifdef HAVE_REFLECTION char *reflection_what = NULL; #endif @@ -971,11 +982,14 @@ behavior=PHP_MODE_REFLECTION_EXTENSION; reflection_what = php_optarg; break; +#endif case 13: behavior=PHP_MODE_REFLECTION_EXT_INFO; reflection_what = php_optarg; break; -#endif + case 14: + behavior = PHP_MODE_SHOW_INI_CONFIG; + break; default: break; } @@ -1243,6 +1257,8 @@ zend_execute_data execute_data; switch (behavior) { + default: +
[PHP-CVS] cvs: php-src /sapi/cli php.1.in php_cli.c
helly Mon Apr 23 20:47:58 2007 UTC Modified files: /php-src/sapi/cli php.1.in php_cli.c Log: - Rephrase as suggested by Chris Jones http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php.1.in?r1=1.18r2=1.19diff_format=u Index: php-src/sapi/cli/php.1.in diff -u php-src/sapi/cli/php.1.in:1.18 php-src/sapi/cli/php.1.in:1.19 --- php-src/sapi/cli/php.1.in:1.18 Mon Apr 23 20:17:19 2007 +++ php-src/sapi/cli/php.1.in Mon Apr 23 20:47:58 2007 @@ -306,7 +306,7 @@ .B name .TP .B \-\-ini -Show ini configuration files +Show configuration file names .SH FILES .TP 15 .B php\-cli.ini http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.172r2=1.173diff_format=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.172 php-src/sapi/cli/php_cli.c:1.173 --- php-src/sapi/cli/php_cli.c:1.172Mon Apr 23 20:17:19 2007 +++ php-src/sapi/cli/php_cli.c Mon Apr 23 20:47:58 2007 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_cli.c,v 1.172 2007/04/23 20:17:19 helly Exp $ */ +/* $Id: php_cli.c,v 1.173 2007/04/23 20:47:58 helly Exp $ */ #include php.h #include php_globals.h @@ -468,7 +468,7 @@ args... Arguments passed to script. Use -- args when first argument\n starts with - or script is read from stdin\n \n - --iniShow ini configuration files\n + --iniShow configuration file names\n \n #if (HAVE_REFLECTION) --rf name Show information about function name.\n -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cgi getopt.c /sapi/cli getopt.c
helly Sun Apr 22 15:24:19 2007 UTC Modified files: /php-src/sapi/cgi getopt.c /php-src/sapi/cli getopt.c Log: - Merge getopt fixes from re2c http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/getopt.c?r1=1.12r2=1.13diff_format=u Index: php-src/sapi/cgi/getopt.c diff -u php-src/sapi/cgi/getopt.c:1.12 php-src/sapi/cgi/getopt.c:1.13 --- php-src/sapi/cgi/getopt.c:1.12 Sun Apr 15 22:54:26 2007 +++ php-src/sapi/cgi/getopt.c Sun Apr 22 15:24:19 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: getopt.c,v 1.12 2007/04/15 22:54:26 sniper Exp $ */ +/* $Id: getopt.c,v 1.13 2007/04/22 15:24:19 helly Exp $ */ #include stdio.h #include string.h @@ -107,6 +107,7 @@ (*optind)++; return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); } + arg_start = 1 + optchr; } if (opts_idx 0) { while (1) { @@ -120,6 +121,7 @@ (*optind)++; } else { optchr++; + arg_start++; } return(php_opt_error(argc, argv, errind, errchr, OPTERRNF, show_err)); } else if (argv[*optind][optchr] == opts[opts_idx].opt_char) { @@ -143,7 +145,7 @@ } return opts[opts_idx].opt_char; } else { - if (arg_start == 2) { + if (arg_start = 2) { if (!argv[*optind][optchr+1]) { dash = 0; http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/getopt.c?r1=1.12r2=1.13diff_format=u Index: php-src/sapi/cli/getopt.c diff -u php-src/sapi/cli/getopt.c:1.12 php-src/sapi/cli/getopt.c:1.13 --- php-src/sapi/cli/getopt.c:1.12 Thu Mar 22 21:34:58 2007 +++ php-src/sapi/cli/getopt.c Sun Apr 22 15:24:19 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: getopt.c,v 1.12 2007/03/22 21:34:58 johannes Exp $ */ +/* $Id: getopt.c,v 1.13 2007/04/22 15:24:19 helly Exp $ */ #include stdio.h #include string.h @@ -107,6 +107,7 @@ (*optind)++; return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); } + arg_start = 1 + optchr; } if (opts_idx 0) { while (1) { @@ -120,6 +121,7 @@ (*optind)++; } else { optchr++; + arg_start++; } return(php_opt_error(argc, argv, errind, errchr, OPTERRNF, show_err)); } else if (argv[*optind][optchr] == opts[opts_idx].opt_char) { @@ -143,7 +145,7 @@ } return opts[opts_idx].opt_char; } else { - if (arg_start == 2) { + if (arg_start = 2) { if (!argv[*optind][optchr+1]) { dash = 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS
helly Sun Apr 22 15:33:43 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: - BFN http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.656r2=1.2027.2.547.2.657diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.656 php-src/NEWS:1.2027.2.547.2.657 --- php-src/NEWS:1.2027.2.547.2.656 Sun Apr 22 15:19:08 2007 +++ php-src/NEWSSun Apr 22 15:33:43 2007 @@ -1,7 +1,9 @@ PHPNEWS ||| ?? Apr 2007, PHP 5.2.2RC2 +- Fixed commandline handling fro CLI and CGI. (Marcus, Johannes) - Upgraded SQLite 3 to version 3.3.16 (Ilia) +- Updated timezone database to version 2007.5. (Derick) - Fixed bug #41159 (mysql_pconnect() hash does not account for connect flags). (Ilia) - Fixed bug #41121 (range() overflow handling for large numbers on 32bit @@ -29,7 +31,6 @@ - Fixed bug #39965 (Latitude and longitude are backwards in date_sun_info()). (Derick) - Fixed bug #39416 (Milliseconds in date()). (Derick) -- Updated timezone database to version 2007.5. (Derick) 10 Apr 2007, PHP 5.2.2RC1 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cli/tests 003-2.phpt
helly Sun Apr 22 15:29:20 2007 UTC Added files: /php-src/sapi/cli/tests 003-2.phpt Log: - Add new test http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/tests/003-2.phpt?view=markuprev=1.1 Index: php-src/sapi/cli/tests/003-2.phpt +++ php-src/sapi/cli/tests/003-2.phpt --TEST-- defining INI options with -d (as 2nd arg) --SKIPIF-- ?php include skipif.inc; if (substr(PHP_OS, 0, 3) == 'WIN') { die (skip not for Windows); } ? --FILE-- ?php $php = getenv('TEST_PHP_EXECUTABLE'); var_dump(`$php -nd max_execution_time=111 -r 'var_dump(ini_get(max_execution_time));'`); var_dump(`$php -nd max_execution_time=500 -r 'var_dump(ini_get(max_execution_time));'`); ? ===DONE=== --EXPECTF-- string(16) string(3) 111 string(16) string(3) 500 ===DONE=== -- 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.php /ext/spl/internal recursiveiterator.inc seekableiterator.inc
helly Tue Apr 17 06:31:19 2007 UTC Modified files: /php-src/ext/splspl.php /php-src/ext/spl/internal recursiveiterator.inc seekableiterator.inc Log: - Fix #41109: recursiveiterator.inc says 'implements' Iterator instead of 'extends' http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl.php?r1=1.78r2=1.79diff_format=u Index: php-src/ext/spl/spl.php diff -u php-src/ext/spl/spl.php:1.78 php-src/ext/spl/spl.php:1.79 --- php-src/ext/spl/spl.php:1.78Mon Feb 26 22:32:57 2007 +++ php-src/ext/spl/spl.php Tue Apr 17 06:31:19 2007 @@ -32,12 +32,12 @@ * * SPL offers some advanced iterator algorithms: * - * - interface RecursiveIterator implements Iterator + * - interface RecursiveIterator extends Iterator * - interface OuterIterator extends Iterator * - class RecursiveIteratorIterator implements OuterIterator * - abstract class FilterIterator implements OuterIterator * - class ParentIterator extends FilterIterator implements RecursiveIterator - * - interface SeekableIterator implements Iterator + * - interface SeekableIterator extends Iterator * - class LimitIterator implements OuterIterator * - class CachingIterator implements OuterIterator * - class RecursiveCachingIterator extends CachingIterator implements RecursiveIterator http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/recursiveiterator.inc?r1=1.7r2=1.8diff_format=u Index: php-src/ext/spl/internal/recursiveiterator.inc diff -u php-src/ext/spl/internal/recursiveiterator.inc:1.7 php-src/ext/spl/internal/recursiveiterator.inc:1.8 --- php-src/ext/spl/internal/recursiveiterator.inc:1.7 Tue Feb 21 23:21:53 2006 +++ php-src/ext/spl/internal/recursiveiterator.inc Tue Apr 17 06:31:19 2007 @@ -15,7 +15,7 @@ * @version 1.0 * @since PHP 5.0 */ -interface RecursiveIterator implements Iterator +interface RecursiveIterator extends Iterator { /** @return whether the current element has children */ http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/seekableiterator.inc?r1=1.7r2=1.8diff_format=u Index: php-src/ext/spl/internal/seekableiterator.inc diff -u php-src/ext/spl/internal/seekableiterator.inc:1.7 php-src/ext/spl/internal/seekableiterator.inc:1.8 --- php-src/ext/spl/internal/seekableiterator.inc:1.7 Tue Feb 21 23:21:53 2006 +++ php-src/ext/spl/internal/seekableiterator.inc Tue Apr 17 06:31:19 2007 @@ -18,7 +18,7 @@ * to seek on an iterator LimitIterator can use this to efficiently rewind * to offset. */ -interface SeekableIterator implements Iterator +interface SeekableIterator extends Iterator { /** Seek to an absolute position * -- 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_2) /ext/gd config.w32 gd.c php_gd.h
Hello Edin, either way it is ridiculous to add new features in the middle of a releace process. We are not only in a release branch here. We are even in a middle of a release. In one that is even security focused. best regards marcus Tuesday, April 17, 2007, 8:27:50 PM, you wrote: On 17/04/2007, at 20.01, Antony Dovgal wrote: On 04/17/2007 09:53 PM, Pierre Joye wrote: On 4/17/07, Antony Dovgal [EMAIL PROTECTED] wrote: On 04/17/2007 09:29 PM, Marcus Boerger wrote: Hello Pierre-Alain, since when are we adding major new features to release branches? Pierre, please leave this function for HEAD only, we don't add new features to 5.2. Well, do you really see a problem in these two self contained functions? They don't affect anything else in ext/gd or php and are on windows only. Don't get me wrong, it's not about you or the functions. We have some rules and I believe everybody should abide by them. Hi Antony, Marcus, This is simply not true. 5.2.x is not simply bug fix release. Minor and major functionality is added all the time. If you're too lazy to read the CVS I can list them for you. So please don't comment on commits based on who is making them. Edin Best regards, Marcus -- 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_2) /ext/gd config.w32 gd.c php_gd.h
Hello Derick, Tuesday, April 17, 2007, 8:58:40 PM, you wrote: On Tue, 17 Apr 2007, Antony Dovgal wrote: On 04/17/2007 09:29 PM, Marcus Boerger wrote: Hello Pierre-Alain, since when are we adding major new features to release branches? Pierre, please leave this function for HEAD only, we don't add new features to 5.2. That's not true - we added many functions. I see no problems with those two new functions, but I think it'd be smarter to introduce them in 5.2.3 as we just released an RC. I don't think we should *then* add more functions as with this we need to keep releasing new RCs. Fine with me. Though personally I hope we create 5.3 from 5.2.2 and avoid this kind of discussion. best regards marcus -- 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_2) /ext/standard proc_open.c /main SAPI.c main.c php_ini.c /main/streams plain_wrapper.c /win32 select.c /win32/build config.w32 TSRM TSRM.h tsrm_win32.c ZendEngi
Hello Dmitry, same here. Itis kind of a big change. Are we in any desperate need to do this right now? Basically we have no experience with Win64/PHP at all. So we shouldn't go for it in the middle of a release process. best regards marcus Tuesday, April 17, 2007, 8:52:01 PM, you wrote: On Mon, 16 Apr 2007, Dmitry Stogov wrote: dmitryMon Apr 16 08:09:57 2007 UTC Modified files: (Branch: PHP_5_2) /TSRM TSRM.h tsrm_win32.c /ZendEngine2 zend_API.c zend_API.h zend_alloc.c zend_builtin_functions.c zend_compile.c zend_execute.c zend_execute.h zend_execute_API.c zend_ini.c zend_opcode.c zend_types.h zend_vm_def.h zend_vm_execute.h /php-src/ext/standard proc_open.c /php-src/main SAPI.c main.c php_ini.c /php-src/main/streams plain_wrapper.c /php-src/win32select.c /php-src/win32/build config.w32 Log: WIN64 support This patch looks sort of dangerous, are you sure you want to add this to PHP 5.2.2 after the first RC has already been released? IMO this would fit much better in an upcoming PHP 5.3. Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org Best regards, Marcus -- 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_2) /ext/gd config.w32 gd.c php_gd.h
Hello Edin, it appears i should read cvs commits more carefully. I thought that win64 change was a pretty easy one not affecting anything else. Reviewing it again i get a different opinion. And sorry but I can't care less about FCGI and whether someone moves stuff from CLI to FCGI. Or did jani do more than we were discussing? best regards marcus And for the record. The stuff Pierre added is cool and yes I am even a windows user Tuesday, April 17, 2007, 9:09:34 PM, you wrote: Hello Marcus, Did I miss your mail to Dmitry about making *major* engine changes to add Win64 support? I must also have lost your mail to Jani for adding new features to FastCGI too? I think I need to double check my spam filter. Or was your response more in regard of *who* committed it than *what* was committed (major engine change versus two self-contained windows only functions)? Edin On 17/04/2007, at 20.51, Marcus Boerger wrote: Hello Edin, either way it is ridiculous to add new features in the middle of a releace process. We are not only in a release branch here. We are even in a middle of a release. In one that is even security focused. best regards marcus Tuesday, April 17, 2007, 8:27:50 PM, you wrote: On 17/04/2007, at 20.01, Antony Dovgal wrote: On 04/17/2007 09:53 PM, Pierre Joye wrote: On 4/17/07, Antony Dovgal [EMAIL PROTECTED] wrote: On 04/17/2007 09:29 PM, Marcus Boerger wrote: Hello Pierre-Alain, since when are we adding major new features to release branches? Pierre, please leave this function for HEAD only, we don't add new features to 5.2. Well, do you really see a problem in these two self contained functions? They don't affect anything else in ext/gd or php and are on windows only. Don't get me wrong, it's not about you or the functions. We have some rules and I believe everybody should abide by them. Hi Antony, Marcus, This is simply not true. 5.2.x is not simply bug fix release. Minor and major functionality is added all the time. If you're too lazy to read the CVS I can list them for you. So please don't comment on commits based on who is making them. Edin Best regards, Marcus Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/dba/libcdb cdb.c
helly Sat Apr 14 11:14:40 2007 UTC Modified files: /php-src/ext/dba/libcdb cdb.c Log: - Fix warning http://cvs.php.net/viewvc.cgi/php-src/ext/dba/libcdb/cdb.c?r1=1.13r2=1.14diff_format=u Index: php-src/ext/dba/libcdb/cdb.c diff -u php-src/ext/dba/libcdb/cdb.c:1.13 php-src/ext/dba/libcdb/cdb.c:1.14 --- php-src/ext/dba/libcdb/cdb.c:1.13 Mon Jan 1 09:29:23 2007 +++ php-src/ext/dba/libcdb/cdb.cSat Apr 14 11:14:40 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: cdb.c,v 1.13 2007/01/01 09:29:23 sebastian Exp $ */ +/* $Id: cdb.c,v 1.14 2007/04/14 11:14:40 helly Exp $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ @@ -68,7 +68,7 @@ uint32 cdb_hash(char *buf, unsigned int len) { uint32 h; - const unsigned char * b = buf; + const unsigned char * b = (unsigned char *)buf; h = CDB_HASHSTART; while (len--) { @@ -189,6 +189,6 @@ /* {{{ cdb_version */ char *cdb_version() { - return 0.75, $Revision: 1.13 $; + return 0.75, $Revision: 1.14 $; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/dba/libcdb cdb.c
helly Sat Apr 14 11:15:13 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/dba/libcdb cdb.c Log: - MFH Fix warning http://cvs.php.net/viewvc.cgi/php-src/ext/dba/libcdb/cdb.c?r1=1.10.2.1.2.2r2=1.10.2.1.2.3diff_format=u Index: php-src/ext/dba/libcdb/cdb.c diff -u php-src/ext/dba/libcdb/cdb.c:1.10.2.1.2.2 php-src/ext/dba/libcdb/cdb.c:1.10.2.1.2.3 --- php-src/ext/dba/libcdb/cdb.c:1.10.2.1.2.2 Mon Jan 1 09:36:00 2007 +++ php-src/ext/dba/libcdb/cdb.cSat Apr 14 11:15:13 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: cdb.c,v 1.10.2.1.2.2 2007/01/01 09:36:00 sebastian Exp $ */ +/* $Id: cdb.c,v 1.10.2.1.2.3 2007/04/14 11:15:13 helly Exp $ */ /* incorporated from D.J.Bernstein's cdb-0.75 (http://cr.yp.to/cdb.html)*/ @@ -68,7 +68,7 @@ uint32 cdb_hash(char *buf, unsigned int len) { uint32 h; - const unsigned char * b = buf; + const unsigned char * b = (unsigned char *)buf; h = CDB_HASHSTART; while (len--) { @@ -189,6 +189,6 @@ /* {{{ cdb_version */ char *cdb_version() { - return 0.75, $Revision: 1.10.2.1.2.2 $; + return 0.75, $Revision: 1.10.2.1.2.3 $; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /main snprintf.c
Hello Antony, under windows, where this is coming from (iirc), there is __int64. Is that mapped to SIZEOF_LONG_LONG and don't you need to check for the actual value being 8? best regards marcus Friday, April 13, 2007, 12:00:56 AM, you wrote: tony2001Thu Apr 12 22:00:56 2007 UTC Modified files: /php-src/main snprintf.c Log: add support for %I64(u|d) to sprintf() utilities http://cvs.php.net/viewvc.cgi/php-src/main/snprintf.c?r1=1.54r2=1.55diff_format=u Index: php-src/main/snprintf.c diff -u php-src/main/snprintf.c:1.54 php-src/main/snprintf.c:1.55 --- php-src/main/snprintf.c:1.54Mon Apr 9 15:35:49 2007 +++ php-src/main/snprintf.c Thu Apr 12 22:00:56 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: snprintf.c,v 1.54 2007/04/09 15:35:49 dmitry Exp $ */ +/* $Id: snprintf.c,v 1.55 2007/04/12 22:00:56 tony2001 Exp $ */ #include php.h @@ -706,6 +706,16 @@ fmt++; modifier = LM_LONG_DOUBLE; break; + case 'I': + fmt++; +#if SIZEOF_LONG_LONG + if (*fmt == '6' *(fmt+1) == '4') { + fmt += 2; + modifier = LM_LONG_LONG; + } else +#endif + modifier = LM_LONG; + break; case 'l': fmt++; #if SIZEOF_LONG_LONG Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct php_sybase_ct.c
helly Tue Apr 10 15:50:34 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct php_sybase_ct.c Log: - Cleanup the cleanup http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.11r2=1.103.2.5.2.12diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.11 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.12 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.11Wed Mar 14 11:48:49 2007 +++ php-src/ext/sybase_ct/php_sybase_ct.c Tue Apr 10 15:50:34 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.11 2007/03/14 11:48:49 thekid Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.12 2007/04/10 15:50:34 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -135,6 +135,9 @@ return 0; } +#define efree_n(x) { efree(x); x = NULL; } +#define efree_if(x) if (x) efree_n(x) + static void _free_sybase_result(sybase_result *result) { int i, j; @@ -157,6 +160,19 @@ efree(result-fields); } +if (result-tmp_buffer) { +for (i=0; iresult-num_fields; i++) { +efree(result-tmp_buffer[i]); +} +efree(result-tmp_buffer); +} + + efree_if(result-lengths); + efree_if(result-indicators); + efree_if(result-datafmt); + efree_if(result-numerics); + efree_if(result-types); + efree(result); } @@ -246,7 +262,7 @@ TSRMLS_FETCH(); if (CS_SEVERITY(errmsg-msgnumber) = SybCtG(min_client_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %d), errmsg-msgstring, CS_SEVERITY(errmsg-msgnumber)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %ld), errmsg-msgstring, CS_SEVERITY(errmsg-msgnumber)); } STR_FREE(SybCtG(server_message)); SybCtG(server_message) = estrdup(errmsg-msgstring); @@ -351,8 +367,8 @@ /* Spit out a warning if neither of them has handled this message */ if (!handled) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Server message: %s (severity %d, procedure %s), - srvmsg-text, srvmsg-severity, ((srvmsg-proclen0) ? srvmsg-proc : N/A)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Server message: %s (severity %ld, procedure %s), + srvmsg-text, (long)srvmsg-severity, ((srvmsg-proclen0) ? srvmsg-proc : N/A)); } return CS_SUCCEED; @@ -1015,15 +1031,15 @@ CS_RETCODE retcode; CS_INT restype; - efree(result-datafmt); - efree(result-lengths); - efree(result-indicators); - efree(result-numerics); - efree(result-types); + efree_n(result-datafmt); + efree_n(result-lengths); + efree_n(result-indicators); + efree_n(result-numerics); + efree_n(result-types); for (i=0; iresult-num_fields; i++) { efree(result-tmp_buffer[i]); } - efree(result-tmp_buffer); + efree_n(result-tmp_buffer); /* Indicate we have read all rows */ result-sybase_ptr-active_result_index= 0; @@ -1105,7 +1121,7 @@ #define RETURN_DOUBLE_VAL(result, buf, length) \ if ((length - 1) = EG(precision)) {\ errno = 0; \ - Z_DVAL(result) = strtod(buf, NULL); \ + Z_DVAL(result) = zend_strtod(buf, NULL);\ if (errno != ERANGE) { \ Z_TYPE(result) = IS_DOUBLE; \ } else {\ @@ -1127,14 +1143,7 @@ } if (numrows!=-1) numrows+= result-num_rows; - while ((retcode=ct_fetch(result-sybase_ptr-cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, NULL))==CS_SUCCEED - || retcode==CS_ROW_FAIL) { - /* - if (retcode==CS_ROW_FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Error reading row %d, result-num_rows); - } - */ - + while ((retcode=ct_fetch(result-sybase_ptr-cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, NULL))==CS_SUCCEED) { result-num_rows++; i= result-store ? result-num_rows- 1 : 0; if (i = result-blocks_initialized*SYBASE_ROWS_BLOCK) { @@ -1191,7 +1200,11 @@ } if (numrows!=-1 result-num_rows=numrows) break; } - + + if (retcode==CS_ROW_FAIL) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Error reading row %d,
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/sybase_ct php_sybase_ct.c
helly Tue Apr 10 15:56:31 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sybase_ct php_sybase_ct.c Log: - WS/CS http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.103.2.5.2.12r2=1.103.2.5.2.13diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.12 php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.13 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.103.2.5.2.12Tue Apr 10 15:50:34 2007 +++ php-src/ext/sybase_ct/php_sybase_ct.c Tue Apr 10 15:56:31 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.103.2.5.2.12 2007/04/10 15:50:34 helly Exp $ */ +/* $Id: php_sybase_ct.c,v 1.103.2.5.2.13 2007/04/10 15:56:31 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -160,12 +160,12 @@ efree(result-fields); } -if (result-tmp_buffer) { -for (i=0; iresult-num_fields; i++) { -efree(result-tmp_buffer[i]); -} -efree(result-tmp_buffer); -} + if (result-tmp_buffer) { + for (i=0; iresult-num_fields; i++) { + efree(result-tmp_buffer[i]); + } + efree(result-tmp_buffer); + } efree_if(result-lengths); efree_if(result-indicators); @@ -528,16 +528,16 @@ if (charset) { if (cs_loc_alloc(SybCtG(context), tmp_locale)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to allocate locale information.); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to allocate locale information); } else { if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_LC_ALL, NULL, CS_NULLTERM, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to load default locale data.); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to load default locale data); } else { if (cs_locale(SybCtG(context), CS_SET, tmp_locale, CS_SYB_CHARSET, charset, CS_NULLTERM, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to update character set.); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to update character set); } else { if (ct_con_props(sybase-connection, CS_SET, CS_LOC_PROP, tmp_locale, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to update connection properties.); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to update connection properties); } } } @@ -546,7 +546,7 @@ if (cfg_get_long(sybct.packet_size, packetsize) == SUCCESS) { if (ct_con_props(sybase-connection, CS_SET, CS_PACKETSIZE, (CS_VOID *)packetsize, CS_UNUSED, NULL) != CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to update connection packetsize.); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Unable to update connection packetsize); } } @@ -1202,7 +1202,7 @@ } if (retcode==CS_ROW_FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Error reading row %d, result-num_rows); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Error reading row %d, result-num_rows); return retcode; } result-last_retcode= retcode; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sybase_ct php_sybase_ct.c
helly Tue Apr 10 15:59:29 2007 UTC Modified files: /php-src/ext/sybase_ct php_sybase_ct.c Log: - MFB Synch http://cvs.php.net/viewvc.cgi/php-src/ext/sybase_ct/php_sybase_ct.c?r1=1.117r2=1.118diff_format=u Index: php-src/ext/sybase_ct/php_sybase_ct.c diff -u php-src/ext/sybase_ct/php_sybase_ct.c:1.117 php-src/ext/sybase_ct/php_sybase_ct.c:1.118 --- php-src/ext/sybase_ct/php_sybase_ct.c:1.117 Sat Feb 24 16:25:55 2007 +++ php-src/ext/sybase_ct/php_sybase_ct.c Tue Apr 10 15:59:29 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.117 2007/02/24 16:25:55 helly Exp $ */ +/* $Id: php_sybase_ct.c,v 1.118 2007/04/10 15:59:29 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -135,6 +135,9 @@ return 0; } +#define efree_n(x) { efree(x); x = NULL; } +#define efree_if(x) if (x) efree_n(x) + static void _free_sybase_result(sybase_result *result) { int i, j; @@ -157,6 +160,19 @@ efree(result-fields); } + if (result-tmp_buffer) { + for (i=0; iresult-num_fields; i++) { + efree(result-tmp_buffer[i]); + } + efree(result-tmp_buffer); + } + + efree_if(result-lengths); + efree_if(result-indicators); + efree_if(result-datafmt); + efree_if(result-numerics); + efree_if(result-types); + efree(result); } @@ -246,7 +262,7 @@ TSRMLS_FETCH(); if (CS_SEVERITY(errmsg-msgnumber) = SybCtG(min_client_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %d), errmsg-msgstring, CS_SEVERITY(errmsg-msgnumber)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Client message: %s (severity %ld), errmsg-msgstring, CS_SEVERITY(errmsg-msgnumber)); } STR_FREE(SybCtG(server_message)); SybCtG(server_message) = estrdup(errmsg-msgstring); @@ -351,8 +367,8 @@ /* Spit out a warning if neither of them has handled this message */ if (!handled) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Server message: %s (severity %d, procedure %s), - srvmsg-text, srvmsg-severity, ((srvmsg-proclen0) ? srvmsg-proc : N/A)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Sybase: Server message: %s (severity %ld, procedure %s), + srvmsg-text, (long)srvmsg-severity, ((srvmsg-proclen0) ? srvmsg-proc : N/A)); } return CS_SUCCEED; @@ -599,9 +615,7 @@ convert_to_string_ex(yyhost); host = Z_STRVAL_PP(yyhost); user=passwd=charset=appname=NULL; - hashed_details_length = Z_STRLEN_PP(yyhost)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, sybase_%s, Z_STRVAL_PP(yyhost)); + hashed_details_length = spprintf(hashed_details, 0, sybase_%s, Z_STRVAL_PP(yyhost)); } break; case 2: { @@ -615,9 +629,7 @@ host = Z_STRVAL_PP(yyhost); user = Z_STRVAL_PP(yyuser); passwd=charset=appname=NULL; - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, sybase_%s_%s___, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser)); + hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s___, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser)); } break; case 3: { @@ -633,9 +645,7 @@ user = Z_STRVAL_PP(yyuser); passwd = Z_STRVAL_PP(yypasswd); charset=appname=NULL; - hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+6+5; - hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, sybase_%s_%s_%s__, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd)); + hashed_details_length = spprintf(hashed_details, 0, sybase_%s_%s_%s__, Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd)); } break; case 4: { @@ -653,9 +663,7 @@ passwd = Z_STRVAL_PP(yypasswd);
Re: [PHP-CVS] cvs: php-src /ext/spl php_spl.c
Hello Dmitry, thanks for this fix best regards marcus Monday, April 9, 2007, 5:33:59 PM, you wrote: dmitry Mon Apr 9 15:33:59 2007 UTC Modified files: /php-src/ext/splphp_spl.c Log: Usage of sizeof(void*) is not portable http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.113r2=1.114diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.113 php-src/ext/spl/php_spl.c:1.114 --- php-src/ext/spl/php_spl.c:1.113 Fri Apr 6 21:07:48 2007 +++ php-src/ext/spl/php_spl.c Mon Apr 9 15:33:59 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.113 2007/04/06 21:07:48 helly Exp $ */ +/* $Id: php_spl.c,v 1.114 2007/04/09 15:33:59 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -549,7 +549,7 @@ if (success != SUCCESS obj_ptr) { size_t func_name_len = Z_UNISIZE(zfunc_name); lc_name.v = erealloc(lc_name.v, func_name_len + 2 + sizeof(zend_object_handle)); - memcpy(lc_name.v + func_name_len, Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle)); + memcpy(lc_name.s + func_name_len, Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle)); func_name_len += sizeof(zend_object_handle); if (Z_TYPE(zfunc_name) == IS_UNICODE) { func_name_len /= sizeof(UChar); Best regards, Marcus -- 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_2) /main main.c
Hello Ilia, care to MFB your latest changes? best regards marcus Friday, April 6, 2007, 3:58:48 PM, you wrote: iliaa Fri Apr 6 13:58:48 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main main.c Log: Avoid locks when appening to the error log file http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.32r2=1.640.2.23.2.33diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.640.2.23.2.32 php-src/main/main.c:1.640.2.23.2.33 --- php-src/main/main.c:1.640.2.23.2.32 Sun Apr 1 19:29:42 2007 +++ php-src/main/main.c Fri Apr 6 13:58:48 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.640.2.23.2.32 2007/04/01 19:29:42 iliaa Exp $ */ +/* $Id: main.c,v 1.640.2.23.2.33 2007/04/06 13:58:48 iliaa Exp $ */ /* {{{ includes */ @@ -27,6 +27,7 @@ #include php.h #include stdio.h +#include fcntl.h #ifdef PHP_WIN32 #include win32/time.h #include win32/signal.h @@ -59,10 +60,8 @@ #include ext/standard/php_standard.h #include php_variables.h #include ext/standard/credits.h -#include ext/standard/flock_compat.h #ifdef PHP_WIN32 #include io.h -#include fcntl.h #include win32/php_registry.h #endif #include php_syslog.h @@ -343,7 +342,7 @@ */ PHPAPI void php_log_err(char *log_message TSRMLS_DC) { - FILE *log_file; + int fd = -1; char error_time_str[128]; struct tm tmbuf; time_t error_time; @@ -356,13 +355,16 @@ return; } #endif - log_file = VCWD_FOPEN(PG(error_log), ab); - if (log_file != NULL) { + fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644); + if (fd != -1) { + char *tmp; + int len; time(error_time); strftime(error_time_str, sizeof(error_time_str), %d-%b-%Y %H:%M:%S, php_localtime_r(error_time, tmbuf)); - php_flock(fileno(log_file), 2); - fprintf(log_file, [%s] %s%s, error_time_str, log_message, PHP_EOL); - fclose(log_file); + len = spprintf(tmp, 0, [%s] %s%s, error_time_str, log_message, PHP_EOL); + write(fd, tmp, len); + efree(tmp); + close(fd); return; } } Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl spl_array.c /ext/spl/tests bug40442.phpt
helly Fri Apr 6 15:32:29 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/spl/tests bug40442.phpt Modified files: /php-src/ext/splspl_array.c Log: - Fix #40442 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.123r2=1.124diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.123 php-src/ext/spl/spl_array.c:1.124 --- php-src/ext/spl/spl_array.c:1.123 Sat Mar 24 16:28:45 2007 +++ php-src/ext/spl/spl_array.c Fri Apr 6 15:32:29 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_array.c,v 1.123 2007/03/24 16:28:45 helly Exp $ */ +/* $Id: spl_array.c,v 1.124 2007/04/06 15:32:29 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -525,7 +525,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, index) == FAILURE) { return; } - RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 1 TSRMLS_CC)); + RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 0 TSRMLS_CC)); } /* }}} */ /* {{{ proto mixed ArrayObject::offsetGet(mixed $index) U http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug40442.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/bug40442.phpt +++ php-src/ext/spl/tests/bug40442.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/spl spl_array.c
helly Fri Apr 6 17:57:10 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/splspl_array.c Log: - Fix 40442 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.627r2=1.2027.2.547.2.628diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.627 php-src/NEWS:1.2027.2.547.2.628 --- php-src/NEWS:1.2027.2.547.2.627 Thu Apr 5 01:48:56 2007 +++ php-src/NEWSFri Apr 6 17:57:09 2007 @@ -120,6 +120,8 @@ methods). (Tony) - Fixed bug #40451 (addAttribute() may crash when used with non-existent child node). (Tony) +- Fixed bug #40442 (ArrayObject::offsetExists broke in 5.2.1, works in 5.2.0). + (olivier at elma dot fr, Marcus) - Fixed bug #40428 (imagepstext() doesn't accept optional parameter). (Pierre) - Fixed bug #40417 (Allow multiple instances of the same named PDO token in prepared statement emulation code). (Ilia) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.71.2.17.2.10r2=1.71.2.17.2.11diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.71.2.17.2.10 php-src/ext/spl/spl_array.c:1.71.2.17.2.11 --- php-src/ext/spl/spl_array.c:1.71.2.17.2.10 Sat Mar 24 16:28:53 2007 +++ php-src/ext/spl/spl_array.c Fri Apr 6 17:57:10 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_array.c,v 1.71.2.17.2.10 2007/03/24 16:28:53 helly Exp $ */ +/* $Id: spl_array.c,v 1.71.2.17.2.11 2007/04/06 17:57:10 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -520,7 +520,7 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, index) == FAILURE) { return; } - RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 1 TSRMLS_CC)); + RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 0 TSRMLS_CC)); } /* }}} */ /* {{{ proto mixed ArrayObject::offsetGet(mixed $index) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl php_spl.c
helly Fri Apr 6 19:04:53 2007 UTC Modified files: /php-src/ext/splphp_spl.c Log: - Fix types http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.110r2=1.111diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.110 php-src/ext/spl/php_spl.c:1.111 --- php-src/ext/spl/php_spl.c:1.110 Fri Apr 6 18:50:07 2007 +++ php-src/ext/spl/php_spl.c Fri Apr 6 19:04:53 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.110 2007/04/06 18:50:07 helly Exp $ */ +/* $Id: php_spl.c,v 1.111 2007/04/06 19:04:53 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -546,9 +546,9 @@ success = zend_u_hash_del(SPL_G(autoload_functions), Z_TYPE(zfunc_name), lc_name, Z_UNILEN(zfunc_name)+1); if (success != SUCCESS obj_ptr) { size_t func_name_len = Z_UNISIZE(zfunc_name); - lc_name.v = erealloc(lc_name.v, func_name_len + 1 + sizeof(long)); - memcpy(lc_name.v + func_name_len, Z_OBJ_HANDLE_PP(obj_ptr), sizeof(long)); - func_name_len += sizeof(long); + lc_name.v = erealloc(lc_name.v, func_name_len + 1 + sizeof(zend_object_handle)); + memcpy(lc_name.v + func_name_len, Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle)); + func_name_len += sizeof(zend_object_handle); lc_name.s[func_name_len] = '\0'; if (Z_TYPE(zfunc_name) == IS_UNICODE) { func_name_len /= sizeof(UChar); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl php_spl.c
helly Fri Apr 6 21:02:20 2007 UTC Modified files: /php-src/ext/splphp_spl.c Log: - Fix unicode issue (our string termination test checks both ending bytes instead of just one) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.111r2=1.112diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.111 php-src/ext/spl/php_spl.c:1.112 --- php-src/ext/spl/php_spl.c:1.111 Fri Apr 6 19:04:53 2007 +++ php-src/ext/spl/php_spl.c Fri Apr 6 21:02:20 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.111 2007/04/06 19:04:53 helly Exp $ */ +/* $Id: php_spl.c,v 1.112 2007/04/06 21:02:20 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -466,16 +466,18 @@ /* add object id to the hash to ensure uniqueness, for more reference look at bug #40091 */ zstr lc_name; size_t func_name_len = Z_UNISIZE(zfunc_name); - lc_name.v = Z_UNIVAL(zfunc_name).v = erealloc(Z_UNIVAL(zfunc_name).v, func_name_len + 1 + sizeof(long)); + lc_name.v = Z_UNIVAL(zfunc_name).v = erealloc(Z_UNIVAL(zfunc_name).v, func_name_len + 2 + sizeof(zend_object_handle)); memcpy(lc_name.s + func_name_len, Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle)); func_name_len += sizeof(zend_object_handle); - lc_name.s[func_name_len] = '\0'; alfi.obj = *obj_ptr; alfi.obj-refcount++; if (Z_TYPE(zfunc_name) == IS_UNICODE) { - Z_UNILEN(zfunc_name) = func_name_len / sizeof(UChar); + func_name_len /= sizeof(UChar); + Z_STRLEN(zfunc_name) = func_name_len; + lc_name.u[func_name_len] = '\0'; } else { - Z_UNILEN(zfunc_name) = func_name_len; + Z_STRLEN(zfunc_name) = func_name_len; + lc_name.s[func_name_len] = '\0'; } } else { alfi.obj = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl php_spl.c
helly Fri Apr 6 21:07:48 2007 UTC Modified files: /php-src/ext/splphp_spl.c Log: - Fix unicode issue in unregister according to register solution http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.112r2=1.113diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.112 php-src/ext/spl/php_spl.c:1.113 --- php-src/ext/spl/php_spl.c:1.112 Fri Apr 6 21:02:20 2007 +++ php-src/ext/spl/php_spl.c Fri Apr 6 21:07:48 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.112 2007/04/06 21:02:20 helly Exp $ */ +/* $Id: php_spl.c,v 1.113 2007/04/06 21:07:48 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -474,7 +474,7 @@ if (Z_TYPE(zfunc_name) == IS_UNICODE) { func_name_len /= sizeof(UChar); Z_STRLEN(zfunc_name) = func_name_len; - lc_name.u[func_name_len] = '\0'; + lc_name.u[func_name_len] = 0; } else { Z_STRLEN(zfunc_name) = func_name_len; lc_name.s[func_name_len] = '\0'; @@ -548,12 +548,14 @@ success = zend_u_hash_del(SPL_G(autoload_functions), Z_TYPE(zfunc_name), lc_name, Z_UNILEN(zfunc_name)+1); if (success != SUCCESS obj_ptr) { size_t func_name_len = Z_UNISIZE(zfunc_name); - lc_name.v = erealloc(lc_name.v, func_name_len + 1 + sizeof(zend_object_handle)); + lc_name.v = erealloc(lc_name.v, func_name_len + 2 + sizeof(zend_object_handle)); memcpy(lc_name.v + func_name_len, Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle)); func_name_len += sizeof(zend_object_handle); - lc_name.s[func_name_len] = '\0'; if (Z_TYPE(zfunc_name) == IS_UNICODE) { func_name_len /= sizeof(UChar); + lc_name.u[func_name_len] = 0; + } else { + lc_name.s[func_name_len] = '\0'; } success = zend_u_hash_del(SPL_G(autoload_functions), Z_TYPE(zfunc_name), lc_name, func_name_len+1); } -- 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_array.c
helly Fri Apr 6 21:15:44 2007 UTC Modified files: /php-src/ext/splspl_array.c Log: - Fix unicode issue http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.124r2=1.125diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.124 php-src/ext/spl/spl_array.c:1.125 --- php-src/ext/spl/spl_array.c:1.124 Fri Apr 6 15:32:29 2007 +++ php-src/ext/spl/spl_array.c Fri Apr 6 21:15:44 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_array.c,v 1.124 2007/04/06 15:32:29 helly Exp $ */ +/* $Id: spl_array.c,v 1.125 2007/04/06 21:15:44 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -480,7 +480,7 @@ case IS_STRING: case IS_UNICODE: if (check_empty) { - if (zend_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) tmp) != FAILURE zend_is_true(*tmp)) { + if (zend_u_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, (void **) tmp) != FAILURE zend_is_true(*tmp)) { return 1; } return 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: CVSROOT / avail checkoutlist commitinfo pear_acls peargroup_acls verify.php /pear avail group
helly Fri Apr 6 22:22:36 2007 UTC Added files: /CVSROOTpear_acls peargroup_acls verify.php /CVSROOT/pear avail group Modified files: /CVSROOTavail checkoutlist commitinfo Log: - Split pear access rights to bring the new pear group to life (patch by Greg) http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1262r2=1.1263diff_format=u Index: CVSROOT/avail diff -u CVSROOT/avail:1.1262 CVSROOT/avail:1.1263 --- CVSROOT/avail:1.1262Wed Apr 4 18:19:39 2007 +++ CVSROOT/avail Fri Apr 6 22:22:36 2007 @@ -15,9 +15,9 @@ avail|sterling,goba,imajes,wez,iliaa,derick,jon,cox,alan_k,jmcastagnetto,mj,pajoye,helly|CVSROOT # The PHP Developers have full access to the full source trees for -# PHP and PEAR, as well as the documentation. +# PHP, as well as the documentation. -avail|mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori,nlopess,wrowe,shire,zoe|phpfi,php3,php-src,pecl! ,non-pecl,pear,peardoc,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa_IR,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca +avail|mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori,nlopess,wrowe,shire,zoe|phpfi,php3,php-src,pecl! ,non-pecl,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa_IR,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca # fastcgi implementation for IIS avail|shane,wez,edink|fastcgi-isapi @@ -59,25 +59,6 @@ avail|ilia,jalal,zak,andre,lyric,jmoore,ronabop,sebastian,joey,sniper,torben,hellekin,cnewbill,bate,yohgaki,jan,imajes,derick,msopacua,nohn,edink,iliaa,helly,sean,nlopess,tony2001|qaweb -# The PEAR Team has access to the full PEAR tree, the PEAR portion of -# the PHP tree, the PEAR website, and the PEAR documentation. - -avail|andrew,moh,sterling,jon,jlp,sebastian,troels,urs,jpm,adaniel,tuupola,mj,metallic,richard,aj,andre,zimt,uw,bjoern,chregu,tfromm,subjective,cox,jmcastagnetto,kaltoft,jccann,amiller,mansion,zyprexia,alexmerz,yavo,clambert,vblavet,bernd,nohn,mog,mfischer,kvn,jan,eru,murahachibu,hayk,cain,nhoizey,aditus,ludoo,imajes,graeme,eriksson,jasonlotito,dallen,lsmith,timmyg,artka,tal,kk,cmv,rashid,alexios,baba,reywob,ekilfoil,antonio,sagi,jrust,mehl,dickmann,alan_k,fab,thku,busterb,miked,pgc,ctrlsoft,tychay,dexter,sachat,svenasse,mw21st,arahn,matthias,dias,jfbus,derick,chief,sigi,tony,olivier,nepto,voyteck,cnb,dams,peterk,ernani,edink,quipo,egnited,arnaud,mcmontero,mbretter,nicos,philip,xnoguer,sjr,meebey,jellybob,darkelder,max,dcowgill,daggilli,kuboa,ncowham,sklar,krausbn,ordnas,avb,polone,datenpunk,inorm,llucax,davey,moosh,et,mscifo,yunosh,thesaur,hburbach,ohill,cellog,hlellelid,rmcclain,vincent,heino,neufeind,didou,schst,alain,mrcool,mroch,mike,vgoebbels,mixtli,farell,pmjones,jw,!
[PHP-CVS] cvs: php-src / run-tests.php
helly Tue Mar 27 20:27:39 2007 UTC Modified files: /php-srcrun-tests.php Log: - Allow to load multipe extensions via -d http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.315r2=1.316diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.315 php-src/run-tests.php:1.316 --- php-src/run-tests.php:1.315 Thu Feb 8 15:25:17 2007 +++ php-src/run-tests.php Tue Mar 27 20:27:39 2007 @@ -23,7 +23,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.315 2007/02/08 15:25:17 nlopess Exp $ */ +/* $Id: run-tests.php,v 1.316 2007/03/27 20:27:39 helly Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -401,7 +401,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.315 $'.\n; + echo '$Revision: 1.316 $'.\n; exit(1); default: echo Illegal switch specified!\n; @@ -1748,7 +1748,14 @@ $setting = explode(=, $setting, 2); $name = trim(strtolower($setting[0])); $value = trim($setting[1]); - $ini_settings[$name] = $value; + if ($name == 'extension') { + if (!isset($ini_settings[$name])) { + $ini_settings[$name] = array(); + } + $ini_settings[$name][] = $value; + } else { + $ini_settings[$name] = $value; + } } } } @@ -1757,8 +1764,15 @@ { $settings = ''; foreach($ini_settings as $name = $value) { - $value = addslashes($value); - $settings .= -d \$name=$value\; + if (is_array($value)) { + foreach($value as $val) { + $val = addslashes($val); + $settings .= -d \$name=$val\; + } + } else { + $value = addslashes($value); + $settings .= -d \$name=$value\; + } } $ini_settings = $settings; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php
helly Tue Mar 27 20:28:06 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcrun-tests.php Log: - MFH Allow to load multipe extensions via -d http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.23r2=1.226.2.37.2.24diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.23 php-src/run-tests.php:1.226.2.37.2.24 --- php-src/run-tests.php:1.226.2.37.2.23 Thu Feb 8 15:22:03 2007 +++ php-src/run-tests.php Tue Mar 27 20:28:06 2007 @@ -23,7 +23,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.23 2007/02/08 15:22:03 nlopess Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.24 2007/03/27 20:28:06 helly Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -398,7 +398,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.23 $'.\n; + echo '$Revision: 1.226.2.37.2.24 $'.\n; exit(1); default: echo Illegal switch '$switch' specified!\n; @@ -1690,7 +1690,14 @@ $setting = explode(=, $setting, 2); $name = trim(strtolower($setting[0])); $value = trim($setting[1]); - $ini_settings[$name] = $value; + if ($name == 'extension') { + if (!isset($ini_settings[$name])) { + $ini_settings[$name] = array(); + } + $ini_settings[$name][] = $value; + } else { + $ini_settings[$name] = $value; + } } } } @@ -1699,8 +1706,15 @@ { $settings = ''; foreach($ini_settings as $name = $value) { - $value = addslashes($value); - $settings .= -d \$name=$value\; + if (is_array($value)) { + foreach($value as $val) { + $val = addslashes($val); + $settings .= -d \$name=$val\; + } + } else { + $value = addslashes($value); + $settings .= -d \$name=$value\; + } } $ini_settings = $settings; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pcre config0.m4
helly Sun Mar 25 12:53:31 2007 UTC Modified files: /php-src/ext/pcre config0.m4 Log: - Need to install headers http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/config0.m4?r1=1.45r2=1.46diff_format=u Index: php-src/ext/pcre/config0.m4 diff -u php-src/ext/pcre/config0.m4:1.45 php-src/ext/pcre/config0.m4:1.46 --- php-src/ext/pcre/config0.m4:1.45Fri Feb 9 20:13:16 2007 +++ php-src/ext/pcre/config0.m4 Sun Mar 25 12:53:31 2007 @@ -1,5 +1,5 @@ dnl -dnl $Id: config0.m4,v 1.45 2007/02/09 20:13:16 nlopess Exp $ +dnl $Id: config0.m4,v 1.46 2007/03/25 12:53:31 helly Exp $ dnl dnl By default we'll compile and link against the bundled PCRE library @@ -53,6 +53,7 @@ AC_DEFINE(HAVE_PCRE, 1, [ ]) PHP_ADD_INCLUDE($PCRE_INCDIR) PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=1000 -DMATCH_LIMIT_RECURSION=1000 -DMAX_NAME_SIZE=32 -DMAX_NAME_COUNT=1 -DMAX_DUPLENGTH=3) +PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h]) PHP_SUBST(PCRE_SHARED_LIBADD) fi else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pcre config0.m4
helly Sun Mar 25 12:53:47 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pcre config0.m4 Log: - MFH Need to install headers http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/config0.m4?r1=1.38.2.3.2.5r2=1.38.2.3.2.6diff_format=u Index: php-src/ext/pcre/config0.m4 diff -u php-src/ext/pcre/config0.m4:1.38.2.3.2.5 php-src/ext/pcre/config0.m4:1.38.2.3.2.6 --- php-src/ext/pcre/config0.m4:1.38.2.3.2.5Fri Feb 9 19:48:46 2007 +++ php-src/ext/pcre/config0.m4 Sun Mar 25 12:53:47 2007 @@ -1,5 +1,5 @@ dnl -dnl $Id: config0.m4,v 1.38.2.3.2.5 2007/02/09 19:48:46 nlopess Exp $ +dnl $Id: config0.m4,v 1.38.2.3.2.6 2007/03/25 12:53:47 helly Exp $ dnl dnl By default we'll compile and link against the bundled PCRE library @@ -52,6 +52,7 @@ AC_DEFINE(HAVE_PCRE, 1, [ ]) PHP_ADD_INCLUDE($PCRE_INCDIR) PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DEXPORT= -DNEWLINE=10 -DSUPPORT_UTF8 -DSUPPORT_UCP -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10 -DMATCH_LIMIT=1000 -DMATCH_LIMIT_RECURSION=1000 -DMAX_NAME_SIZE=32 -DMAX_NAME_COUNT=1 -DMAX_DUPLENGTH=3) +PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h]) PHP_SUBST(PCRE_SHARED_LIBADD) fi else -- 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_array.c
helly Sat Mar 24 16:28:45 2007 UTC Modified files: /php-src/ext/splspl_array.c Log: - Drop double variable declaration http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.122r2=1.123diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.122 php-src/ext/spl/spl_array.c:1.123 --- php-src/ext/spl/spl_array.c:1.122 Tue Mar 20 20:21:39 2007 +++ php-src/ext/spl/spl_array.c Sat Mar 24 16:28:45 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_array.c,v 1.122 2007/03/20 20:21:39 helly Exp $ */ +/* $Id: spl_array.c,v 1.123 2007/03/24 16:28:45 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -497,7 +497,6 @@ index = Z_LVAL_P(offset); } if (check_empty) { - zval **tmp; HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); if (zend_hash_index_find(ht, index, (void **)tmp) != FAILURE zend_is_true(*tmp)) { return 1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl spl_array.c
helly Sat Mar 24 16:28:53 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/splspl_array.c Log: - MFH Drop double variable declaration http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.71.2.17.2.9r2=1.71.2.17.2.10diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.71.2.17.2.9 php-src/ext/spl/spl_array.c:1.71.2.17.2.10 --- php-src/ext/spl/spl_array.c:1.71.2.17.2.9 Tue Mar 20 20:28:08 2007 +++ php-src/ext/spl/spl_array.c Sat Mar 24 16:28:53 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_array.c,v 1.71.2.17.2.9 2007/03/20 20:28:08 helly Exp $ */ +/* $Id: spl_array.c,v 1.71.2.17.2.10 2007/03/24 16:28:53 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -492,7 +492,6 @@ index = Z_LVAL_P(offset); } if (check_empty) { - zval **tmp; HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); if (zend_hash_index_find(ht, index, (void **)tmp) != FAILURE zend_is_true(*tmp)) { return 1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cli getopt.c
helly Wed Mar 21 23:19:00 2007 UTC Modified files: /php-src/sapi/cli getopt.c Log: - Fix issue with long form of command line switches http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/getopt.c?r1=1.10r2=1.11diff_format=u Index: php-src/sapi/cli/getopt.c diff -u php-src/sapi/cli/getopt.c:1.10 php-src/sapi/cli/getopt.c:1.11 --- php-src/sapi/cli/getopt.c:1.10 Mon Jan 1 09:29:36 2007 +++ php-src/sapi/cli/getopt.c Wed Mar 21 23:19:00 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: getopt.c,v 1.10 2007/01/01 09:29:36 sebastian Exp $ */ +/* $Id: getopt.c,v 1.11 2007/03/21 23:19:00 helly Exp $ */ #include stdio.h #include string.h @@ -89,19 +89,19 @@ } } optchr = 0; - dash = 1; - arg_start = 2 + strlen(opts[opts_idx].opt_name); - } - if (!dash) { - dash = 1; - optchr = 1; - } - - /* Check if the guy tries to do a -: kind of flag */ - if (argv[*optind][optchr] == ':') { dash = 0; - (*optind)++; - return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); + arg_start = 2 + strlen(opts[opts_idx].opt_name); + } else { + if (!dash) { + dash = 1; + optchr = 1; + } + /* Check if the guy tries to do a -: kind of flag */ + if (argv[*optind][optchr] == ':') { + dash = 0; + (*optind)++; + return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); + } } if (opts_idx 0) { while (1) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /sapi/cli getopt.c
helly Wed Mar 21 23:20:21 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/sapi/cli getopt.c Log: - MFH Fix issue with long form of command line switches http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/getopt.c?r1=1.8.2.1.2.1r2=1.8.2.1.2.2diff_format=u Index: php-src/sapi/cli/getopt.c diff -u php-src/sapi/cli/getopt.c:1.8.2.1.2.1 php-src/sapi/cli/getopt.c:1.8.2.1.2.2 --- php-src/sapi/cli/getopt.c:1.8.2.1.2.1 Mon Jan 1 09:36:12 2007 +++ php-src/sapi/cli/getopt.c Wed Mar 21 23:20:21 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: getopt.c,v 1.8.2.1.2.1 2007/01/01 09:36:12 sebastian Exp $ */ +/* $Id: getopt.c,v 1.8.2.1.2.2 2007/03/21 23:20:21 helly Exp $ */ #include stdio.h #include string.h @@ -89,19 +89,19 @@ } } optchr = 0; - dash = 1; - arg_start = 2 + strlen(opts[opts_idx].opt_name); - } - if (!dash) { - dash = 1; - optchr = 1; - } - - /* Check if the guy tries to do a -: kind of flag */ - if (argv[*optind][optchr] == ':') { dash = 0; - (*optind)++; - return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); + arg_start = 2 + strlen(opts[opts_idx].opt_name); + } else { + if (!dash) { + dash = 1; + optchr = 1; + } + /* Check if the guy tries to do a -: kind of flag */ + if (argv[*optind][optchr] == ':') { + dash = 0; + (*optind)++; + return (php_opt_error(argc, argv, *optind-1, optchr, OPTERRCOLON, show_err)); + } } if (opts_idx 0) { while (1) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli mysqli.c
helly Tue Mar 20 20:00:27 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mysqli mysqli.c Log: - MFH Optional dependency for SPL must be specified in header http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.16.2.14r2=1.72.2.16.2.15diff_format=u Index: php-src/ext/mysqli/mysqli.c diff -u php-src/ext/mysqli/mysqli.c:1.72.2.16.2.14 php-src/ext/mysqli/mysqli.c:1.72.2.16.2.15 --- php-src/ext/mysqli/mysqli.c:1.72.2.16.2.14 Sat Feb 24 02:17:25 2007 +++ php-src/ext/mysqli/mysqli.c Tue Mar 20 20:00:27 2007 @@ -15,7 +15,7 @@ | Author: Georg Richter [EMAIL PROTECTED]| +--+ - $Id: mysqli.c,v 1.72.2.16.2.14 2007/02/24 02:17:25 helly Exp $ + $Id: mysqli.c,v 1.72.2.16.2.15 2007/03/20 20:00:27 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -415,8 +415,21 @@ /* {{{ mysqli_module_entry */ +/* Dependancies */ +static zend_module_dep mysqli_deps[] = { +#if defined(HAVE_SPL) ((PHP_MAJOR_VERSION 5) || (PHP_MAJOR_VERSION == 5 PHP_MINOR_VERSION = 1)) + ZEND_MOD_REQUIRED(spl) +#endif + {NULL, NULL, NULL} +}; + zend_module_entry mysqli_module_entry = { +#if ZEND_MODULE_API_NO = 20050922 + STANDARD_MODULE_HEADER_EX, NULL, + mysqli_deps, +#elif ZEND_MODULE_API_NO = 20010901 STANDARD_MODULE_HEADER, +#endif mysqli, mysqli_functions, PHP_MINIT(mysqli), -- 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_array.c /ext/spl/tests bug40872.phpt
helly Tue Mar 20 20:21:39 2007 UTC Added files: /php-src/ext/spl/tests bug40872.phpt Modified files: /php-src/ext/splspl_array.c Log: - Fix Bug #40872 (inconsistency in offsetSet, offsetExists treatment of string enclosed integers) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.121r2=1.122diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.121 php-src/ext/spl/spl_array.c:1.122 --- php-src/ext/spl/spl_array.c:1.121 Thu Feb 8 20:13:49 2007 +++ php-src/ext/spl/spl_array.c Tue Mar 20 20:21:39 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_array.c,v 1.121 2007/02/08 20:13:49 helly Exp $ */ +/* $Id: spl_array.c,v 1.122 2007/03/20 20:21:39 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -460,7 +460,7 @@ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); long index; - zval *rv; + zval *rv, **tmp; if (check_inherited intern-fptr_offset_has) { SEPARATE_ARG_IF_REF(offset); @@ -480,9 +480,7 @@ case IS_STRING: case IS_UNICODE: if (check_empty) { - zval **tmp; - HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (zend_u_hash_find(ht, Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, (void **) tmp) != FAILURE zend_is_true(*tmp)) { + if (zend_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) tmp) != FAILURE zend_is_true(*tmp)) { return 1; } return 0; http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug40872.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/bug40872.phpt +++ php-src/ext/spl/tests/bug40872.phpt --TEST-- Bug #40872 (inconsistency in offsetSet, offsetExists treatment of string enclosed integers) --FILE-- ?php class Project { public $id; function __construct($id) { $this-id = $id; } } class ProjectsList extends ArrayIterator { public function add(Project $item) { $this-offsetSet($item-id, $item); } } $projects = new ProjectsList(); $projects-add(new Project('1')); $projects-add(new Project(2)); var_dump($projects-offsetExists(1)); var_dump($projects-offsetExists('2')); ? ===DONE=== --EXPECT-- bool(true) bool(true) ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/spl spl_array.c /ext/spl/tests bug40872.phpt
helly Tue Mar 20 20:28:08 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/spl/tests bug40872.phpt Modified files: /php-srcNEWS /php-src/ext/splspl_array.c Log: - MFH Fix Bug #40872 (inconsistency in offsetSet, offsetExists treatment of string enclosed integers) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.606r2=1.2027.2.547.2.607diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.606 php-src/NEWS:1.2027.2.547.2.607 --- php-src/NEWS:1.2027.2.547.2.606 Tue Mar 20 19:39:27 2007 +++ php-src/NEWSTue Mar 20 20:28:07 2007 @@ -14,6 +14,7 @@ - Improved SPL (Marcus) . Added SplFileInfo::getBasename(), DirectoryIterator::getBasename(). . Added SplFileInfo::getLinkTarget(), SplFileInfo::getRealPath(). + . Made RecursiveFilterIterator::accept() abstract as stated in documentation. - Improved SOAP . Added ability to encode arrays with SOAP-ENC:Array type instead of WSDL type. To activate the ability use feature=SOAP_USE_XSI_ARRAY_TYPE @@ -29,6 +30,8 @@ - Fixed zend_llist_remove_tail (Michael Wallner, Dmitry) - Fixed a thread safety issue in gd gif read code (Nuno, Roman Nemecek) - Fixed CVE-2007-1001, GD wbmp used with invalid image size (Pierre) +- Fixed bug #40872 (inconsistency in offsetSet, offsetExists treatment of + string enclosed integers). (Marcus) - Fixed bug #40854 (imap_mail_compose() creates an invalid terminator for multipart e-mails). (Ilia) - Fixed bug #40848 (sorting issue on 64-bit Solaris). (Wez) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.71.2.17.2.8r2=1.71.2.17.2.9diff_format=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.71.2.17.2.8 php-src/ext/spl/spl_array.c:1.71.2.17.2.9 --- php-src/ext/spl/spl_array.c:1.71.2.17.2.8 Thu Feb 8 22:17:40 2007 +++ php-src/ext/spl/spl_array.c Tue Mar 20 20:28:08 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_array.c,v 1.71.2.17.2.8 2007/02/08 22:17:40 helly Exp $ */ +/* $Id: spl_array.c,v 1.71.2.17.2.9 2007/03/20 20:28:08 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -456,7 +456,7 @@ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); long index; - zval *rv; + zval *rv, **tmp; if (check_inherited intern-fptr_offset_has) { SEPARATE_ARG_IF_REF(offset); @@ -475,9 +475,7 @@ switch(Z_TYPE_P(offset)) { case IS_STRING: if (check_empty) { - zval **tmp; - HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (zend_hash_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) tmp) != FAILURE zend_is_true(*tmp)) { + if (zend_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) tmp) != FAILURE zend_is_true(*tmp)) { return 1; } return 0; http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug40872.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/bug40872.phpt +++ php-src/ext/spl/tests/bug40872.phpt --TEST-- Bug #40872 (inconsistency in offsetSet, offsetExists treatment of string enclosed integers) --FILE-- ?php class Project { public $id; function __construct($id) { $this-id = $id; } } class ProjectsList extends ArrayIterator { public function add(Project $item) { $this-offsetSet($item-id, $item); } } $projects = new ProjectsList(); $projects-add(new Project('1')); $projects-add(new Project(2)); var_dump($projects-offsetExists(1)); var_dump($projects-offsetExists('2')); ? ===DONE=== --EXPECT-- bool(true) bool(true) ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: CVSROOT / avail
helly Fri Mar 16 17:35:59 2007 UTC Modified files: /CVSROOTavail Log: - Grant david phpweb karma to help with GSoC http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1253r2=1.1254diff_format=u Index: CVSROOT/avail diff -u CVSROOT/avail:1.1253 CVSROOT/avail:1.1254 --- CVSROOT/avail:1.1253Thu Mar 15 20:07:04 2007 +++ CVSROOT/avail Fri Mar 16 17:35:59 2007 @@ -378,6 +378,7 @@ avail|electroteque|pear/Structures_DataGrid_Renderer_Flexy,peardoc avail|sankazim|pecl/amf avail|jakob|pear/Image_3D,peardoc +avail|davidc|phpweb # php windows installer avail|jmertic|php-src/win32/installer -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mbstring/oniguruma regposerr.c
helly Tue Mar 6 00:55:46 2007 UTC Modified files: /php-src/ext/mbstring/oniguruma regposerr.c Log: - Revert back to sprintf (we could define snprintf for windows but we don't) http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regposerr.c?r1=1.4r2=1.5diff_format=u Index: php-src/ext/mbstring/oniguruma/regposerr.c diff -u php-src/ext/mbstring/oniguruma/regposerr.c:1.4 php-src/ext/mbstring/oniguruma/regposerr.c:1.5 --- php-src/ext/mbstring/oniguruma/regposerr.c:1.4 Sat Feb 24 16:25:54 2007 +++ php-src/ext/mbstring/oniguruma/regposerr.c Tue Mar 6 00:55:46 2007 @@ -76,7 +76,7 @@ s = ; } else { -snprintf(tbuf, sizeof(tbuf), undefined error code (%d), posix_ecode); +sprintf(tbuf, undefined error code (%d), posix_ecode); s = tbuf; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mbstring/oniguruma regposerr.c
helly Tue Mar 6 00:56:42 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mbstring/oniguruma regposerr.c Log: - MFH Revert back to sprintf (we could define snprintf for windows but we don't) http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regposerr.c?r1=1.3.4.1r2=1.3.4.2diff_format=u Index: php-src/ext/mbstring/oniguruma/regposerr.c diff -u php-src/ext/mbstring/oniguruma/regposerr.c:1.3.4.1 php-src/ext/mbstring/oniguruma/regposerr.c:1.3.4.2 --- php-src/ext/mbstring/oniguruma/regposerr.c:1.3.4.1 Sat Feb 24 02:17:24 2007 +++ php-src/ext/mbstring/oniguruma/regposerr.c Tue Mar 6 00:56:42 2007 @@ -76,7 +76,7 @@ s = ; } else { -snprintf(tbuf, sizeof(tbuf), undefined error code (%d), posix_ecode); +sprintf(tbuf, sizeof(tbuf), undefined error code (%d), posix_ecode); s = tbuf; } -- 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_2) /ext/mbstring/oniguruma regposerr.c
Hello Stanislav, right, thanks and fixed. Tuesday, March 6, 2007, 2:00:04 AM, you wrote: This is not going to work - sprintf has format as second parameter. Also, I thought PHP does define snprintf for Windows? Marcus Boerger wrote: helly Tue Mar 6 00:56:42 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mbstring/oniguruma regposerr.c Log: - MFH Revert back to sprintf (we could define snprintf for windows but we don't) http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regposerr.c?r1=1.3.4.1r2=1.3.4.2diff_format=u Index: php-src/ext/mbstring/oniguruma/regposerr.c diff -u php-src/ext/mbstring/oniguruma/regposerr.c:1.3.4.1 php-src/ext/mbstring/oniguruma/regposerr.c:1.3.4.2 --- php-src/ext/mbstring/oniguruma/regposerr.c:1.3.4.1Sat Feb 24 02:17:24 2007 +++ php-src/ext/mbstring/oniguruma/regposerr.cTue Mar 6 00:56:42 2007 @@ -76,7 +76,7 @@ s = ; } else { -snprintf(tbuf, sizeof(tbuf), undefined error code (%d), posix_ecode); +sprintf(tbuf, sizeof(tbuf), undefined error code (%d), posix_ecode); s = tbuf; } Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mbstring/oniguruma regversion.c
helly Tue Mar 6 01:13:22 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mbstring/oniguruma regversion.c Log: - More to go # CVS sucks, you cannot mix -D with -r # However, thanks edin for reminding me that we have mini version tags # I still prefer subverison. There we don't have any problem of this kind http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regversion.c?r1=1.1.6.3r2=1.1.6.4diff_format=u Index: php-src/ext/mbstring/oniguruma/regversion.c diff -u php-src/ext/mbstring/oniguruma/regversion.c:1.1.6.3 php-src/ext/mbstring/oniguruma/regversion.c:1.1.6.4 --- php-src/ext/mbstring/oniguruma/regversion.c:1.1.6.3 Sat Feb 24 02:17:24 2007 +++ php-src/ext/mbstring/oniguruma/regversion.c Tue Mar 6 01:13:21 2007 @@ -35,7 +35,7 @@ { static char s[12]; - snprintf(s, sizeof(s), %d.%d.%d, + sprintf(s, sizeof(s), %d.%d.%d, ONIGURUMA_VERSION_MAJOR, ONIGURUMA_VERSION_MINOR, ONIGURUMA_VERSION_TEENY); @@ -47,7 +47,7 @@ { static char s[58]; - snprintf(s, sizeof(s), Oniguruma %d.%d.%d : Copyright (C) 2002-2007 K.Kosako, + sprintf(s, sizeof(s), Oniguruma %d.%d.%d : Copyright (C) 2002-2007 K.Kosako, ONIGURUMA_VERSION_MAJOR, ONIGURUMA_VERSION_MINOR, ONIGURUMA_VERSION_TEENY); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mbstring/oniguruma regversion.c
helly Tue Mar 6 01:14:38 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mbstring/oniguruma regversion.c Log: - And the sizes too http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regversion.c?r1=1.1.6.4r2=1.1.6.5diff_format=u Index: php-src/ext/mbstring/oniguruma/regversion.c diff -u php-src/ext/mbstring/oniguruma/regversion.c:1.1.6.4 php-src/ext/mbstring/oniguruma/regversion.c:1.1.6.5 --- php-src/ext/mbstring/oniguruma/regversion.c:1.1.6.4 Tue Mar 6 01:13:21 2007 +++ php-src/ext/mbstring/oniguruma/regversion.c Tue Mar 6 01:14:38 2007 @@ -35,7 +35,7 @@ { static char s[12]; - sprintf(s, sizeof(s), %d.%d.%d, + sprintf(s, %d.%d.%d, ONIGURUMA_VERSION_MAJOR, ONIGURUMA_VERSION_MINOR, ONIGURUMA_VERSION_TEENY); @@ -47,7 +47,7 @@ { static char s[58]; - sprintf(s, sizeof(s), Oniguruma %d.%d.%d : Copyright (C) 2002-2007 K.Kosako, + sprintf(s, Oniguruma %d.%d.%d : Copyright (C) 2002-2007 K.Kosako, ONIGURUMA_VERSION_MAJOR, ONIGURUMA_VERSION_MINOR, ONIGURUMA_VERSION_TEENY); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mbstring/oniguruma regerror.c
helly Tue Mar 6 01:19:48 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mbstring/oniguruma regerror.c Log: - Revert last part and fix issue under windows http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regerror.c?r1=1.3.4.7r2=1.3.4.8diff_format=u Index: php-src/ext/mbstring/oniguruma/regerror.c diff -u php-src/ext/mbstring/oniguruma/regerror.c:1.3.4.7 php-src/ext/mbstring/oniguruma/regerror.c:1.3.4.8 --- php-src/ext/mbstring/oniguruma/regerror.c:1.3.4.7 Wed Feb 28 01:10:41 2007 +++ php-src/ext/mbstring/oniguruma/regerror.c Tue Mar 6 01:19:47 2007 @@ -278,7 +278,7 @@ va_init_list(args, fmt); n = vsnprintf((char* )buf, bufsize, (const char* )fmt, args); - if (n = bufsize) { + if (n 0 || n = bufsize) { n = bufsize - 1; } va_end(args); @@ -309,7 +309,7 @@ int blen; while (len-- 0) { -snprintf((char* )bs, sizeof(bs), \\%03o, *p++ 0377); +sprintf((char* )bs, \\%03o, *p++ 0377); blen = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs); bp = bs; while (blen-- 0) *s++ = *bp++; @@ -318,7 +318,7 @@ } else if (!ONIGENC_IS_CODE_PRINT(enc, *p) !ONIGENC_IS_CODE_SPACE(enc, *p)) { - snprintf((char* )bs, sizeof(bs), \\%03o, *p++ 0377); + sprintf((char* )bs, \\%03o, *p++ 0377); len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs); bp = bs; while (len-- 0) *s++ = *bp++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mbstring/oniguruma regerror.c
helly Tue Mar 6 01:21:36 2007 UTC Modified files: /php-src/ext/mbstring/oniguruma regerror.c Log: - Add missing return value check http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regerror.c?r1=1.3r2=1.4diff_format=u Index: php-src/ext/mbstring/oniguruma/regerror.c diff -u php-src/ext/mbstring/oniguruma/regerror.c:1.3 php-src/ext/mbstring/oniguruma/regerror.c:1.4 --- php-src/ext/mbstring/oniguruma/regerror.c:1.3 Sun Feb 20 22:18:08 2005 +++ php-src/ext/mbstring/oniguruma/regerror.c Tue Mar 6 01:21:36 2007 @@ -276,6 +276,9 @@ va_init_list(args, fmt); n = vsnprintf(buf, bufsize, fmt, args); + if (n 0 || n = bufsize) { +n = bufsize - 1; + } va_end(args); need = (pat_end - pat) * 4 + 4; -- 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_iterators.c
helly Sun Mar 4 12:02:16 2007 UTC Modified files: /php-src/ext/splspl_directory.c spl_iterators.c Log: - Simplify http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.130r2=1.131diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.130 php-src/ext/spl/spl_directory.c:1.131 --- php-src/ext/spl/spl_directory.c:1.130 Sun Mar 4 00:42:30 2007 +++ php-src/ext/spl/spl_directory.c Sun Mar 4 12:02:16 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.130 2007/03/04 00:42:30 helly Exp $ */ +/* $Id: spl_directory.c,v 1.131 2007/03/04 12:02:16 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -508,6 +508,18 @@ 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); +} +/* }}} */ + static HashTable* spl_filesystem_object_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* */ { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(obj TSRMLS_CC); @@ -1149,7 +1161,7 @@ } do { spl_filesystem_dir_read(intern TSRMLS_CC); - } while (!strcmp(intern-u.dir.entry.d_name, .) || !strcmp(intern-u.dir.entry.d_name, ..)); + } while (spl_filesystem_is_dot(intern-u.dir.entry.d_name)); } /* }}} */ @@ -1162,7 +1174,7 @@ intern-u.dir.index++; do { spl_filesystem_dir_read(intern TSRMLS_CC); - } while (!strcmp(intern-u.dir.entry.d_name, .) || !strcmp(intern-u.dir.entry.d_name, ..)); + } while (spl_filesystem_is_dot(intern-u.dir.entry.d_name)); if (intern-file_name.v) { efree(intern-file_name.v); intern-file_name = NULL_ZSTR; @@ -1177,7 +1189,7 @@ zend_bool allow_links = 0; spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (!strcmp(intern-u.dir.entry.d_name, .) || !strcmp(intern-u.dir.entry.d_name, ..)) { + if (spl_filesystem_is_invalid_or_dot(intern-u.dir.entry.d_name)) { RETURN_FALSE; } else { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |b, allow_links) == FAILURE) { @@ -1443,7 +1455,7 @@ object-u.dir.index++; do { spl_filesystem_dir_read(object TSRMLS_CC); - } while (!strcmp(object-u.dir.entry.d_name, .) || !strcmp(object-u.dir.entry.d_name, ..)); + } while (spl_filesystem_is_dot(object-u.dir.entry.d_name)); if (object-file_name.v) { efree(object-file_name.v); object-file_name = NULL_ZSTR; @@ -1467,7 +1479,7 @@ } do { spl_filesystem_dir_read(object TSRMLS_CC); - } while (!strcmp(object-u.dir.entry.d_name, .) || !strcmp(object-u.dir.entry.d_name, ..)); + } while (spl_filesystem_is_dot(object-u.dir.entry.d_name)); if (iterator-current) { zval_ptr_dtor(iterator-current); iterator-current = NULL; http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.158r2=1.159diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.158 php-src/ext/spl/spl_iterators.c:1.159 --- php-src/ext/spl/spl_iterators.c:1.158 Thu Feb 8 20:13:49 2007 +++ php-src/ext/spl/spl_iterators.c Sun Mar 4 12:02:16 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.158 2007/02/08 20:13:49 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.159 2007/03/04 12:02:16 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1349,41 +1349,6 @@ spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_ParentIterator, spl_ce_RecursiveIterator, DIT_ParentIterator); } /* }}} */ -/* {{{ proto bool ParentIterator::hasChildren() U - Check whether the inner iterator's current element has children */ -SPL_METHOD(ParentIterator, hasChildren) -{ - spl_dual_it_object *intern; - zval *retval; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_call_method_with_0_params(intern-inner.zobject, intern-inner.ce, NULL, haschildren, retval); - if (retval) { - RETURN_ZVAL(retval, 0, 1); - } else { - RETURN_FALSE; - } -} /* }}} */ - -/* {{{ proto ParentIterator ParentIterator::getChildren() U - Return the inner iterator's children contained in a ParentIterator */ -SPL_METHOD(ParentIterator, getChildren) -{ - spl_dual_it_object *intern; -
[PHP-CVS] cvs: php-src /ext/spl spl_iterators.c /ext/spl/internal parentiterator.inc
helly Sun Mar 4 12:06:55 2007 UTC Modified files: /php-src/ext/splspl_iterators.c /php-src/ext/spl/internal parentiterator.inc Log: - Match docu with implementation - RecursiveFilterIterator::accept() needs to be abstract http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.159r2=1.160diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.159 php-src/ext/spl/spl_iterators.c:1.160 --- php-src/ext/spl/spl_iterators.c:1.159 Sun Mar 4 12:02:16 2007 +++ php-src/ext/spl/spl_iterators.c Sun Mar 4 12:06:55 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.159 2007/03/04 12:02:16 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.160 2007/03/04 12:06:55 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1657,7 +1657,6 @@ static zend_function_entry spl_funcs_RecursiveFilterIterator[] = { SPL_ME(RecursiveFilterIterator, __construct, arginfo_parent_it___construct, ZEND_ACC_PUBLIC) - SPL_MA(ParentIterator, accept, RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) SPL_ME(RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) SPL_ME(RecursiveFilterIterator, getChildren, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/parentiterator.inc?r1=1.8r2=1.9diff_format=u Index: php-src/ext/spl/internal/parentiterator.inc diff -u php-src/ext/spl/internal/parentiterator.inc:1.8 php-src/ext/spl/internal/parentiterator.inc:1.9 --- php-src/ext/spl/internal/parentiterator.inc:1.8 Tue Feb 21 23:21:53 2006 +++ php-src/ext/spl/internal/parentiterator.inc Sun Mar 4 12:06:55 2007 @@ -21,26 +21,12 @@ */ class ParentIterator extends RecursiveFilterIterator { - /** @param $it the RecursiveIterator to filter -*/ - function __construct(RecursiveIterator $it) - { - parent::__construct($it); - } - /** @return whetehr the current element has children */ function accept() { return $this-it-hasChildren(); } - - /** @return the ParentIterator for the current elements children -*/ - function getChildren() - { - return new ParentIterator($this-it-getChildren()); - } } ? \ No newline at end of file -- 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
helly Sun Mar 4 12:13:20 2007 UTC Modified files: /php-src/ext/splspl_directory.c Log: - Missed one is-dot check http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.131r2=1.132diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.131 php-src/ext/spl/spl_directory.c:1.132 --- php-src/ext/spl/spl_directory.c:1.131 Sun Mar 4 12:02:16 2007 +++ php-src/ext/spl/spl_directory.c Sun Mar 4 12:13:20 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.131 2007/03/04 12:02:16 helly Exp $ */ +/* $Id: spl_directory.c,v 1.132 2007/03/04 12:13:20 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -839,7 +839,7 @@ { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_BOOL(!strcmp(intern-u.dir.entry.d_name, .) || !strcmp(intern-u.dir.entry.d_name, ..)); + RETURN_BOOL(spl_filesystem_is_dot(intern-u.dir.entry.d_name)); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl spl_directory.c spl_iterators.c /ext/spl/internal parentiterator.inc
, spl_ce_RecursiveIterator, DIT_ParentIterator); } /* }}} */ -/* {{{ proto bool ParentIterator::hasChildren() - Check whether the inner iterator's current element has children */ -SPL_METHOD(ParentIterator, hasChildren) -{ - spl_dual_it_object *intern; - zval *retval; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_call_method_with_0_params(intern-inner.zobject, intern-inner.ce, NULL, haschildren, retval); - if (retval) { - RETURN_ZVAL(retval, 0, 1); - } else { - RETURN_FALSE; - } -} /* }}} */ - -/* {{{ proto ParentIterator ParentIterator::getChildren() - Return the inner iterator's children contained in a ParentIterator */ -SPL_METHOD(ParentIterator, getChildren) -{ - spl_dual_it_object *intern; - zval *retval; - - intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - - zend_call_method_with_0_params(intern-inner.zobject, intern-inner.ce, NULL, getchildren, retval); - if (!EG(exception) retval) { - spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), return_value, 0, retval TSRMLS_CC); - } - if (retval) { - zval_ptr_dtor(retval); - } -} /* }}} */ - #if HAVE_PCRE || HAVE_BUNDLED_PCRE /* {{{ proto void RegexIterator::__construct(Iterator it, string regex [, int mode [, int flags [, int preg_flags]]]) Create an RegexIterator from another iterator and a regular expression */ @@ -1665,7 +1630,6 @@ static zend_function_entry spl_funcs_RecursiveFilterIterator[] = { SPL_ME(RecursiveFilterIterator, __construct, arginfo_parent_it___construct, ZEND_ACC_PUBLIC) - SPL_MA(ParentIterator, accept, RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) SPL_ME(RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) SPL_ME(RecursiveFilterIterator, getChildren, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} @@ -1673,10 +1637,7 @@ static zend_function_entry spl_funcs_ParentIterator[] = { SPL_ME(ParentIterator, __construct, arginfo_parent_it___construct, ZEND_ACC_PUBLIC) - SPL_MA(ParentIterator, accept, ParentIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(ParentIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(ParentIterator, getChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(dual_it, getInnerIterator, NULL, ZEND_ACC_PUBLIC) + SPL_MA(ParentIterator, accept, RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/parentiterator.inc?r1=1.5.2.1r2=1.5.2.1.2.1diff_format=u Index: php-src/ext/spl/internal/parentiterator.inc diff -u php-src/ext/spl/internal/parentiterator.inc:1.5.2.1 php-src/ext/spl/internal/parentiterator.inc:1.5.2.1.2.1 --- php-src/ext/spl/internal/parentiterator.inc:1.5.2.1 Thu Sep 15 03:54:42 2005 +++ php-src/ext/spl/internal/parentiterator.inc Sun Mar 4 12:18:02 2007 @@ -4,7 +4,7 @@ * @ingroup SPL * @brief class FilterIterator * @author Marcus Boerger - * @date2003 - 2005 + * @date2003 - 2006 * * SPL - Standard PHP Library */ @@ -21,26 +21,12 @@ */ class ParentIterator extends RecursiveFilterIterator { - /** @param $it the RecursiveIterator to filter -*/ - function __construct(RecursiveIterator $it) - { - parent::__construct($it); - } - /** @return whetehr the current element has children */ function accept() { return $this-it-hasChildren(); } - - /** @return the ParentIterator for the current elements children -*/ - function getChildren() - { - return new ParentIterator($this-it-getChildren()); - } } ? \ No newline at end of file -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl spl_directory.c spl_iterators.c
helly Sun Mar 4 14:01:06 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/splspl_directory.c spl_iterators.c Log: - Fix copy'n'paste issues http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.18r2=1.45.2.27.2.19diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.18 php-src/ext/spl/spl_directory.c:1.45.2.27.2.19 --- php-src/ext/spl/spl_directory.c:1.45.2.27.2.18 Sun Mar 4 12:18:02 2007 +++ php-src/ext/spl/spl_directory.c Sun Mar 4 14:01:06 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.45.2.27.2.18 2007/03/04 12:18:02 helly Exp $ */ +/* $Id: spl_directory.c,v 1.45.2.27.2.19 2007/03/04 14:01:06 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1286,7 +1286,7 @@ if (!object-u.dir.dirp || !php_stream_readdir(object-u.dir.dirp, object-u.dir.entry)) { object-u.dir.entry.d_name[0] = '\0'; } - } while (spl_filesystem_is_dot(intern-u.dir.entry.d_name)); + } while (spl_filesystem_is_dot(object-u.dir.entry.d_name)); if (object-file_name) { efree(object-file_name); object-file_name = NULL; @@ -1312,7 +1312,7 @@ if (!object-u.dir.dirp || !php_stream_readdir(object-u.dir.dirp, object-u.dir.entry)) { object-u.dir.entry.d_name[0] = '\0'; } - } while (spl_filesystem_is_dot(intern-u.dir.entry.d_name)); + } while (spl_filesystem_is_dot(object-u.dir.entry.d_name)); if (iterator-current) { zval_ptr_dtor(iterator-current); iterator-current = NULL; http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30.2.26r2=1.73.2.30.2.27diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30.2.26 php-src/ext/spl/spl_iterators.c:1.73.2.30.2.27 --- php-src/ext/spl/spl_iterators.c:1.73.2.30.2.26 Sun Mar 4 12:18:02 2007 +++ php-src/ext/spl/spl_iterators.c Sun Mar 4 14:01:06 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.73.2.30.2.26 2007/03/04 12:18:02 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.73.2.30.2.27 2007/03/04 14:01:06 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1688,9 +1688,9 @@ ZEND_END_ARG_INFO(); static zend_function_entry spl_funcs_RecursiveRegexIterator[] = { - SPL_ME(RecursiveRegexIterator, __construct, arginfo_rec_regex_it___construct, ZEND_ACC_PUBLIC) - SPL_ME(ParentIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) - SPL_ME(RecursiveRegexIterator, getChildren, NULL, ZEND_ACC_PUBLIC) + SPL_ME(RecursiveRegexIterator, __construct, arginfo_rec_regex_it___construct, ZEND_ACC_PUBLIC) + SPL_ME(RecursiveFilterIterator, hasChildren, NULL, ZEND_ACC_PUBLIC) + SPL_ME(RecursiveRegexIterator, getChildren, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; #endif -- 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
helly Sat Mar 3 14:37:17 2007 UTC Modified files: /php-src/ext/splspl_directory.c Log: - [DOC] Add SplInfo::getBasename(), DirectoryIterator::getBasename() http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.121r2=1.122diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.121 php-src/ext/spl/spl_directory.c:1.122 --- php-src/ext/spl/spl_directory.c:1.121 Mon Feb 26 22:46:13 2007 +++ php-src/ext/spl/spl_directory.c Sat Mar 3 14:37:17 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.121 2007/02/26 22:46:13 helly Exp $ */ +/* $Id: spl_directory.c,v 1.122 2007/03/03 14:37:17 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -656,6 +656,53 @@ } /* }}} */ +/* {{{ proto string SplFileInfo::getBasename([string $suffix]) U + Returns filename component of path */ +SPL_METHOD(SplFileInfo, getBasename) +{ + spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + zstr fname, suffix; + int flen, slen = 0; + + suffix.v = 0; + if (intern-file_name_type == IS_UNICODE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |t, suffix.u, slen) == FAILURE) { + return; + } + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, suffix.s, slen) == FAILURE) { + return; + } + } + + if (intern-file_name_type == IS_UNICODE) { + php_u_basename(fname.u, flen, suffix.u, slen, fname.u, flen TSRMLS_CC); + } else { + php_basename(fname.s, flen, suffix.s, slen, fname.s, flen TSRMLS_CC); + } + + RETURN_ZSTRL(intern-file_name_type, fname, flen, 0); +} +/* }}}*/ + +/* {{{ proto string DirectoryIterator::getBasename([string $suffix]) U + Returns filename component of current dir entry */ +SPL_METHOD(DirectoryIterator, getBasename) +{ + spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + char *suffix = 0, *fname; + int slen = 0, flen; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, suffix, slen) == FAILURE) { + return; + } + + php_basename(intern-u.dir.entry.d_name, strlen(intern-u.dir.entry.d_name), suffix, slen, fname, flen TSRMLS_CC); + + RETURN_RT_STRINGL(fname, flen, ZSTR_AUTOFREE); +} +/* }}} */ + /* {{{ proto string SplFileInfo::getPathname() U Return path and filename */ SPL_METHOD(SplFileInfo, getPathname) @@ -1452,12 +1499,18 @@ ZEND_ARG_INFO(0, class_name) ZEND_END_ARG_INFO() +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_optinalSuffix, 0, 0, 0) + ZEND_ARG_INFO(0, suffix) +ZEND_END_ARG_INFO() + /* the method table */ /* each method can have its own parameters and visibility */ static zend_function_entry spl_SplFileInfo_functions[] = { SPL_ME(SplFileInfo, __construct, arginfo_info___construct, ZEND_ACC_PUBLIC) SPL_ME(SplFileInfo, getPath, NULL, ZEND_ACC_PUBLIC) SPL_ME(SplFileInfo, getFilename, NULL, ZEND_ACC_PUBLIC) + SPL_ME(SplFileInfo, getBasename, arginfo_optinalSuffix, ZEND_ACC_PUBLIC) SPL_ME(SplFileInfo, getPathname, NULL, ZEND_ACC_PUBLIC) SPL_ME(SplFileInfo, getPerms, NULL, ZEND_ACC_PUBLIC) SPL_ME(SplFileInfo, getInode, NULL, ZEND_ACC_PUBLIC) @@ -1495,6 +1548,7 @@ static zend_function_entry spl_DirectoryIterator_functions[] = { SPL_ME(DirectoryIterator, __construct, arginfo_dir___construct, ZEND_ACC_PUBLIC) SPL_ME(DirectoryIterator, getFilename, NULL, ZEND_ACC_PUBLIC) + SPL_ME(DirectoryIterator, getBasename, arginfo_optinalSuffix, ZEND_ACC_PUBLIC) SPL_ME(DirectoryIterator, isDot, NULL, ZEND_ACC_PUBLIC) SPL_ME(DirectoryIterator, rewind,NULL, ZEND_ACC_PUBLIC) SPL_ME(DirectoryIterator, valid, NULL, ZEND_ACC_PUBLIC) -- 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
helly Sat Mar 3 14:46:44 2007 UTC Modified files: /php-src/ext/splspl_directory.c Log: # This block got lost somehow http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.122r2=1.123diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.122 php-src/ext/spl/spl_directory.c:1.123 --- php-src/ext/spl/spl_directory.c:1.122 Sat Mar 3 14:37:17 2007 +++ php-src/ext/spl/spl_directory.c Sat Mar 3 14:46:44 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.122 2007/03/03 14:37:17 helly Exp $ */ +/* $Id: spl_directory.c,v 1.123 2007/03/03 14:46:44 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -675,6 +675,18 @@ } } + if (intern-path_len intern-path_len intern-file_name_len) { + if (intern-file_name_type == IS_UNICODE) { + fname.u = intern-file_name.u + intern-path_len + 1; + } else { + fname.s = intern-file_name.s + intern-path_len + 1; + } + flen = intern-file_name_len - (intern-path_len + 1); + } else { + fname = intern-file_name; + flen = intern-file_name_len; + } + if (intern-file_name_type == IS_UNICODE) { php_u_basename(fname.u, flen, suffix.u, slen, fname.u, flen TSRMLS_CC); } else { -- 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
helly Sat Mar 3 14:51:40 2007 UTC Modified files: /php-src/ext/splspl_directory.c Log: - SplFileInfo::getRealPath() is not always present http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.123r2=1.124diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.123 php-src/ext/spl/spl_directory.c:1.124 --- php-src/ext/spl/spl_directory.c:1.123 Sat Mar 3 14:46:44 2007 +++ php-src/ext/spl/spl_directory.c Sat Mar 3 14:51:40 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.123 2007/03/03 14:46:44 helly Exp $ */ +/* $Id: spl_directory.c,v 1.124 2007/03/03 14:51:40 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1540,7 +1540,9 @@ SPL_ME(SplFileInfo, isDir, NULL, ZEND_ACC_PUBLIC) SPL_ME(SplFileInfo, isLink,NULL, ZEND_ACC_PUBLIC) SPL_ME(SplFileInfo, getLinkTarget, NULL, ZEND_ACC_PUBLIC) +#if (!defined(__BEOS__) !defined(NETWARE) HAVE_REALPATH) || defined(ZTS) SPL_ME(SplFileInfo, getRealPath, NULL, ZEND_ACC_PUBLIC) +#endif SPL_ME(SplFileInfo, getFileInfo, arginfo_info_optinalFileClass, ZEND_ACC_PUBLIC) SPL_ME(SplFileInfo, getPathInfo, arginfo_info_optinalFileClass, ZEND_ACC_PUBLIC) SPL_ME(SplFileInfo, openFile, arginfo_info_openFile, ZEND_ACC_PUBLIC) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/spl spl_directory.c
helly Sat Mar 3 15:08:59 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/splspl_directory.c Log: - MFH [DOC] Add SplFileInfo::getBasename(), DirectoryIterator::getBasename - MFH Add SplFileInfo::getLinkTarget(), SplFileInfo::getRealPath() # All based on suggestions by Arnold Daniels http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.567r2=1.2027.2.547.2.568diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.567 php-src/NEWS:1.2027.2.547.2.568 --- php-src/NEWS:1.2027.2.547.2.567 Sat Mar 3 02:06:43 2007 +++ php-src/NEWSSat Mar 3 15:08:58 2007 @@ -7,6 +7,10 @@ . libmysql (MySQL) to version 5.0.36 - Upgraded SQLite 3 to version 3.3.13 (Ilia) - Upgraded PCRE to version 7.0 (Nuno) +- Improved SPL (Marcus) + . Added SplFileInfo::getBasename(), DirectoryIterator::getBasename(). + . Added SplFileInfo::getLinkTarget(), SplFileInfo::getRealPath(). +# All based on suggestions by Arnold Davies - Added --ri switch to CLI which allows to check extension information. (Marcus) - Added tidyNode::getParent() method (John, Nuno) - Fixed zend_llist_remove_tail (Michael Wallner, Dmitry) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.16r2=1.45.2.27.2.17diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.16 php-src/ext/spl/spl_directory.c:1.45.2.27.2.17 --- php-src/ext/spl/spl_directory.c:1.45.2.27.2.16 Tue Feb 27 03:28:16 2007 +++ php-src/ext/spl/spl_directory.c Sat Mar 3 15:08:59 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.45.2.27.2.16 2007/02/27 03:28:16 iliaa Exp $ */ +/* $Id: spl_directory.c,v 1.45.2.27.2.17 2007/03/03 15:08:59 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -577,6 +577,50 @@ } /* }}} */ +/* {{{ proto string SplFileInfo::getBasename([string $suffix]) U + Returns filename component of path */ +SPL_METHOD(SplFileInfo, getBasename) +{ + spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + char *fname, *suffix = 0; + int flen, slen = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, suffix, slen) == FAILURE) { + return; + } + + if (intern-path_len intern-path_len intern-file_name_len) { + fname = intern-file_name + intern-path_len + 1; + flen = intern-file_name_len - (intern-path_len + 1); + } else { + fname = intern-file_name; + flen = intern-file_name_len; + } + + php_basename(fname, flen, suffix, slen, fname, flen TSRMLS_CC); + + RETURN_STRINGL(fname, flen, 0); +} +/* }}}*/ + +/* {{{ proto string DirectoryIterator::getBasename([string $suffix]) U + Returns filename component of current dir entry */ +SPL_METHOD(DirectoryIterator, getBasename) +{ + spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + char *suffix = 0, *fname; + int slen = 0, flen; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, suffix, slen) == FAILURE) { + return; + } + + php_basename(intern-u.dir.entry.d_name, strlen(intern-u.dir.entry.d_name), suffix, slen, fname, flen TSRMLS_CC); + + RETURN_STRINGL(fname, flen, 0); +} +/* }}} */ + /* {{{ proto string SplFileInfo::getPathname() Return path and filename */ SPL_METHOD(SplFileInfo, getPathname) @@ -761,6 +805,56 @@ FileInfoFunction(isLink, FS_IS_LINK) /* }}} */ +/* {{{ proto string SplFileInfo::getLinkTarget() U + Return the target of a symbolic link */ +SPL_METHOD(SplFileInfo, getLinkTarget) +{ + spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + int ret; + char buff[MAXPATHLEN]; + + php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); + + ret = readlink(intern-file_name, buff, MAXPATHLEN-1); + + if (ret == -1) { + zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, Unable to read link %s, error: %s, intern-file_name, strerror(errno)); + RETVAL_FALSE; + } else { + /* Append NULL to the end of the string */ + buff[ret] = '\0'; + + RETVAL_STRINGL(buff, ret, 1); + } + php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); +} +/* }}} */ + +#if (!defined(__BEOS__) !defined(NETWARE) HAVE_REALPATH) || defined(ZTS) +/* {{{ proto string SplFileInfo::getRealPath() + Return the resolved path */ +SPL_METHOD(SplFileInfo, getRealPath) +{ + spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + char buff[MAXPATHLEN]; + +
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS
helly Sat Mar 3 15:18:03 2007 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: - The # line does not belong here http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.568r2=1.2027.2.547.2.569diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.568 php-src/NEWS:1.2027.2.547.2.569 --- php-src/NEWS:1.2027.2.547.2.568 Sat Mar 3 15:08:58 2007 +++ php-src/NEWSSat Mar 3 15:18:03 2007 @@ -10,7 +10,6 @@ - Improved SPL (Marcus) . Added SplFileInfo::getBasename(), DirectoryIterator::getBasename(). . Added SplFileInfo::getLinkTarget(), SplFileInfo::getRealPath(). -# All based on suggestions by Arnold Davies - Added --ri switch to CLI which allows to check extension information. (Marcus) - Added tidyNode::getParent() method (John, Nuno) - Fixed zend_llist_remove_tail (Michael Wallner, Dmitry) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c
helly Sat Mar 3 19:01:35 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/main/streams streams.c Log: - MFH A stream wrapper might only allow directory access http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.11r2=1.82.2.6.2.12diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.82.2.6.2.11 php-src/main/streams/streams.c:1.82.2.6.2.12 --- php-src/main/streams/streams.c:1.82.2.6.2.11Wed Feb 21 21:57:21 2007 +++ php-src/main/streams/streams.c Sat Mar 3 19:01:34 2007 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.82.2.6.2.11 2007/02/21 21:57:21 tony2001 Exp $ */ +/* $Id: streams.c,v 1.82.2.6.2.12 2007/03/03 19:01:34 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -1769,10 +1769,14 @@ } if (wrapper) { - - stream = wrapper-wops-stream_opener(wrapper, + if (!wrapper-wops-stream_opener) { + php_stream_wrapper_log_error(wrapper, options ^ REPORT_ERRORS TSRMLS_CC, + wrapper does not support stream open); + } else { + stream = wrapper-wops-stream_opener(wrapper, path_to_open, mode, options ^ REPORT_ERRORS, opened_path, context STREAMS_REL_CC TSRMLS_CC); + } /* if the caller asked for a persistent stream but the wrapper did not * return one, force an error here */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard file.c
helly Sat Mar 3 19:07:51 2007 UTC Modified files: /php-src/ext/standard file.c Log: - Fix realpath() logic http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.485r2=1.486diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.485 php-src/ext/standard/file.c:1.486 --- php-src/ext/standard/file.c:1.485 Fri Feb 23 16:21:31 2007 +++ php-src/ext/standard/file.c Sat Mar 3 19:07:51 2007 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.485 2007/02/23 16:21:31 tony2001 Exp $ */ +/* $Id: file.c,v 1.486 2007/03/03 19:07:51 helly Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -2697,7 +2697,7 @@ #ifdef ZTS if (VCWD_ACCESS(resolved_path_buff, F_OK)) { RETVAL_FALSE; - } + } else #endif if (UG(unicode)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / configure.in /ext/standard basic_functions.c /main php_streams.h /main/streams glob_wrapper.c php_stream_glob_wrapper.h plain_wrapper.c
| +--+ | Copyright (c) 1997-2007 The PHP Group| +--+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is| | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | [EMAIL PROTECTED] so we can mail you a copy immediately. | +--+ | Authors: Marcus Boerger [EMAIL PROTECTED] | +--+ */ /* $Id: glob_wrapper.c,v 1.1 2007/03/03 20:41:12 helly Exp $ */ #include php.h #include php_streams_int.h #ifdef HAVE_GLOB # ifndef PHP_WIN32 # include glob.h # else # include win32/glob.h # endif #endif #ifndef GLOB_ONLYDIR #define GLOB_ONLYDIR (130) #define GLOB_FLAGMASK (~GLOB_ONLYDIR) #else #define GLOB_FLAGMASK (~0) #endif typedef struct { glob_t glob; size_t index; int flags; char *path; size_t path_len; } glob_s_t; PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, int *plen STREAMS_DC TSRMLS_DC) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream-abstract; if (pglob pglob-path) { if (plen) { *plen = pglob-path_len; } if (copy) { return estrndup(pglob-path, pglob-path_len); } else { return pglob-path; } } else { if (plen) { *plen = 0; } return NULL; } } /* }}} */ static void php_glob_stream_path_split(glob_s_t *pglob, char *path, int get_path, char **p_file TSRMLS_DC) /* {{{ */ { char *pos, *gpath = path; if ((pos = strrchr(path, '/')) != NULL) { path = pos+1; } #if defined(PHP_WIN32) || defined(NETWARE) if ((pos = strrchr(path, '\\')) != NULL) { if (pos != NULL) { path = pos+1; } #endif *p_file = path; if (get_path) { if (pglob-path) { efree(pglob-path); } pglob-path_len = path - gpath; pglob-path = estrndup(gpath, pglob-path_len); } } /* }}} */ static size_t php_glob_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream-abstract; php_stream_dirent *ent = (php_stream_dirent*)buf; char *path; /* avoid problems if someone mis-uses the stream */ if (count == sizeof(php_stream_dirent) pglob) { if (pglob-index pglob-glob.gl_pathc) { php_glob_stream_path_split(pglob, pglob-glob.gl_pathv[pglob-index++], pglob-flags GLOB_APPEND, path TSRMLS_CC); PHP_STRLCPY(ent-d_name, path, sizeof(ent-d_name), strlen(path)); return sizeof(php_stream_dirent); } pglob-index = pglob-glob.gl_pathc; if (pglob-path) { efree(pglob-path); pglob-path = NULL; } } return 0; } /* }}} */ static int php_glob_stream_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream-abstract; if (pglob) { pglob-index = 0; globfree(pglob-glob); if (pglob-path) { efree(pglob-path); } } efree(stream-abstract); return 0; } /* {{{ */ static int php_glob_stream_rewind(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream-abstract; if (pglob) { pglob-index = 0; if (pglob-path) { efree(pglob-path); pglob-path = NULL; } } return 0; } /* }}} */ static php_stream_ops php_glob_stream_ops = { NULL, php_glob_stream_read, php_glob_stream_close, NULL, glob, php_glob_stream_rewind, NULL, /* cast */ NULL, /* stat */ NULL /* set_option */ }; /* {{{ php_glob_stream_opener */ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC
[PHP-CVS] cvs: php-src /main/streams glob_wrapper.c php_stream_glob_wrapper.h
helly Sat Mar 3 20:56:45 2007 UTC Modified files: /php-src/main/streams glob_wrapper.c php_stream_glob_wrapper.h Log: - php_stream_is() requires php_glob_stream_ops to be public - little bit of additional whitespace http://cvs.php.net/viewvc.cgi/php-src/main/streams/glob_wrapper.c?r1=1.1r2=1.2diff_format=u Index: php-src/main/streams/glob_wrapper.c diff -u php-src/main/streams/glob_wrapper.c:1.1 php-src/main/streams/glob_wrapper.c:1.2 --- php-src/main/streams/glob_wrapper.c:1.1 Sat Mar 3 20:41:12 2007 +++ php-src/main/streams/glob_wrapper.c Sat Mar 3 20:56:45 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: glob_wrapper.c,v 1.1 2007/03/03 20:41:12 helly Exp $ */ +/* $Id: glob_wrapper.c,v 1.2 2007/03/03 20:56:45 helly Exp $ */ #include php.h #include php_streams_int.h @@ -147,7 +147,7 @@ } /* }}} */ -static php_stream_ops php_glob_stream_ops = { +php_stream_ops php_glob_stream_ops = { NULL, php_glob_stream_read, php_glob_stream_close, NULL, glob, @@ -203,7 +203,7 @@ } /* }}} */ -static php_stream_wrapper_ops php_glob_stream_wrapper_ops = { +static php_stream_wrapper_ops php_glob_stream_wrapper_ops = { NULL, NULL, NULL, @@ -216,7 +216,7 @@ NULL }; -php_stream_wrapper php_glob_stream_wrapper = { +php_stream_wrapper php_glob_stream_wrapper = { php_glob_stream_wrapper_ops, NULL, 0 http://cvs.php.net/viewvc.cgi/php-src/main/streams/php_stream_glob_wrapper.h?r1=1.1r2=1.2diff_format=u Index: php-src/main/streams/php_stream_glob_wrapper.h diff -u php-src/main/streams/php_stream_glob_wrapper.h:1.1 php-src/main/streams/php_stream_glob_wrapper.h:1.2 --- php-src/main/streams/php_stream_glob_wrapper.h:1.1 Sat Mar 3 20:41:12 2007 +++ php-src/main/streams/php_stream_glob_wrapper.h Sat Mar 3 20:56:45 2007 @@ -16,9 +16,10 @@ +--+ */ -/* $Id: php_stream_glob_wrapper.h,v 1.1 2007/03/03 20:41:12 helly Exp $ */ +/* $Id: php_stream_glob_wrapper.h,v 1.2 2007/03/03 20:56:45 helly Exp $ */ -PHPAPI extern php_stream_wrapper php_glob_stream_wrapper; +PHPAPI extern php_stream_wrapper php_glob_stream_wrapper; +PHPAPI extern php_stream_ops php_glob_stream_ops; BEGIN_EXTERN_C() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams glob_wrapper.c php_stream_glob_wrapper.h
helly Sat Mar 3 21:38:25 2007 UTC Modified files: /php-src/main/streams glob_wrapper.c php_stream_glob_wrapper.h Log: - Provide access to pattern used in glob http://cvs.php.net/viewvc.cgi/php-src/main/streams/glob_wrapper.c?r1=1.2r2=1.3diff_format=u Index: php-src/main/streams/glob_wrapper.c diff -u php-src/main/streams/glob_wrapper.c:1.2 php-src/main/streams/glob_wrapper.c:1.3 --- php-src/main/streams/glob_wrapper.c:1.2 Sat Mar 3 20:56:45 2007 +++ php-src/main/streams/glob_wrapper.c Sat Mar 3 21:38:25 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: glob_wrapper.c,v 1.2 2007/03/03 20:56:45 helly Exp $ */ +/* $Id: glob_wrapper.c,v 1.3 2007/03/03 21:38:25 helly Exp $ */ #include php.h #include php_streams_int.h @@ -42,6 +42,8 @@ int flags; char *path; size_t path_len; + char *pattern; + size_t pattern_len; } glob_s_t; PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, int *plen STREAMS_DC TSRMLS_DC) /* {{{ */ @@ -66,6 +68,28 @@ } /* }}} */ +PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, int *plen STREAMS_DC TSRMLS_DC) /* {{{ */ +{ + glob_s_t *pglob = (glob_s_t *)stream-abstract; + + if (pglob pglob-pattern) { + if (plen) { + *plen = pglob-pattern_len; + } + if (copy) { + return estrndup(pglob-pattern, pglob-pattern_len); + } else { + return pglob-pattern; + } + } else { + if (plen) { + *plen = 0; + } + return NULL; + } +} +/* }}} */ + static void php_glob_stream_path_split(glob_s_t *pglob, char *path, int get_path, char **p_file TSRMLS_DC) /* {{{ */ { char *pos, *gpath = path; @@ -75,7 +99,6 @@ } #if defined(PHP_WIN32) || defined(NETWARE) if ((pos = strrchr(path, '\\')) != NULL) { - if (pos != NULL) { path = pos+1; } #endif @@ -86,6 +109,9 @@ if (pglob-path) { efree(pglob-path); } + if (path != gpath) { + path--; + } pglob-path_len = path - gpath; pglob-path = estrndup(gpath, pglob-path_len); } @@ -126,6 +152,9 @@ if (pglob-path) { efree(pglob-path); } + if (pglob-pattern) { + efree(pglob-pattern); + } } efree(stream-abstract); return 0; @@ -163,7 +192,7 @@ { glob_s_t *pglob; int ret; - char *tmp; + char *tmp, *pos; if (((options STREAM_DISABLE_OPEN_BASEDIR) == 0) php_check_open_basedir(path TSRMLS_CC)) { return NULL; @@ -199,6 +228,19 @@ } } + pos = path; + if ((tmp = strrchr(pos, '/')) != NULL) { + pos = tmp+1; + } +#if defined(PHP_WIN32) || defined(NETWARE) + if ((tmp = strrchr(pos, '\\')) != NULL) { + pos = tmp+1; + } +#endif + + pglob-pattern_len = strlen(pos); + pglob-pattern = estrndup(pos, pglob-pattern_len); + return php_stream_alloc(php_glob_stream_ops, pglob, 0, mode); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/main/streams/php_stream_glob_wrapper.h?r1=1.2r2=1.3diff_format=u Index: php-src/main/streams/php_stream_glob_wrapper.h diff -u php-src/main/streams/php_stream_glob_wrapper.h:1.2 php-src/main/streams/php_stream_glob_wrapper.h:1.3 --- php-src/main/streams/php_stream_glob_wrapper.h:1.2 Sat Mar 3 20:56:45 2007 +++ php-src/main/streams/php_stream_glob_wrapper.h Sat Mar 3 21:38:25 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_stream_glob_wrapper.h,v 1.2 2007/03/03 20:56:45 helly Exp $ */ +/* $Id: php_stream_glob_wrapper.h,v 1.3 2007/03/03 21:38:25 helly Exp $ */ PHPAPI extern php_stream_wrapper php_glob_stream_wrapper; PHPAPI extern php_stream_ops php_glob_stream_ops; @@ -26,6 +26,9 @@ PHPAPI char* _php_glob_stream_get_path(php_stream *stream, int copy, int *plen STREAMS_DC TSRMLS_DC); #define php_glob_stream_get_path(stream, copy, plen) _php_glob_stream_get_path((stream), (copy), (plen) STREAMS_CC TSRMLS_CC) +PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, int *plen STREAMS_DC TSRMLS_DC); +#define php_glob_stream_get_pattern(stream, copy, plen) _php_glob_stream_get_pattern((stream), (copy), (plen) STREAMS_CC TSRMLS_CC) + END_EXTERN_C() /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /win32 php5dllts.dsp /win32/build config.w32
helly Sat Mar 3 21:40:24 2007 UTC Modified files: /php-src/win32 php5dllts.dsp /php-src/win32/buildconfig.w32 Log: - Add glob stream to win build http://cvs.php.net/viewvc.cgi/php-src/win32/php5dllts.dsp?r1=1.9r2=1.10diff_format=u Index: php-src/win32/php5dllts.dsp diff -u php-src/win32/php5dllts.dsp:1.9 php-src/win32/php5dllts.dsp:1.10 --- php-src/win32/php5dllts.dsp:1.9 Fri Nov 10 09:56:37 2006 +++ php-src/win32/php5dllts.dsp Sat Mar 3 21:40:23 2007 @@ -2176,6 +2176,10 @@ # End Source File # Begin Source File +SOURCE=..\main\streams\php_stream_glob_wrapper.h +# End Source File +# Begin Source File + SOURCE=..\main\streams\php_stream_mmap.h # End Source File # Begin Source File @@ -2205,6 +2209,10 @@ # End Source File # Begin Source File +SOURCE=..\main\streams\glob_wrapper.c +# End Source File +# Begin Source File + SOURCE=..\main\streams\memory.c # End Source File # Begin Source File http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.62r2=1.63diff_format=u Index: php-src/win32/build/config.w32 diff -u php-src/win32/build/config.w32:1.62 php-src/win32/build/config.w32:1.63 --- php-src/win32/build/config.w32:1.62 Wed Dec 20 10:50:46 2006 +++ php-src/win32/build/config.w32 Sat Mar 3 21:40:23 2007 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32,v 1.62 2006/12/20 10:50:46 dmitry Exp $ +// $Id: config.w32,v 1.63 2007/03/03 21:40:23 helly Exp $ // Master config file; think of it as a configure.in // equivalent. @@ -286,7 +286,7 @@ php_open_temporary_file.c php_logos.c output.c internal_functions.c php_sprintf.c); ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c plain_wrapper.c \ - userspace.c transports.c xp_socket.c mmap.c unicode_filter.c); + userspace.c transports.c xp_socket.c mmap.c unicode_filter.c glob_wrapper.c); ADD_SOURCES(win32, crypt_win32.c flock.c glob.c md5crypt.c readdir.c \ registry.c select.c sendmail.c time.c wfile.c winutil.c wsyslog.c globals.c); -- 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
helly Sat Mar 3 21:41:56 2007 UTC Modified files: /php-src/ext/splspl_directory.c spl_directory.h Log: - Add glob support for DirectoryIterator http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.124r2=1.125diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.124 php-src/ext/spl/spl_directory.c:1.125 --- php-src/ext/spl/spl_directory.c:1.124 Sat Mar 3 14:51:40 2007 +++ php-src/ext/spl/spl_directory.c Sat Mar 3 21:41:56 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.124 2007/03/03 14:51:40 helly Exp $ */ +/* $Id: spl_directory.c,v 1.125 2007/03/03 21:41:56 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -178,15 +178,27 @@ /* 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; + + if (intern-flags SPL_FILE_DIR_USE_GLOB) { + options |= STREAM_USE_GLOB_DIR_OPEN; + } + intern-type = SPL_FS_DIR; intern-path_type= type; intern-path_len = path_len; - intern-u.dir.dirp = php_stream_u_opendir(type, path, path_len, REPORT_ERRORS, NULL); + intern-u.dir.dirp = php_stream_u_opendir(type, path, path_len, options, NULL); - if (intern-path_len IS_SLASH_AT(type, path, intern-path_len-1)) { + if (php_stream_is(intern-u.dir.dirp, php_glob_stream_ops)) { + intern-path.s = php_glob_stream_get_path(intern-u.dir.dirp, 1, intern-path_len); + intern-path_type = IS_STRING; + intern-flags |= SPL_FILE_DIR_USE_GLOB; + } else if (intern-path_len IS_SLASH_AT(type, path, intern-path_len-1)) { intern-path = ezstrndup(type, path, --intern-path_len); + intern-flags = ~SPL_FILE_DIR_USE_GLOB; } else { intern-path = ezstrndup(type, path, intern-path_len); + intern-flags = ~SPL_FILE_DIR_USE_GLOB; } intern-u.dir.index = 0; @@ -518,7 +530,7 @@ } /* */ -/* {{{ proto void DirectoryIterator::__construct(string path) U +/* {{{ proto void DirectoryIterator::__construct(string $path, [int $flags = 0]) U Cronstructs a new dir iterator from a path. */ SPL_METHOD(DirectoryIterator, __construct) { @@ -526,10 +538,11 @@ zstr path; int len; zend_uchar path_type; + long flags = 0; php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t, path, len, path_type) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t|l, path, len, path_type, flags) == FAILURE) { php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return; } @@ -542,10 +555,10 @@ intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + intern-flags = flags; spl_filesystem_dir_open(intern, path_type, path, len TSRMLS_CC); intern-u.dir.is_recursive = instanceof_function(intern-std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0; - intern-flags = 0; php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } @@ -1077,9 +1090,9 @@ } intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - spl_filesystem_dir_open(intern, path_type, path, path_len TSRMLS_CC); intern-u.dir.is_recursive = instanceof_function(intern-std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0; intern-flags = flags; + spl_filesystem_dir_open(intern, path_type, path, path_len TSRMLS_CC); php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } @@ -1151,17 +1164,32 @@ Returns an iterator for the current entry if it is a directory */ SPL_METHOD(RecursiveDirectoryIterator, getChildren) { - zval zpath; + zval zpath, zflags; spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); spl_filesystem_object *subdir; spl_filesystem_object_get_file_name(intern TSRMLS_CC); + INIT_PZVAL(zflags); + ZVAL_LONG(zflags, intern-flags); + INIT_PZVAL(zpath); - ZVAL_ZSTRL(zpath, intern-file_name_type, intern-file_name, intern-file_name_len, 0); + if (intern-flags SPL_FILE_DIR_USE_GLOB) { + Z_TYPE(zpath) = IS_STRING; + spprintf(Z_STRVAL(zpath), 0, %R%c%s, + intern-file_name_type, intern-file_name, + DEFAULT_SLASH, + php_glob_stream_get_pattern(intern-u.dir.dirp, 0, NULL)); + } else { + ZVAL_ZSTRL(zpath, intern-file_name_type, intern-file_name, intern-file_name_len,
[PHP-CVS] cvs: php-src /main php_streams.h
helly Sat Mar 3 22:30:07 2007 UTC Modified files: /php-src/main php_streams.h Log: - One more tab to go http://cvs.php.net/viewvc.cgi/php-src/main/php_streams.h?r1=1.127r2=1.128diff_format=u Index: php-src/main/php_streams.h diff -u php-src/main/php_streams.h:1.127 php-src/main/php_streams.h:1.128 --- php-src/main/php_streams.h:1.127Sat Mar 3 22:28:21 2007 +++ php-src/main/php_streams.h Sat Mar 3 22:30:07 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_streams.h,v 1.127 2007/03/03 22:28:21 helly Exp $ */ +/* $Id: php_streams.h,v 1.128 2007/03/03 22:30:07 helly Exp $ */ #ifndef PHP_STREAMS_H #define PHP_STREAMS_H @@ -614,7 +614,7 @@ #define STREAM_DISABLE_OPEN_BASEDIR 0x0400 /* get (or create) a persistent version of the stream */ -#define STREAM_OPEN_PERSISTENT 0x0800 +#define STREAM_OPEN_PERSISTENT 0x0800 /* use glob stream for directory open in plain files stream */ #define STREAM_USE_GLOB_DIR_OPEN0x1000 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams glob_wrapper.c php_stream_glob_wrapper.h
helly Sat Mar 3 23:04:57 2007 UTC Modified files: /php-src/main/streams glob_wrapper.c php_stream_glob_wrapper.h Log: - Allow to get number of entries of a glob stream http://cvs.php.net/viewvc.cgi/php-src/main/streams/glob_wrapper.c?r1=1.3r2=1.4diff_format=u Index: php-src/main/streams/glob_wrapper.c diff -u php-src/main/streams/glob_wrapper.c:1.3 php-src/main/streams/glob_wrapper.c:1.4 --- php-src/main/streams/glob_wrapper.c:1.3 Sat Mar 3 21:38:25 2007 +++ php-src/main/streams/glob_wrapper.c Sat Mar 3 23:04:57 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: glob_wrapper.c,v 1.3 2007/03/03 21:38:25 helly Exp $ */ +/* $Id: glob_wrapper.c,v 1.4 2007/03/03 23:04:57 helly Exp $ */ #include php.h #include php_streams_int.h @@ -90,6 +90,14 @@ } /* }}} */ +PHPAPI int _php_glob_stream_get_count(php_stream *stream STREAMS_DC TSRMLS_DC) /* {{{ */ +{ + glob_s_t *pglob = (glob_s_t *)stream-abstract; + + return pglob ? pglob-glob.gl_pathc : 0; +} +/* }}} */ + static void php_glob_stream_path_split(glob_s_t *pglob, char *path, int get_path, char **p_file TSRMLS_DC) /* {{{ */ { char *pos, *gpath = path; http://cvs.php.net/viewvc.cgi/php-src/main/streams/php_stream_glob_wrapper.h?r1=1.3r2=1.4diff_format=u Index: php-src/main/streams/php_stream_glob_wrapper.h diff -u php-src/main/streams/php_stream_glob_wrapper.h:1.3 php-src/main/streams/php_stream_glob_wrapper.h:1.4 --- php-src/main/streams/php_stream_glob_wrapper.h:1.3 Sat Mar 3 21:38:25 2007 +++ php-src/main/streams/php_stream_glob_wrapper.h Sat Mar 3 23:04:57 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_stream_glob_wrapper.h,v 1.3 2007/03/03 21:38:25 helly Exp $ */ +/* $Id: php_stream_glob_wrapper.h,v 1.4 2007/03/03 23:04:57 helly Exp $ */ PHPAPI extern php_stream_wrapper php_glob_stream_wrapper; PHPAPI extern php_stream_ops php_glob_stream_ops; @@ -29,6 +29,9 @@ PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, int *plen STREAMS_DC TSRMLS_DC); #define php_glob_stream_get_pattern(stream, copy, plen) _php_glob_stream_get_pattern((stream), (copy), (plen) STREAMS_CC TSRMLS_CC) +PHPAPI int _php_glob_stream_get_count(php_stream *stream STREAMS_DC TSRMLS_DC); +#define php_glob_stream_get_count(stream) _php_glob_stream_get_count((stream) STREAMS_CC TSRMLS_CC) + END_EXTERN_C() /* -- 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
helly Sat Mar 3 23:07:33 2007 UTC Modified files: /php-src/ext/splspl_directory.c Log: - Add DirectoryIterator::count() http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.125r2=1.126diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.125 php-src/ext/spl/spl_directory.c:1.126 --- php-src/ext/spl/spl_directory.c:1.125 Sat Mar 3 21:41:56 2007 +++ php-src/ext/spl/spl_directory.c Sat Mar 3 23:07:33 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.125 2007/03/03 21:41:56 helly Exp $ */ +/* $Id: spl_directory.c,v 1.126 2007/03/03 23:07:33 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -189,7 +189,7 @@ intern-path_len = path_len; intern-u.dir.dirp = php_stream_u_opendir(type, path, path_len, options, NULL); - if (php_stream_is(intern-u.dir.dirp, php_glob_stream_ops)) { + if (intern-u.dir.dirp php_stream_is(intern-u.dir.dirp, php_glob_stream_ops)) { intern-path.s = php_glob_stream_get_path(intern-u.dir.dirp, 1, intern-path_len); intern-path_type = IS_STRING; intern-flags |= SPL_FILE_DIR_USE_GLOB; @@ -629,6 +629,19 @@ } /* }}} */ +/* {{{ proto string DirectoryIterator::count() U + Return number of entries in directory, works only when USE_GLOB is in effect */ +SPL_METHOD(DirectoryIterator, count) +{ + spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + + if (intern-flags SPL_FILE_DIR_USE_GLOB) { + RETURN_LONG(php_glob_stream_get_count(intern-u.dir.dirp)); + } + zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, Unable to determine count unless USE_GLOG flag is in effect); +} +/* }}} */ + /* {{{ proto string SplFileInfo::getPath() U Return the path */ SPL_METHOD(SplFileInfo, getPath) @@ -1597,6 +1610,7 @@ SPL_ME(DirectoryIterator, key, NULL, ZEND_ACC_PUBLIC) SPL_ME(DirectoryIterator, current, NULL, ZEND_ACC_PUBLIC) SPL_ME(DirectoryIterator, next, NULL, ZEND_ACC_PUBLIC) + SPL_ME(DirectoryIterator, count, NULL, ZEND_ACC_PUBLIC) SPL_MA(DirectoryIterator, __toString, DirectoryIterator, getFilename, NULL, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams glob_wrapper.c php_stream_glob_wrapper.h
helly Sat Mar 3 23:41:10 2007 UTC Modified files: /php-src/main/streams glob_wrapper.c php_stream_glob_wrapper.h Log: - Allow to retrieve flags with php_glob_stream_get_count() - Detect meta chars in pathand switch to append mode so that path can actually changes for each entry http://cvs.php.net/viewvc.cgi/php-src/main/streams/glob_wrapper.c?r1=1.4r2=1.5diff_format=u Index: php-src/main/streams/glob_wrapper.c diff -u php-src/main/streams/glob_wrapper.c:1.4 php-src/main/streams/glob_wrapper.c:1.5 --- php-src/main/streams/glob_wrapper.c:1.4 Sat Mar 3 23:04:57 2007 +++ php-src/main/streams/glob_wrapper.c Sat Mar 3 23:41:10 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: glob_wrapper.c,v 1.4 2007/03/03 23:04:57 helly Exp $ */ +/* $Id: glob_wrapper.c,v 1.5 2007/03/03 23:41:10 helly Exp $ */ #include php.h #include php_streams_int.h @@ -90,11 +90,21 @@ } /* }}} */ -PHPAPI int _php_glob_stream_get_count(php_stream *stream STREAMS_DC TSRMLS_DC) /* {{{ */ +PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC TSRMLS_DC) /* {{{ */ { glob_s_t *pglob = (glob_s_t *)stream-abstract; - - return pglob ? pglob-glob.gl_pathc : 0; + + if (pglob) { + if (pflags) { + *pflags = pglob-flags; + } + return pglob-glob.gl_pathc; + } else { + if (pflags) { + *pflags = 0; + } + return 0; + } } /* }}} */ @@ -199,7 +209,7 @@ int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { glob_s_t *pglob; - int ret; + int ret, path_len; char *tmp, *pos; if (((options STREAM_DISABLE_OPEN_BASEDIR) == 0) php_check_open_basedir(path TSRMLS_CC)) { @@ -208,9 +218,12 @@ if (!strncmp(path, glob://, sizeof(glob://)-1)) { path += sizeof(glob://)-1; + path_len = strlen(path); if (opened_path) { - *opened_path = estrdup(path); + *opened_path = estrndup(path, path_len); } + } else { + path_len = strlen(path); } pglob = ecalloc(sizeof(*pglob), 1); @@ -225,17 +238,6 @@ } } -#ifdef GLOB_APPEND - if ((pglob-flags GLOB_APPEND) == 0) -#endif - { - if (pglob-glob.gl_pathc) { - php_glob_stream_path_split(pglob, pglob-glob.gl_pathv[0], 1, tmp TSRMLS_CC); - } else { - php_glob_stream_path_split(pglob, path, 1, tmp TSRMLS_CC); - } - } - pos = path; if ((tmp = strrchr(pos, '/')) != NULL) { pos = tmp+1; @@ -249,6 +251,16 @@ pglob-pattern_len = strlen(pos); pglob-pattern = estrndup(pos, pglob-pattern_len); + if (strcspn(path, *?) (path_len - pglob-pattern_len)) { + pglob-flags |= GLOB_APPEND; + } + + if (pglob-glob.gl_pathc) { + php_glob_stream_path_split(pglob, pglob-glob.gl_pathv[0], 1, tmp TSRMLS_CC); + } else { + php_glob_stream_path_split(pglob, path, 1, tmp TSRMLS_CC); + } + return php_stream_alloc(php_glob_stream_ops, pglob, 0, mode); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/main/streams/php_stream_glob_wrapper.h?r1=1.4r2=1.5diff_format=u Index: php-src/main/streams/php_stream_glob_wrapper.h diff -u php-src/main/streams/php_stream_glob_wrapper.h:1.4 php-src/main/streams/php_stream_glob_wrapper.h:1.5 --- php-src/main/streams/php_stream_glob_wrapper.h:1.4 Sat Mar 3 23:04:57 2007 +++ php-src/main/streams/php_stream_glob_wrapper.h Sat Mar 3 23:41:10 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_stream_glob_wrapper.h,v 1.4 2007/03/03 23:04:57 helly Exp $ */ +/* $Id: php_stream_glob_wrapper.h,v 1.5 2007/03/03 23:41:10 helly Exp $ */ PHPAPI extern php_stream_wrapper php_glob_stream_wrapper; PHPAPI extern php_stream_ops php_glob_stream_ops; @@ -29,8 +29,8 @@ PHPAPI char* _php_glob_stream_get_pattern(php_stream *stream, int copy, int *plen STREAMS_DC TSRMLS_DC); #define php_glob_stream_get_pattern(stream, copy, plen) _php_glob_stream_get_pattern((stream), (copy), (plen) STREAMS_CC TSRMLS_CC) -PHPAPI int _php_glob_stream_get_count(php_stream *stream STREAMS_DC TSRMLS_DC); -#define php_glob_stream_get_count(stream) _php_glob_stream_get_count((stream) STREAMS_CC TSRMLS_CC) +PHPAPI int _php_glob_stream_get_count(php_stream *stream, int *pflags STREAMS_DC TSRMLS_DC); +#define php_glob_stream_get_count(stream, pflags) _php_glob_stream_get_count((stream), (pflags) STREAMS_CC TSRMLS_CC) END_EXTERN_C() -- PHP
[PHP-CVS] cvs: php-src /ext/spl spl_directory.c spl_directory.h
helly Sat Mar 3 23:41:43 2007 UTC Modified files: /php-src/ext/splspl_directory.c spl_directory.h Log: - Glob might require us to refetch the path for every entry http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.126r2=1.127diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.126 php-src/ext/spl/spl_directory.c:1.127 --- php-src/ext/spl/spl_directory.c:1.126 Sat Mar 3 23:07:33 2007 +++ php-src/ext/spl/spl_directory.c Sat Mar 3 23:41:43 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.126 2007/03/03 23:07:33 helly Exp $ */ +/* $Id: spl_directory.c,v 1.127 2007/03/03 23:41:43 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -45,6 +45,14 @@ #include ext/standard/php_filestat.h #include ext/standard/php_link.h +#ifdef HAVE_GLOB +# ifndef PHP_WIN32 +# include glob.h +# else +# include win32/glob.h +# endif +#endif + /* declare the class handlers */ static zend_object_handlers spl_filesystem_object_handlers; @@ -174,11 +182,28 @@ #define IS_SLASH_AT(type, zs, pos) (type == IS_UNICODE ? IS_U_SLASH(zs.u[pos]) : IS_SLASH(zs.s[pos])) +static int spl_filesystem_dir_read(spl_filesystem_object *intern TSRMLS_DC) /* {{{ */ +{ + if (!intern-u.dir.dirp || !php_stream_readdir(intern-u.dir.dirp, intern-u.dir.entry)) { + intern-u.dir.entry.d_name[0] = '\0'; + return 0; + } else { + if (intern-flags SPL_FILE_DIR_GLOB_REFETCH_PATH) { + if (intern-path.v) { + efree(intern-path.v); + } + intern-path.s = php_glob_stream_get_path(intern-u.dir.dirp, 1, intern-path_len); + } + return 1; + } +} +/* }}} */ + /* {{{ 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 options = REPORT_ERRORS, flags; if (intern-flags SPL_FILE_DIR_USE_GLOB) { options |= STREAM_USE_GLOB_DIR_OPEN; @@ -193,12 +218,18 @@ intern-path.s = php_glob_stream_get_path(intern-u.dir.dirp, 1, intern-path_len); intern-path_type = IS_STRING; intern-flags |= SPL_FILE_DIR_USE_GLOB; + php_glob_stream_get_count(intern-u.dir.dirp, flags); + if (flags GLOB_APPEND) { + intern-flags |= SPL_FILE_DIR_GLOB_REFETCH_PATH; + } else { + intern-flags = ~SPL_FILE_DIR_GLOB_REFETCH_PATH; + } } else if (intern-path_len IS_SLASH_AT(type, path, intern-path_len-1)) { intern-path = ezstrndup(type, path, --intern-path_len); - intern-flags = ~SPL_FILE_DIR_USE_GLOB; + intern-flags = ~(SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_GLOB_REFETCH_PATH); } else { intern-path = ezstrndup(type, path, intern-path_len); - intern-flags = ~SPL_FILE_DIR_USE_GLOB; + intern-flags = ~(SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_GLOB_REFETCH_PATH); } intern-u.dir.index = 0; @@ -206,9 +237,7 @@ /* throw exception: should've been already happened */ intern-u.dir.entry.d_name[0] = '\0'; } else { - if (!php_stream_readdir(intern-u.dir.dirp, intern-u.dir.entry)) { - intern-u.dir.entry.d_name[0] = '\0'; - } + spl_filesystem_dir_read(intern TSRMLS_CC); } } /* }}} */ @@ -574,9 +603,8 @@ if (intern-u.dir.dirp) { php_stream_rewinddir(intern-u.dir.dirp); } - if (!intern-u.dir.dirp || !php_stream_readdir(intern-u.dir.dirp, intern-u.dir.entry)) { - intern-u.dir.entry.d_name[0] = '\0'; - } + + spl_filesystem_dir_read(intern TSRMLS_CC); } /* }}} */ @@ -609,9 +637,7 @@ spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); intern-u.dir.index++; - if (!intern-u.dir.dirp || !php_stream_readdir(intern-u.dir.dirp, intern-u.dir.entry)) { - intern-u.dir.entry.d_name[0] = '\0'; - } + spl_filesystem_dir_read(intern TSRMLS_CC); if (intern-file_name.v) { efree(intern-file_name.v); intern-file_name = NULL_ZSTR; @@ -636,7 +662,7 @@ spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); if (intern-flags SPL_FILE_DIR_USE_GLOB) { - RETURN_LONG(php_glob_stream_get_count(intern-u.dir.dirp)); + RETURN_LONG(php_glob_stream_get_count(intern-u.dir.dirp,
[PHP-CVS] cvs: php-src /main/streams glob_wrapper.c
helly Sat Mar 3 23:56:43 2007 UTC Modified files: /php-src/main/streams glob_wrapper.c Log: - Missed to add [ to meta char check http://cvs.php.net/viewvc.cgi/php-src/main/streams/glob_wrapper.c?r1=1.5r2=1.6diff_format=u Index: php-src/main/streams/glob_wrapper.c diff -u php-src/main/streams/glob_wrapper.c:1.5 php-src/main/streams/glob_wrapper.c:1.6 --- php-src/main/streams/glob_wrapper.c:1.5 Sat Mar 3 23:41:10 2007 +++ php-src/main/streams/glob_wrapper.c Sat Mar 3 23:56:43 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: glob_wrapper.c,v 1.5 2007/03/03 23:41:10 helly Exp $ */ +/* $Id: glob_wrapper.c,v 1.6 2007/03/03 23:56:43 helly Exp $ */ #include php.h #include php_streams_int.h @@ -251,7 +251,7 @@ pglob-pattern_len = strlen(pos); pglob-pattern = estrndup(pos, pglob-pattern_len); - if (strcspn(path, *?) (path_len - pglob-pattern_len)) { + if (strcspn(path, *?[) (path_len - pglob-pattern_len)) { pglob-flags |= GLOB_APPEND; } -- 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
helly Sun Mar 4 00:23:07 2007 UTC Modified files: /php-src/ext/splspl_directory.c spl_directory.h Log: - Fix a minor issue with glob support - forgot to set length of string - Add ability to not use glob on subdirs http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.127r2=1.128diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.127 php-src/ext/spl/spl_directory.c:1.128 --- php-src/ext/spl/spl_directory.c:1.127 Sat Mar 3 23:41:43 2007 +++ php-src/ext/spl/spl_directory.c Sun Mar 4 00:23:07 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.127 2007/03/03 23:41:43 helly Exp $ */ +/* $Id: spl_directory.c,v 1.128 2007/03/04 00:23:07 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1206,24 +1206,22 @@ spl_filesystem_object_get_file_name(intern TSRMLS_CC); INIT_PZVAL(zflags); - ZVAL_LONG(zflags, intern-flags); - INIT_PZVAL(zpath); - if (intern-flags SPL_FILE_DIR_USE_GLOB) { + if ((intern-flags (SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_NO_GLOB_CHILD)) == SPL_FILE_DIR_USE_GLOB) { + ZVAL_LONG(zflags, intern-flags); Z_TYPE(zpath) = IS_STRING; - spprintf(Z_STRVAL(zpath), 0, %R%c%s, + Z_STRLEN(zpath) = spprintf(Z_STRVAL(zpath), 0, %R%c%s, intern-file_name_type, intern-file_name, DEFAULT_SLASH, php_glob_stream_get_pattern(intern-u.dir.dirp, 0, NULL)); } else { - ZVAL_ZSTRL(zpath, intern-file_name_type, intern-file_name, intern-file_name_len, 0); + ZVAL_LONG(zflags, intern-flags ~SPL_FILE_DIR_USE_GLOB); + ZVAL_ZSTRL(zpath, intern-file_name_type, intern-file_name, intern-file_name_len, 1); } spl_instantiate_arg_ex2(spl_ce_RecursiveDirectoryIterator, return_value, 0, zpath, zflags TSRMLS_CC); - if (intern-flags SPL_FILE_DIR_USE_GLOB) { - efree(Z_STRVAL(zpath)); - } + zval_dtor(zpath); subdir = (spl_filesystem_object*)zend_object_store_get_object(return_value TSRMLS_CC); if (subdir) { @@ -2509,7 +2507,8 @@ REGISTER_SPL_SUB_CLASS_EX(DirectoryIterator, SplFileInfo, spl_filesystem_object_new, spl_DirectoryIterator_functions); 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, USE_GLOB, SPL_FILE_DIR_USE_GLOB); + REGISTER_SPL_CLASS_CONST_LONG(DirectoryIterator, NO_GLOB_CHILD, SPL_FILE_DIR_NO_GLOB_CHILD); 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.31r2=1.32diff_format=u Index: php-src/ext/spl/spl_directory.h diff -u php-src/ext/spl/spl_directory.h:1.31 php-src/ext/spl/spl_directory.h:1.32 --- php-src/ext/spl/spl_directory.h:1.31Sat Mar 3 23:41:43 2007 +++ php-src/ext/spl/spl_directory.h Sun Mar 4 00:23:07 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.h,v 1.31 2007/03/03 23:41:43 helly Exp $ */ +/* $Id: spl_directory.h,v 1.32 2007/03/04 00:23:07 helly Exp $ */ #ifndef SPL_DIRECTORY_H #define SPL_DIRECTORY_H @@ -122,6 +122,7 @@ #define SPL_FILE_DIR_USE_GLOB 0x1000 /* use glob for open dir*/ #define SPL_FILE_DIR_GLOB_REFETCH_PATH 0x2000 /* whether we need to refetch the path in glob mode */ +#define SPL_FILE_DIR_NO_GLOB_CHILD 0x4000 /* do not 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
[PHP-CVS] cvs: php-src /ext/spl spl_directory.c spl_directory.h
helly Sun Mar 4 00:36:08 2007 UTC Modified files: /php-src/ext/splspl_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.128r2=1.129diff_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.32r2=1.33diff_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.32Sun 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 0x1000 /* use glob for open dir*/ #define SPL_FILE_DIR_GLOB_REFETCH_PATH 0x2000 /* whether we need to refetch the path in glob mode */ -#define SPL_FILE_DIR_NO_GLOB_CHILD 0x4000 /* do not use glob on childs */ +#define SPL_FILE_DIR_CHILD_GLOB0x4000 /* 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
[PHP-CVS] cvs: php-src /ext/spl spl_directory.c spl_directory.h
helly Sun Mar 4 00:42:30 2007 UTC Modified files: /php-src/ext/splspl_directory.c spl_directory.h Log: - And finally use prefix style names for consistency sake http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.129r2=1.130diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.129 php-src/ext/spl/spl_directory.c:1.130 --- php-src/ext/spl/spl_directory.c:1.129 Sun Mar 4 00:36:08 2007 +++ php-src/ext/spl/spl_directory.c Sun Mar 4 00:42:30 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.129 2007/03/04 00:36:08 helly Exp $ */ +/* $Id: spl_directory.c,v 1.130 2007/03/04 00:42:30 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -205,7 +205,7 @@ { int options = REPORT_ERRORS, flags; - if (intern-flags SPL_FILE_DIR_USE_GLOB) { + if (intern-flags SPL_FILE_DIR_GLOB_USE) { options |= STREAM_USE_GLOB_DIR_OPEN; } @@ -217,7 +217,7 @@ if (intern-u.dir.dirp php_stream_is(intern-u.dir.dirp, php_glob_stream_ops)) { intern-path.s = php_glob_stream_get_path(intern-u.dir.dirp, 1, intern-path_len); intern-path_type = IS_STRING; - intern-flags |= SPL_FILE_DIR_USE_GLOB; + intern-flags |= SPL_FILE_DIR_GLOB_USE; php_glob_stream_get_count(intern-u.dir.dirp, flags); if (flags GLOB_APPEND) { intern-flags |= SPL_FILE_DIR_GLOB_REFETCH_PATH; @@ -226,10 +226,10 @@ } } else if (intern-path_len IS_SLASH_AT(type, path, intern-path_len-1)) { intern-path = ezstrndup(type, path, --intern-path_len); - intern-flags = ~(SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_GLOB_REFETCH_PATH); + intern-flags = ~(SPL_FILE_DIR_GLOB_USE|SPL_FILE_DIR_GLOB_REFETCH_PATH); } else { intern-path = ezstrndup(type, path, intern-path_len); - intern-flags = ~(SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_GLOB_REFETCH_PATH); + intern-flags = ~(SPL_FILE_DIR_GLOB_USE|SPL_FILE_DIR_GLOB_REFETCH_PATH); } intern-u.dir.index = 0; @@ -661,7 +661,7 @@ { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (intern-flags SPL_FILE_DIR_USE_GLOB) { + if (intern-flags SPL_FILE_DIR_GLOB_USE) { RETURN_LONG(php_glob_stream_get_count(intern-u.dir.dirp, NULL)); } zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, Unable to determine count unless USE_GLOG flag is in effect); @@ -1207,7 +1207,7 @@ INIT_PZVAL(zflags); INIT_PZVAL(zpath); - if ((intern-flags (SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_CHILD_GLOB)) == (SPL_FILE_DIR_USE_GLOB|SPL_FILE_DIR_CHILD_GLOB)) { + if ((intern-flags (SPL_FILE_DIR_GLOB_USE|SPL_FILE_DIR_GLOB_CHILD)) == (SPL_FILE_DIR_GLOB_USE|SPL_FILE_DIR_GLOB_CHILD)) { 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|SPL_FILE_DIR_CHILD_GLOB)); + ZVAL_LONG(zflags, intern-flags ~(SPL_FILE_DIR_GLOB_USE|SPL_FILE_DIR_GLOB_CHILD)); ZVAL_ZSTRL(zpath, intern-file_name_type, intern-file_name, intern-file_name_len, 1); } @@ -2507,8 +2507,8 @@ REGISTER_SPL_SUB_CLASS_EX(DirectoryIterator, SplFileInfo, spl_filesystem_object_new, spl_DirectoryIterator_functions); 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, CHILD_GLOB, SPL_FILE_DIR_CHILD_GLOB); + REGISTER_SPL_CLASS_CONST_LONG(DirectoryIterator, GLOB, SPL_FILE_DIR_GLOB_USE); + REGISTER_SPL_CLASS_CONST_LONG(DirectoryIterator, GLOB_CHILD, SPL_FILE_DIR_GLOB_CHILD); 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.33r2=1.34diff_format=u Index: php-src/ext/spl/spl_directory.h diff -u php-src/ext/spl/spl_directory.h:1.33 php-src/ext/spl/spl_directory.h:1.34 --- php-src/ext/spl/spl_directory.h:1.33Sun Mar 4 00:36:08 2007 +++ php-src/ext/spl/spl_directory.h Sun Mar 4 00:42:30 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.h,v 1.33 2007/03/04 00:36:08 helly