[PHP-CVS] cvs: phpruntests /src/testcase/sections/executablesections rtFileExternalSection.php /tests/testcase/sections/executablesections rtFileExternalSectionTest.php
g2 Mon May 18 22:38:27 2009 UTC Modified files: /phpruntests/tests/testcase/sections/executablesections rtFileExternalSectionTest.php /phpruntests/src/testcase/sections/executablesections rtFileExternalSection.php Log: phpruntests - update external-section testcase http://cvs.php.net/viewvc.cgi/phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php diff -u phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php:1.1 phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php:1.2 --- phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php:1.1 Fri May 15 23:11:20 2009 +++ phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php Mon May 18 22:38:27 2009 @@ -7,7 +7,7 @@ { public function testCreateInstance() { -$fileSection = new rtFileExternalSection('FILE_EXTERNAL', array('')); +$fileSection = rtFileExternalSection::getInstance('FILE_EXTERNAL', array('')); $code = $fileSection->getContents(); $this->assertEquals('assertFalse($wrapper->copyExternalFileContentTest()); - -$status = $wrapper->getStatus(); +$fileSection = rtFileExternalSection::getInstance('FILE_EXTERNAL', array('file1','file2')); + $content = $fileSection->getContents(); + $config = rtRuntestsConfiguration::getInstance(array()); + $test = new rtPhpTest($content, 'TEST', array('FILE_EXTERNAL'), $config); + + $status = $fileSection->run($test, $config); $this->assertEquals('One file per testcase permitted.', $status['fail']); } public function testNotExistingFile() { -$wrapper = new rtFileExternalSectionTestWrapper('FILE_EXTERNAL', array('file1')); - -$this->assertFalse($wrapper->copyExternalFileContentTest()); - -$status = $wrapper->getStatus(); +$fileSection = rtFileExternalSection::getInstance('FILE_EXTERNAL', array('file1')); +$content = $fileSection->getContents(); +$config = rtRuntestsConfiguration::getInstance(array()); +$test = new rtPhpTest($content, 'TEST', array('FILE_EXTERNAL'), $config); $this->assertEquals('Can not open external file /file1', $status['fail']); } } -/** - * test-wrapper to acces protected methods and members - */ -class rtFileExternalSectionTestWrapper extends rtFileExternalSection -{ -public function copyExternalFileContentTest() -{ - return parent::copyExternalFileContent(); -} - -public function getStatus() -{ -return $this->status; -} -} - ?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php?r1=1.5&r2=1.6&diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.5 phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.6 --- phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.5 Sun May 17 11:47:27 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php Mon May 18 22:38:27 2009 @@ -14,43 +14,41 @@ */ class rtFileExternalSection extends rtFileSection { - + /** +* @param rtPhpTest$testCase +* @param rtRuntestsConfiguration $runConfiguration +* @return Array$status +*/ public function run(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) { if ($this->copyExternalFileContent() === true) { - return parent::run($testCase, $runConfiguration); } - return $this->status; } - +/** + * @return boolean + */ private function copyExternalFileContent() { - if (sizeof($this->sectionContents) == 1) { + if (sizeof($this->sectionContents) != 1) { +$this->status['fail'] = 'One file per testcase permitted.'; + return false; + } - $file = $this->sectionContents[0]; - - // don't allow tests to retrieve files from anywhere but this subdirectory - $file = dirname($this->fileName).'/'.trim(str_replace('..', '', $file)); +$file = $this->sectionContents[0]; - if (file_exists($file)) { + // don't allow tests to retrieve files from anywhere but this subdirectory +$file = dirnam
[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS configure.in /main php_ini.c /scripts phpize.m4
derick Mon May 18 21:33:38 2009 UTC Modified files: (Branch: PHP_5_3) /php-srcconfigure.in NEWS /php-src/scriptsphpize.m4 /php-src/main php_ini.c Log: - MFH: Get rid of the four different versions of zend_extension* and only use zend_extension. Because of the API identifier change in PHP 5.3 you also get a proper warning message now. #- [DOC] http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.579.2.52.2.77.2.51&r2=1.579.2.52.2.77.2.52&diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.579.2.52.2.77.2.51 php-src/configure.in:1.579.2.52.2.77.2.52 --- php-src/configure.in:1.579.2.52.2.77.2.51 Wed May 6 18:57:45 2009 +++ php-src/configure.inMon May 18 21:33:38 2009 @@ -1,4 +1,4 @@ -## $Id: configure.in,v 1.579.2.52.2.77.2.51 2009/05/06 18:57:45 johannes Exp $ -*- autoconf -*- +## $Id: configure.in,v 1.579.2.52.2.77.2.52 2009/05/18 21:33:38 derick Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -1332,15 +1332,7 @@ CPPFLAGS="$CPPFLAGS -DTHREAD=1" fi -if test "$PHP_DEBUG" = "1" && test "$PHP_THREAD_SAFETY" = "yes"; then - ZEND_EXT_TYPE="zend_extension_debug_ts" -elif test "$PHP_DEBUG" = "1"; then - ZEND_EXT_TYPE="zend_extension_debug" -elif test "$PHP_THREAD_SAFETY" = "yes"; then - ZEND_EXT_TYPE="zend_extension_ts" -else - ZEND_EXT_TYPE="zend_extension" -fi +ZEND_EXT_TYPE="zend_extension" PHP_SUBST(ZEND_EXT_TYPE) dnl http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.605&r2=1.2027.2.547.2.965.2.606&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.605 php-src/NEWS:1.2027.2.547.2.965.2.606 --- php-src/NEWS:1.2027.2.547.2.965.2.605 Sat May 16 20:34:48 2009 +++ php-src/NEWSMon May 18 21:33:38 2009 @@ -5,6 +5,7 @@ - Upgraded bundled libmagic to 5.03 in the fileinfo extension. (Scott) - Added the ability for json_decode() to take a user specified depth. (Scott) +- Coalesce all the zend_extension_* variables into zend_extension. (Derick) - Disabled SQLite3::loadExtension for threaded SAPIs. (Scott) http://cvs.php.net/viewvc.cgi/php-src/scripts/phpize.m4?r1=1.17.2.3.2.5.2.6&r2=1.17.2.3.2.5.2.7&diff_format=u Index: php-src/scripts/phpize.m4 diff -u php-src/scripts/phpize.m4:1.17.2.3.2.5.2.6 php-src/scripts/phpize.m4:1.17.2.3.2.5.2.7 --- php-src/scripts/phpize.m4:1.17.2.3.2.5.2.6 Wed Dec 3 19:52:59 2008 +++ php-src/scripts/phpize.m4 Mon May 18 21:33:38 2009 @@ -96,15 +96,7 @@ AC_MSG_RESULT([$PHP_DEBUG]) dnl Support for building and testing Zend extensions -if test "$PHP_DEBUG" = "yes" && test "$PHP_THREAD_SAFETY" = "yes; then - ZEND_EXT_TYPE="zend_extension_debug_ts" -elif test "$PHP_DEBUG" = "yes"; then - ZEND_EXT_TYPE="zend_extension_debug" -elif test "$PHP_THREAD_SAFETY" = "yes; then - ZEND_EXT_TYPE="zend_extension_ts" -else - ZEND_EXT_TYPE="zend_extension" -fi +ZEND_EXT_TYPE="zend_extension" PHP_SUBST(ZEND_EXT_TYPE) dnl Discard optimization flags when debugging is enabled http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.136.2.4.2.15.2.13&r2=1.136.2.4.2.15.2.14&diff_format=u Index: php-src/main/php_ini.c diff -u php-src/main/php_ini.c:1.136.2.4.2.15.2.13 php-src/main/php_ini.c:1.136.2.4.2.15.2.14 --- php-src/main/php_ini.c:1.136.2.4.2.15.2.13 Wed Dec 31 11:15:47 2008 +++ php-src/main/php_ini.c Mon May 18 21:33:38 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ini.c,v 1.136.2.4.2.15.2.13 2008/12/31 11:15:47 sebastian Exp $ */ +/* $Id: php_ini.c,v 1.136.2.4.2.15.2.14 2009/05/18 21:33:38 derick Exp $ */ #include "php.h" #include "ext/standard/info.h" @@ -170,19 +170,7 @@ /* php.ini support */ #define PHP_EXTENSION_TOKEN"extension" -#ifdef ZTS -# if (ZEND_DEBUG) -# define ZEND_EXTENSION_TOKEN "zend_extension_debug_ts" -# else -# define ZEND_EXTENSION_TOKEN "zend_extension_ts" -# endif -#else -# if (ZEND_DEBUG) -# define ZEND_EXTENSION_TOKEN "zend_extension_debug" -# else -# define ZEND_EXTENSION_TOKEN "zend_extension" -# endif -#endif +#define ZEND_EXTENSION_TOKEN "zend_extension" /* {{{ config_zval_dtor */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / configure.in /main php_ini.c /scripts phpize.m4
derick Mon May 18 21:28:42 2009 UTC Modified files: /php-srcconfigure.in /php-src/scriptsphpize.m4 /php-src/main php_ini.c Log: - Get rid of the four different versions of zend_extension* and only use zend_extension. Because of the API identifier change in PHP 5.3 you also get a proper warning message now. http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.677&r2=1.678&diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.677 php-src/configure.in:1.678 --- php-src/configure.in:1.677 Wed May 6 14:04:58 2009 +++ php-src/configure.inMon May 18 21:28:42 2009 @@ -1,4 +1,4 @@ -## $Id: configure.in,v 1.677 2009/05/06 14:04:58 iliaa Exp $ -*- autoconf -*- +## $Id: configure.in,v 1.678 2009/05/18 21:28:42 derick Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -1246,15 +1246,7 @@ CPPFLAGS="$CPPFLAGS -DTHREAD=1" fi -if test "$PHP_DEBUG" = "1" && test "$PHP_THREAD_SAFETY" = "yes"; then - ZEND_EXT_TYPE="zend_extension_debug_ts" -elif test "$PHP_DEBUG" = "1"; then - ZEND_EXT_TYPE="zend_extension_debug" -elif test "$PHP_THREAD_SAFETY" = "yes"; then - ZEND_EXT_TYPE="zend_extension_ts" -else - ZEND_EXT_TYPE="zend_extension" -fi +ZEND_EXT_TYPE="zend_extension" PHP_SUBST(ZEND_EXT_TYPE) dnl http://cvs.php.net/viewvc.cgi/php-src/scripts/phpize.m4?r1=1.31&r2=1.32&diff_format=u Index: php-src/scripts/phpize.m4 diff -u php-src/scripts/phpize.m4:1.31 php-src/scripts/phpize.m4:1.32 --- php-src/scripts/phpize.m4:1.31 Thu Dec 4 00:41:55 2008 +++ php-src/scripts/phpize.m4 Mon May 18 21:28:42 2009 @@ -96,15 +96,7 @@ AC_MSG_RESULT([$PHP_DEBUG]) dnl Support for building and testing Zend extensions -if test "$PHP_DEBUG" = "yes" && test "$PHP_THREAD_SAFETY" = "yes; then - ZEND_EXT_TYPE="zend_extension_debug_ts" -elif test "$PHP_DEBUG" = "yes"; then - ZEND_EXT_TYPE="zend_extension_debug" -elif test "$PHP_THREAD_SAFETY" = "yes; then - ZEND_EXT_TYPE="zend_extension_ts" -else - ZEND_EXT_TYPE="zend_extension" -fi +ZEND_EXT_TYPE="zend_extension" PHP_SUBST(ZEND_EXT_TYPE) dnl Discard optimization flags when debugging is enabled http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.172&r2=1.173&diff_format=u Index: php-src/main/php_ini.c diff -u php-src/main/php_ini.c:1.172 php-src/main/php_ini.c:1.173 --- php-src/main/php_ini.c:1.172Tue Mar 10 23:39:53 2009 +++ php-src/main/php_ini.c Mon May 18 21:28:42 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ini.c,v 1.172 2009/03/10 23:39:53 helly Exp $ */ +/* $Id: php_ini.c,v 1.173 2009/05/18 21:28:42 derick Exp $ */ #include "php.h" #include "ext/standard/info.h" @@ -170,19 +170,7 @@ /* php.ini support */ #define PHP_EXTENSION_TOKEN"extension" -#ifdef ZTS -# if (ZEND_DEBUG) -# define ZEND_EXTENSION_TOKEN "zend_extension_debug_ts" -# else -# define ZEND_EXTENSION_TOKEN "zend_extension_ts" -# endif -#else -# if (ZEND_DEBUG) -# define ZEND_EXTENSION_TOKEN "zend_extension_debug" -# else -# define ZEND_EXTENSION_TOKEN "zend_extension" -# endif -#endif +#define ZEND_EXTENSION_TOKEN "zend_extension" /* {{{ config_zval_dtor */ -- 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 file.c
Work in progress, the code is very different there and the patch will be very different. Ilia Alshanetsky On 18-May-09, at 5:19 PM, Jani Taskinen wrote: What about HEAD? --Jani Ilia Alshanetsky kirjoitti: iliaa Mon May 18 18:45:30 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standardfile.c Log: Fixed bug #48313 (fgetcsv() does not return null for empty rows) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.28.2.32&r2=1.409.2.6.2.28.2.33&diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.409.2.6.2.28.2.32 php-src/ext/ standard/file.c:1.409.2.6.2.28.2.33 --- php-src/ext/standard/file.c:1.409.2.6.2.28.2.32 Fri May 8 09:44:17 2009 +++ php-src/ext/standard/file.c Mon May 18 18:45:30 2009 @@ -21,7 +21,7 @@ + --+ */ -/* $Id: file.c,v 1.409.2.6.2.28.2.32 2009/05/08 09:44:17 lbarnaud Exp $ */ +/* $Id: file.c,v 1.409.2.6.2.28.2.33 2009/05/18 18:45:30 iliaa Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -2343,8 +2343,12 @@ } /* 3. Now pass our field back to php */ - *comp_end = '\0'; - add_next_index_stringl(return_value, temp, comp_end - temp, 1); + if (comp_end - temp) { + *comp_end = '\0'; + add_next_index_stringl(return_value, temp, comp_end - temp, 1); + } else { + add_next_index_null(return_value); + } } while (inc_len > 0); out: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- 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 file.c
What about HEAD? --Jani Ilia Alshanetsky kirjoitti: iliaa Mon May 18 18:45:30 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard file.c Log: Fixed bug #48313 (fgetcsv() does not return null for empty rows) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.28.2.32&r2=1.409.2.6.2.28.2.33&diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.409.2.6.2.28.2.32 php-src/ext/standard/file.c:1.409.2.6.2.28.2.33 --- php-src/ext/standard/file.c:1.409.2.6.2.28.2.32 Fri May 8 09:44:17 2009 +++ php-src/ext/standard/file.c Mon May 18 18:45:30 2009 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.409.2.6.2.28.2.32 2009/05/08 09:44:17 lbarnaud Exp $ */ +/* $Id: file.c,v 1.409.2.6.2.28.2.33 2009/05/18 18:45:30 iliaa Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -2343,8 +2343,12 @@ } /* 3. Now pass our field back to php */ - *comp_end = '\0'; - add_next_index_stringl(return_value, temp, comp_end - temp, 1); + if (comp_end - temp) { + *comp_end = '\0'; + add_next_index_stringl(return_value, temp, comp_end - temp, 1); + } else { + add_next_index_null(return_value); + } } while (inc_len > 0); out: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/dba config.m4 dba.c dba_tcadb.c php_tcadb.h
scottmacMon May 18 20:21:39 2009 UTC Added files: /php-src/ext/dbadba_tcadb.c php_tcadb.h Modified files: /php-src/ext/dbaconfig.m4 dba.c Log: Add support for tokyo cabinet, patch from Michael Maclean http://cvs.php.net/viewvc.cgi/php-src/ext/dba/config.m4?r1=1.78&r2=1.79&diff_format=u Index: php-src/ext/dba/config.m4 diff -u php-src/ext/dba/config.m4:1.78 php-src/ext/dba/config.m4:1.79 --- php-src/ext/dba/config.m4:1.78 Thu Dec 6 14:02:21 2007 +++ php-src/ext/dba/config.m4 Mon May 18 20:21:39 2009 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.78 2007/12/06 14:02:21 helly Exp $ +dnl $Id: config.m4,v 1.79 2009/05/18 20:21:39 scottmac Exp $ dnl dnl Suppose we need FlatFile if no support or only CDB is used. @@ -97,6 +97,10 @@ PHP_ARG_WITH(dbm,, [ --with-dbm[=DIR] DBA: DBM support], no, no) +PHP_ARG_WITH(tcadb,, +[ --with-tcadb[=DIR]DBA: Tokyo Cabinet abstract DB support], no, no) + + dnl dnl Library checks dnl @@ -193,6 +197,37 @@ fi PHP_DBA_STD_RESULT(ndbm) +dnl TCADB +if test "$PHP_TCADB" != "no"; then + PHP_DBA_STD_BEGIN + for i in $PHP_TCADB /usr/local /usr; do + if test -f "$i/include/tcadb.h"; then + THIS_PREFIX=$i + PHP_ADD_INCLUDE($THIS_PREFIX/include) + THIS_INCLUDE=$i/include/tcadb.h + break + fi + done + + if test -n "$THIS_INCLUDE"; then + for LIB in tokyocabinet; do + PHP_CHECK_LIBRARY($LIB, tcadbopen, [ + AC_DEFINE_UNQUOTED(TCADB_INCLUDE_FILE, "$THIS_INCLUDE", [ ]) + AC_DEFINE(DBA_TCADB, 1, [ ]) + THIS_LIBS=$LIB + ], [], [-L$THIS_PREFIX/$PHP_LIBDIR]) + if test -n "$THIS_LIBS"; then + break + fi + done + fi + + PHP_DBA_STD_ASSIGN + PHP_DBA_STD_CHECK + PHP_DBA_STD_ATTACH +fi +PHP_DBA_STD_RESULT(tcadb) + dnl Berkeley specific (library and version test) dnl parameters(version, library list, function) AC_DEFUN([PHP_DBA_DB_CHECK],[ @@ -569,7 +604,7 @@ AC_MSG_RESULT([yes]) fi AC_DEFINE(HAVE_DBA, 1, [ ]) - PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources $ini_sources, $ext_shared) + PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c dba_tcadb.c $cdb_sources $flat_sources $ini_sources, $ext_shared) PHP_ADD_BUILD_DIR($ext_builddir/libinifile) PHP_ADD_BUILD_DIR($ext_builddir/libcdb) PHP_ADD_BUILD_DIR($ext_builddir/libflatfile) http://cvs.php.net/viewvc.cgi/php-src/ext/dba/dba.c?r1=1.133&r2=1.134&diff_format=u Index: php-src/ext/dba/dba.c diff -u php-src/ext/dba/dba.c:1.133 php-src/ext/dba/dba.c:1.134 --- php-src/ext/dba/dba.c:1.133 Tue Mar 10 23:39:12 2009 +++ php-src/ext/dba/dba.c Mon May 18 20:21:39 2009 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: dba.c,v 1.133 2009/03/10 23:39:12 helly Exp $ */ +/* $Id: dba.c,v 1.134 2009/05/18 20:21:39 scottmac Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -50,6 +50,7 @@ #include "php_flatfile.h" #include "php_inifile.h" #include "php_qdbm.h" +#include "php_tcadb.h" /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2) @@ -337,6 +338,9 @@ #if DBA_QDBM DBA_HND(qdbm, DBA_LOCK_EXT) #endif +#if DBA_TCADB + DBA_HND(tcadb, DBA_LOCK_ALL) +#endif { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; @@ -358,6 +362,8 @@ #define DBA_DEFAULT "dbm" #elif DBA_QDBM #define DBA_DEFAULT "qdbm" +#elif DBA_TCADB +#define DBA_DEFAULT "tcadb" #else #define DBA_DEFAULT "" #endif http://cvs.php.net/viewvc.cgi/php-src/ext/dba/dba_tcadb.c?view=markup&rev=1.1 Index: php-src/ext/dba/dba_tcadb.c +++ php-src/ext/dba/dba_tcadb.c /* +--+ | PHP Version 5| +--+ | Copyright (c) 1997-2009 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 | | lice...@php.net so we can mail you a copy immediately. | +--+ | Author: Mic
[PHP-CVS] cvs: phpruntests /src/testcase/sections/configurationsections rtEnvSection.php /tests/testcase/sections/configurationsections rtEnvSectionTest.php
zoe Mon May 18 20:06:11 2009 UTC Modified files: /phpruntests/tests/testcase/sections/configurationsections rtEnvSectionTest.php /phpruntests/src/testcase/sections/configurationsections rtEnvSection.php Log: fixed problem with additional = signs in ENV settings http://cvs.php.net/viewvc.cgi/phpruntests/tests/testcase/sections/configurationsections/rtEnvSectionTest.php?r1=1.3&r2=1.4&diff_format=u Index: phpruntests/tests/testcase/sections/configurationsections/rtEnvSectionTest.php diff -u phpruntests/tests/testcase/sections/configurationsections/rtEnvSectionTest.php:1.3 phpruntests/tests/testcase/sections/configurationsections/rtEnvSectionTest.php:1.4 --- phpruntests/tests/testcase/sections/configurationsections/rtEnvSectionTest.php:1.3 Sun May 17 12:54:29 2009 +++ phpruntests/tests/testcase/sections/configurationsections/rtEnvSectionTest.php Mon May 18 20:06:10 2009 @@ -5,13 +5,22 @@ class rtEnvSectionTest extends PHPUnit_Framework_TestCase { -public function testCreateInstance() +public function testCreateInstance() { -$envSection = rtEnvSection::getInstance('ENV', array('env1 = ENV1', 'env2=ENV2')); +$envSection = rtEnvSection::getInstance('ENV', array('env1 = ENV1', 'env2=ENV2')); $envlist = $envSection->getTestEnvironmentVariables(); $this->assertEquals('ENV1', $envlist['env1']); $this->assertEquals('ENV2', $envlist['env2']); } + +public function testCreateInstance2() +{ +$envSection = rtEnvSection::getInstance('ENV', array('env1 = ENV1=env')); +$envlist = $envSection->getTestEnvironmentVariables(); + +$this->assertEquals('ENV1=env', $envlist['env1']); + +} } ?> http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/configurationsections/rtEnvSection.php?r1=1.2&r2=1.3&diff_format=u Index: phpruntests/src/testcase/sections/configurationsections/rtEnvSection.php diff -u phpruntests/src/testcase/sections/configurationsections/rtEnvSection.php:1.2 phpruntests/src/testcase/sections/configurationsections/rtEnvSection.php:1.3 --- phpruntests/src/testcase/sections/configurationsections/rtEnvSection.php:1.2 Fri Apr 24 08:41:26 2009 +++ phpruntests/src/testcase/sections/configurationsections/rtEnvSection.php Mon May 18 20:06:11 2009 @@ -9,8 +9,11 @@ protected function init() { foreach ($this->sectionContents as $line) { -$tempArray = explode('=', $line); -$this->testEnvironmentVariables[trim($tempArray[0])] = trim($tempArray[1]); +$firstEqualsPosition = strpos($line, "="); +$variableName = substr($line, 0, -(strlen($line) - $firstEqualsPosition)); +$variableValue = substr($line, -(strlen($line) - $firstEqualsPosition - 1)); + +$this->testEnvironmentVariables[trim($variableName)] = trim($variableValue); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src/testcase/sections rtExecutableSection.php
zoe Mon May 18 19:27:33 2009 UTC Modified files: /phpruntests/src/testcase/sections rtExecutableSection.php Log: typo http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/rtExecutableSection.php?r1=1.5&r2=1.6&diff_format=u Index: phpruntests/src/testcase/sections/rtExecutableSection.php diff -u phpruntests/src/testcase/sections/rtExecutableSection.php:1.5 phpruntests/src/testcase/sections/rtExecutableSection.php:1.6 --- phpruntests/src/testcase/sections/rtExecutableSection.php:1.5 Sun May 17 20:02:46 2009 +++ phpruntests/src/testcase/sections/rtExecutableSection.php Mon May 18 19:27:33 2009 @@ -14,7 +14,7 @@ protected function writeExecutableFile() { -// @todo I think \n could be replaced with PHP_EOL here - need to check on Windows.s +// @todo I think \n could be replaced with PHP_EOL here - need to check on Windows. $contentsAsString = implode("\n", $this->sectionContents) . PHP_EOL; file_put_contents($this->fileName, (binary) $contentsAsString); } -- 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/standard file.c
iliaa Mon May 18 18:46:07 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard file.c /php-srcNEWS Log: MFB: Fixed bug #48313 (fgetcsv() does not return null for empty rows) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.41&r2=1.409.2.6.2.42&diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.409.2.6.2.41 php-src/ext/standard/file.c:1.409.2.6.2.42 --- php-src/ext/standard/file.c:1.409.2.6.2.41 Fri May 8 09:49:27 2009 +++ php-src/ext/standard/file.c Mon May 18 18:46:06 2009 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.409.2.6.2.41 2009/05/08 09:49:27 lbarnaud Exp $ */ +/* $Id: file.c,v 1.409.2.6.2.42 2009/05/18 18:46:06 iliaa Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -2384,8 +2384,12 @@ } /* 3. Now pass our field back to php */ - *comp_end = '\0'; - add_next_index_stringl(return_value, temp, comp_end - temp, 1); + if (comp_end - temp) { + *comp_end = '\0'; + add_next_index_stringl(return_value, temp, comp_end - temp, 1); + } else { + add_next_index_null(return_value); + } } while (inc_len > 0); out: http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1513&r2=1.2027.2.547.2.1514&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1513 php-src/NEWS:1.2027.2.547.2.1514 --- php-src/NEWS:1.2027.2.547.2.1513Sun May 17 14:59:24 2009 +++ php-src/NEWSMon May 18 18:46:06 2009 @@ -16,6 +16,7 @@ - Fixed segfault on invalid session.save_path. (Hannes) - Fixed leaks in imap when a mail_criteria is used. (Pierre) +- Fixed bug #48313 (fgetcsv() does not return null for empty rows). (Ilia) - Fixed bug #48309 (stream_copy_to_stream() and fpasstru() do not update stream position of plain files). (Arnaud) - Fixed bug #48307 (stream_copy_to_stream() copies 0 bytes when $source is a -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard file.c
iliaa Mon May 18 18:45:30 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard file.c Log: Fixed bug #48313 (fgetcsv() does not return null for empty rows) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.28.2.32&r2=1.409.2.6.2.28.2.33&diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.409.2.6.2.28.2.32 php-src/ext/standard/file.c:1.409.2.6.2.28.2.33 --- php-src/ext/standard/file.c:1.409.2.6.2.28.2.32 Fri May 8 09:44:17 2009 +++ php-src/ext/standard/file.c Mon May 18 18:45:30 2009 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.409.2.6.2.28.2.32 2009/05/08 09:44:17 lbarnaud Exp $ */ +/* $Id: file.c,v 1.409.2.6.2.28.2.33 2009/05/18 18:45:30 iliaa Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -2343,8 +2343,12 @@ } /* 3. Now pass our field back to php */ - *comp_end = '\0'; - add_next_index_stringl(return_value, temp, comp_end - temp, 1); + if (comp_end - temp) { + *comp_end = '\0'; + add_next_index_stringl(return_value, temp, comp_end - temp, 1); + } else { + add_next_index_null(return_value); + } } while (inc_len > 0); out: -- 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/session mod_files.c mod_mm.c mod_user.c php_session.h session.c
janiMon May 18 17:23:42 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/sessionmod_files.c mod_mm.c mod_user.c php_session.h session.c Log: MFH: Sync WS / CS changes where applicable http://cvs.php.net/viewvc.cgi/php-src/ext/session/mod_files.c?r1=1.100.2.3.2.13&r2=1.100.2.3.2.14&diff_format=u Index: php-src/ext/session/mod_files.c diff -u php-src/ext/session/mod_files.c:1.100.2.3.2.13 php-src/ext/session/mod_files.c:1.100.2.3.2.14 --- php-src/ext/session/mod_files.c:1.100.2.3.2.13 Mon Apr 6 11:49:33 2009 +++ php-src/ext/session/mod_files.c Mon May 18 17:23:42 2009 @@ -1,4 +1,4 @@ -/* +/* +--+ | PHP Version 5| +--+ @@ -16,7 +16,7 @@ +--+ */ -/* $Id: mod_files.c,v 1.100.2.3.2.13 2009/04/06 11:49:33 bjori Exp $ */ +/* $Id: mod_files.c,v 1.100.2.3.2.14 2009/05/18 17:23:42 jani Exp $ */ #include "php.h" @@ -86,7 +86,7 @@ } len = p - key; - + if (len == 0) { ret = 0; } @@ -100,7 +100,7 @@ const char *p; int i; int n; - + key_len = strlen(key); if (key_len <= data->dirdepth || buflen < (strlen(data->basedir) + 2 * data->dirdepth + key_len + 5 + sizeof(FILE_PREFIX))) { @@ -120,18 +120,18 @@ memcpy(buf + n, key, key_len); n += key_len; buf[n] = '\0'; - + return buf; } #ifndef O_BINARY -#define O_BINARY 0 -#endif +# define O_BINARY 0 +#endif static void ps_files_close(ps_files *data) { if (data->fd != -1) { -#ifdef PHP_WIN32 +#ifdef PHP_WIN32 /* On Win32 locked files that are closed without being explicitly unlocked will be unlocked only when "system resources become available". */ flock(data->fd, LOCK_UN); @@ -177,13 +177,12 @@ return; } if ( - S_ISLNK(sbuf.st_mode) && + S_ISLNK(sbuf.st_mode) && ( php_check_open_basedir(buf TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(buf, NULL, CHECKUID_CHECK_FILE_AND_DIR)) ) ) { - close(data->fd); return; } @@ -200,8 +199,7 @@ } #endif } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, - strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno); } } } @@ -230,7 +228,7 @@ /* Prepare buffer (dirname never changes) */ memcpy(buf, dirname, dirname_len); buf[dirname_len] = PHP_DIR_SEPARATOR; - + while (php_readdir_r(dir, (struct dirent *) dentry, &entry) == 0 && entry) { /* does the file start with our prefix? */ if (!strncmp(entry->d_name, FILE_PREFIX, sizeof(FILE_PREFIX) - 1)) { @@ -245,7 +243,7 @@ buf[dirname_len + entry_len + 1] = '\0'; /* check whether its last access was more than maxlifet ago */ - if (VCWD_STAT(buf, &sbuf) == 0 && + if (VCWD_STAT(buf, &sbuf) == 0 && #ifdef NETWARE (now - sbuf.st_mtime.tv_sec) > maxlifetime) { #else @@ -278,16 +276,14 @@ /* if save path is an empty string, determine the temporary dir */ save_path = php_get_temporary_directory(); - if (strcmp(save_path, "/tmp")) { - if (PG(safe_mode) && (!php_checkuid(save_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { - return FAILURE; - } - if (php_check_open_basedir(save_path TSRMLS_CC)) { - return FAILURE; - } + if (PG(safe_mode) && (!php_checkuid(save_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { + return FAILURE; + } + if (php_check_open_basedir(save_path TSRMLS_CC)) { + return FAILURE; } } -
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/session mod_files.c mod_mm.c mod_user.c php_session.h session.c
janiMon May 18 16:10:09 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sessionmod_files.c mod_mm.c mod_user.c php_session.h session.c Log: MFH: ws + sync http://cvs.php.net/viewvc.cgi/php-src/ext/session/mod_files.c?r1=1.100.2.3.2.10.2.4&r2=1.100.2.3.2.10.2.5&diff_format=u Index: php-src/ext/session/mod_files.c diff -u php-src/ext/session/mod_files.c:1.100.2.3.2.10.2.4 php-src/ext/session/mod_files.c:1.100.2.3.2.10.2.5 --- php-src/ext/session/mod_files.c:1.100.2.3.2.10.2.4 Mon Apr 6 11:48:49 2009 +++ php-src/ext/session/mod_files.c Mon May 18 16:10:09 2009 @@ -1,4 +1,4 @@ -/* +/* +--+ | PHP Version 5| +--+ @@ -16,7 +16,7 @@ +--+ */ -/* $Id: mod_files.c,v 1.100.2.3.2.10.2.4 2009/04/06 11:48:49 bjori Exp $ */ +/* $Id: mod_files.c,v 1.100.2.3.2.10.2.5 2009/05/18 16:10:09 jani Exp $ */ #include "php.h" @@ -86,7 +86,7 @@ } len = p - key; - + if (len == 0) { ret = 0; } @@ -100,7 +100,7 @@ const char *p; int i; int n; - + key_len = strlen(key); if (key_len <= data->dirdepth || buflen < (strlen(data->basedir) + 2 * data->dirdepth + key_len + 5 + sizeof(FILE_PREFIX))) { @@ -120,18 +120,18 @@ memcpy(buf + n, key, key_len); n += key_len; buf[n] = '\0'; - + return buf; } #ifndef O_BINARY -#define O_BINARY 0 -#endif +# define O_BINARY 0 +#endif static void ps_files_close(ps_files *data) { if (data->fd != -1) { -#ifdef PHP_WIN32 +#ifdef PHP_WIN32 /* On Win32 locked files that are closed without being explicitly unlocked will be unlocked only when "system resources become available". */ flock(data->fd, LOCK_UN); @@ -177,13 +177,12 @@ return; } if ( - S_ISLNK(sbuf.st_mode) && + S_ISLNK(sbuf.st_mode) && ( php_check_open_basedir(buf TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(buf, NULL, CHECKUID_CHECK_FILE_AND_DIR)) ) ) { - close(data->fd); return; } @@ -200,8 +199,7 @@ } #endif } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, - strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno); } } } @@ -230,7 +228,7 @@ /* Prepare buffer (dirname never changes) */ memcpy(buf, dirname, dirname_len); buf[dirname_len] = PHP_DIR_SEPARATOR; - + while (php_readdir_r(dir, (struct dirent *) dentry, &entry) == 0 && entry) { /* does the file start with our prefix? */ if (!strncmp(entry->d_name, FILE_PREFIX, sizeof(FILE_PREFIX) - 1)) { @@ -245,7 +243,7 @@ buf[dirname_len + entry_len + 1] = '\0'; /* check whether its last access was more than maxlifet ago */ - if (VCWD_STAT(buf, &sbuf) == 0 && + if (VCWD_STAT(buf, &sbuf) == 0 && #ifdef NETWARE (now - sbuf.st_mtime.tv_sec) > maxlifetime) { #else @@ -285,7 +283,7 @@ return FAILURE; } } - + /* split up input parameter */ last = save_path; p = strchr(save_path, ';'); @@ -305,7 +303,7 @@ return FAILURE; } } - + if (argc > 2) { errno = 0; filemode = strtol(argv[1], NULL, 8); @@ -316,17 +314,16 @@ } save_path = argv[argc - 1]; - data = emalloc(sizeof(*data)); - memset(data, 0, sizeof(*data)); - + data = ecalloc(1, sizeof(*data)); + data->fd = -1; data->dirdepth = dirdepth; data->filemode = filemode; data->basedir_len = strlen(save_path); data->basedir = estrndup(save_path, data->basedir_len); - + PS_SET_MOD_DATA(data);
[PHP-CVS] cvs: php-src /ext/session mod_files.c mod_mm.c mod_user.c php_session.h session.c
janiMon May 18 16:09:51 2009 UTC Modified files: /php-src/ext/sessionmod_files.c mod_mm.c mod_user.c php_session.h session.c Log: - WS + sync with PHP_5_3 (thanks Ilia & Co.) http://cvs.php.net/viewvc.cgi/php-src/ext/session/mod_files.c?r1=1.123&r2=1.124&diff_format=u Index: php-src/ext/session/mod_files.c diff -u php-src/ext/session/mod_files.c:1.123 php-src/ext/session/mod_files.c:1.124 --- php-src/ext/session/mod_files.c:1.123 Mon Apr 6 11:48:26 2009 +++ php-src/ext/session/mod_files.c Mon May 18 16:09:51 2009 @@ -1,4 +1,4 @@ -/* +/* +--+ | PHP Version 6| +--+ @@ -16,7 +16,7 @@ +--+ */ -/* $Id: mod_files.c,v 1.123 2009/04/06 11:48:26 bjori Exp $ */ +/* $Id: mod_files.c,v 1.124 2009/05/18 16:09:51 jani Exp $ */ #include "php.h" @@ -86,7 +86,7 @@ } len = p - key; - + if (len == 0) { ret = 0; } @@ -100,7 +100,7 @@ const char *p; int i; int n; - + key_len = strlen(key); if (key_len <= data->dirdepth || buflen < (strlen(data->basedir) + 2 * data->dirdepth + key_len + 5 + sizeof(FILE_PREFIX))) { @@ -142,18 +142,18 @@ efree(newbuf); } } - + return buf; } #ifndef O_BINARY -#define O_BINARY 0 -#endif +# define O_BINARY 0 +#endif static void ps_files_close(ps_files *data) { if (data->fd != -1) { -#ifdef PHP_WIN32 +#ifdef PHP_WIN32 /* On Win32 locked files that are closed without being explicitly unlocked will be unlocked only when "system resources become available". */ flock(data->fd, LOCK_UN); @@ -199,8 +199,8 @@ return; } if ( - S_ISLNK(sbuf.st_mode) && -php_check_open_basedir(buf TSRMLS_CC) + S_ISLNK(sbuf.st_mode) && + php_check_open_basedir(buf TSRMLS_CC) ) { close(data->fd); return; @@ -218,8 +218,7 @@ } #endif } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, - strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno); } } } @@ -248,7 +247,7 @@ /* Prepare buffer (dirname never changes) */ memcpy(buf, dirname, dirname_len); buf[dirname_len] = PHP_DIR_SEPARATOR; - + while (php_readdir_r(dir, (struct dirent *) dentry, &entry) == 0 && entry) { /* does the file start with our prefix? */ if (!strncmp(entry->d_name, FILE_PREFIX, sizeof(FILE_PREFIX) - 1)) { @@ -263,7 +262,7 @@ buf[dirname_len + entry_len + 1] = '\0'; /* check whether its last access was more than maxlifet ago */ - if (VCWD_STAT(buf, &sbuf) == 0 && + if (VCWD_STAT(buf, &sbuf) == 0 && #ifdef NETWARE (now - sbuf.st_mtime.tv_sec) > maxlifetime) { #else @@ -300,7 +299,7 @@ return FAILURE; } } - + /* split up input parameter */ last = save_path; p = strchr(save_path, ';'); @@ -320,7 +319,7 @@ return FAILURE; } } - + if (argc > 2) { errno = 0; filemode = strtol(argv[1], NULL, 8); @@ -332,15 +331,15 @@ save_path = argv[argc - 1]; data = ecalloc(1, sizeof(*data)); - + data->fd = -1; data->dirdepth = dirdepth; data->filemode = filemode; data->basedir_len = strlen(save_path); data->basedir = estrndup(save_path, data->basedir_len); - + PS_SET_MOD_DATA(data); - + return SUCCESS; } @@ -401,7 +400,7 @@ efree(*val); return FAILURE; } - + return SUCCESS; } @@ -415,11 +414,8 @@ return FAILURE; } - /* -* truncate file, if the amount of new data is smaller than -* the existing data set. -
[PHP-CVS] cvs: php-src(PHP_5_2) / run-tests.php
bjori Mon May 18 14:08:56 2009 UTC Modified files: (Branch: PHP_5_2) /php-srcrun-tests.php Log: MFH: Print out WARNed http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.63&r2=1.226.2.37.2.64&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.63 php-src/run-tests.php:1.226.2.37.2.64 --- php-src/run-tests.php:1.226.2.37.2.63 Sat Apr 25 17:12:11 2009 +++ php-src/run-tests.php Mon May 18 14:08:56 2009 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.63 2009/04/25 17:12:11 jani Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.64 2009/05/18 14:08:56 bjori 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 @@ -633,7 +633,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.63 $' . "\n"; + echo '$Revision: 1.226.2.37.2.64 $' . "\n"; exit(1); default: @@ -2254,6 +2254,19 @@ $failed_test_summary .= "=\n"; } + if (count($PHP_FAILED_TESTS['WARNED'])) { + $failed_test_summary .= ' += +WARNED TEST SUMMARY +- +'; + foreach ($PHP_FAILED_TESTS['WARNED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; + } + + $failed_test_summary .= "=\n"; + } + if (count($PHP_FAILED_TESTS['LEAKED'])) { $failed_test_summary .= ' = -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) / run-tests.php
bjori Mon May 18 14:08:23 2009 UTC Modified files: (Branch: PHP_5_3) /php-srcrun-tests.php Log: MFH: Print out the WARNed section http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.65&r2=1.226.2.37.2.35.2.66&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.35.2.65 php-src/run-tests.php:1.226.2.37.2.35.2.66 --- php-src/run-tests.php:1.226.2.37.2.35.2.65 Sat Apr 25 17:12:40 2009 +++ php-src/run-tests.php Mon May 18 14:08:23 2009 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.35.2.65 2009/04/25 17:12:40 jani Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.35.2.66 2009/05/18 14:08:23 bjori 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 @@ -633,7 +633,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.35.2.65 $' . "\n"; + echo '$Revision: 1.226.2.37.2.35.2.66 $' . "\n"; exit(1); default: @@ -2254,6 +2254,19 @@ $failed_test_summary .= "=\n"; } + if (count($PHP_FAILED_TESTS['WARNED'])) { + $failed_test_summary .= ' += +WARNED TEST SUMMARY +- +'; + foreach ($PHP_FAILED_TESTS['WARNED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; + } + + $failed_test_summary .= "=\n"; + } + if (count($PHP_FAILED_TESTS['LEAKED'])) { $failed_test_summary .= ' = -- 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
bjori Mon May 18 14:07:59 2009 UTC Modified files: /php-srcrun-tests.php Log: Print out the WARNed section (contains f.e. passing XFAIL tests) http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.396&r2=1.397&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.396 php-src/run-tests.php:1.397 --- php-src/run-tests.php:1.396 Sat Apr 25 17:12:56 2009 +++ php-src/run-tests.php Mon May 18 14:07:59 2009 @@ -24,7 +24,7 @@ +--+ */ -/* $Id: run-tests.php,v 1.396 2009/04/25 17:12:56 jani Exp $ */ +/* $Id: run-tests.php,v 1.397 2009/05/18 14:07:59 bjori 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 @@ -633,7 +633,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.396 $' . "\n"; + echo '$Revision: 1.397 $' . "\n"; exit(1); default: @@ -2254,6 +2254,19 @@ $failed_test_summary .= "=\n"; } + if (count($PHP_FAILED_TESTS['WARNED'])) { + $failed_test_summary .= ' += +WARNED TEST SUMMARY +- +'; + foreach ($PHP_FAILED_TESTS['WARNED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; + } + + $failed_test_summary .= "=\n"; + } + if (count($PHP_FAILED_TESTS['LEAKED'])) { $failed_test_summary .= ' = -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sqlite3/tests sqlite3_31_open.phpt
bjori Mon May 18 13:52:16 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/sqlite3/tests sqlite3_31_open.phpt Log: Fix test http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_31_open.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_31_open.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_31_open.phpt:1.1.2.2 php-src/ext/sqlite3/tests/sqlite3_31_open.phpt:1.1.2.3 --- php-src/ext/sqlite3/tests/sqlite3_31_open.phpt:1.1.2.2 Sun May 17 16:51:59 2009 +++ php-src/ext/sqlite3/tests/sqlite3_31_open.phpt Mon May 18 13:52:16 2009 @@ -9,12 +9,14 @@ open('db1.db'); + $db = new SQLite3(__DIR__ . '/db1.db'); + $db->open(__DIR__ . '/db1.db'); } catch (Exception $ex) { var_dump($ex->getMessage()); } ?> +--CLEAN-- + --EXPECTF-- %string|unicode%(29) "Already initialised DB Object" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sqlite3/tests sqlite3_31_open.phpt
bjori Mon May 18 13:52:05 2009 UTC Modified files: /php-src/ext/sqlite3/tests sqlite3_31_open.phpt Log: Fix test http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_31_open.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_31_open.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_31_open.phpt:1.1 php-src/ext/sqlite3/tests/sqlite3_31_open.phpt:1.2 --- php-src/ext/sqlite3/tests/sqlite3_31_open.phpt:1.1 Sun May 17 16:51:22 2009 +++ php-src/ext/sqlite3/tests/sqlite3_31_open.phpt Mon May 18 13:52:05 2009 @@ -9,12 +9,14 @@ open('db1.db'); + $db = new SQLite3(__DIR__ . '/db1.db'); + $db->open(__DIR__ . '/db1.db'); } catch (Exception $ex) { var_dump($ex->getMessage()); } ?> +--CLEAN-- + --EXPECTF-- %string|unicode%(29) "Already initialised DB Object" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/curl interface.c
janiMon May 18 12:51:05 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/curl interface.c Log: MFH http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.27.2.45&r2=1.62.2.14.2.27.2.46&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.27.2.45 php-src/ext/curl/interface.c:1.62.2.14.2.27.2.46 --- php-src/ext/curl/interface.c:1.62.2.14.2.27.2.45Mon May 18 12:01:44 2009 +++ php-src/ext/curl/interface.cMon May 18 12:51:05 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.27.2.45 2009/05/18 12:01:44 pajoye Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.27.2.46 2009/05/18 12:51:05 jani Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -158,13 +158,14 @@ #define CAAZ(s, v) add_assoc_zval_ex(return_value, s, sizeof(s), (zval *) v); #if defined(PHP_WIN32) || defined(__GNUC__) - #define php_curl_ret(__ret) RETVAL_FALSE; return __ret; +# define php_curl_ret(__ret) RETVAL_FALSE; return __ret; #else - #define php_curl_ret(__ret) RETVAL_FALSE; return; +# define php_curl_ret(__ret) RETVAL_FALSE; return; #endif -static int php_curl_option_url(php_curl *ch, const char *url, const int len) { - CURLcode error=CURLE_OK; +static int php_curl_option_url(php_curl *ch, const char *url, const int len) /* {{{ */ +{ + CURLcode error = CURLE_OK; #if LIBCURL_VERSION_NUM < 0x071100 char *copystr = NULL; #endif @@ -201,6 +202,7 @@ return (error == CURLE_OK ? 1 : 0); } +/* }}} */ /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_version, 0, 0, 0) @@ -282,7 +284,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_close, 0) ZEND_ARG_INFO(0, mh) ZEND_END_ARG_INFO() - /* }}} */ /* {{{ curl_functions[] @@ -347,7 +348,7 @@ php_info_print_table_row(2, "Age", str); /* To update on each new cURL release using src/main.c in cURL sources */ - if(d->features) { + if (d->features) { struct feat { const char *name; int bitmask; @@ -457,7 +458,6 @@ le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number); le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, "curl", module_number); - /* See http://curl.haxx.se/lxr/source/docs/libcurl/symbols-in-versions or curl src/docs/libcurl/symbols-in-versions for a (almost) complete list of options and which version they were introduced */ @@ -938,11 +938,7 @@ /* {{{ curl_progress */ -static size_t curl_progress(void *clientp, -double dltotal, -double dlnow, -double ultotal, -double ulnow) +static size_t curl_progress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { php_curl *ch = (php_curl *) clientp; php_curl_progress *t = ch->handlers->progress; @@ -1001,8 +997,9 @@ if (Z_TYPE_P(retval_ptr) != IS_LONG) { convert_to_long_ex(&retval_ptr); } - if(0 != Z_LVAL_P(retval_ptr)) + if (0 != Z_LVAL_P(retval_ptr)) { rval = 1; + } zval_ptr_dtor(&retval_ptr); } zval_ptr_dtor(argv[0]); @@ -1016,7 +1013,6 @@ } /* }}} */ - /* {{{ curl_read */ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) @@ -1329,10 +1325,10 @@ Initialize a cURL session */ PHP_FUNCTION(curl_init) { - php_curl*ch; - CURL*cp; - char*url = NULL; - int url_len = 0; + php_curl*ch; + CURL*cp; + char*url = NULL; + int url_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &url, &url_len) == FAILURE) { return; @@ -1388,14 +1384,14 @@ Copy a cURL handle along with all of it's preferences */ PHP_FUNCTION(curl_copy_handle) { - zval *zid; - CURL *cp; - php_curl *ch; - php_curl *dupch; + CURL*cp; + zval*zid; + php_curl*ch, *dupch; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) { return; } + ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); cp = curl_easy_duphandle(ch->cp); @@ -1930,16 +1926,16 @@ PHP_FUNCTION(curl_setopt) { zval *zid, **zvalue; - long zoption; - php_curl*ch; + long
[PHP-CVS] cvs: php-src /ext/curl interface.c
janiMon May 18 12:50:44 2009 UTC Modified files: /php-src/ext/curl interface.c Log: - fix CS, merged one parameter parsing patch missing from HEAD http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.162&r2=1.163&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.162 php-src/ext/curl/interface.c:1.163 --- php-src/ext/curl/interface.c:1.162 Mon May 18 12:14:25 2009 +++ php-src/ext/curl/interface.cMon May 18 12:50:44 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.162 2009/05/18 12:14:25 jani Exp $ */ +/* $Id: interface.c,v 1.163 2009/05/18 12:50:44 jani Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -284,7 +284,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_close, 0) ZEND_ARG_INFO(0, mh) ZEND_END_ARG_INFO() - /* }}} */ /* {{{ curl_functions[] @@ -361,7 +360,6 @@ #if LIBCURL_VERSION_NUM > 0x070a06 /* 7.10.7 */ {"AsynchDNS", CURL_VERSION_ASYNCHDNS}, #endif - #if LIBCURL_VERSION_NUM > 0x070a05 /* 7.10.6 */ {"Debug", CURL_VERSION_DEBUG}, {"GSS-Negotiate", CURL_VERSION_GSSNEGOTIATE}, @@ -999,8 +997,9 @@ if (Z_TYPE_P(retval_ptr) != IS_LONG) { convert_to_long_ex(&retval_ptr); } - if(0 != Z_LVAL_P(retval_ptr)) + if (0 != Z_LVAL_P(retval_ptr)) { rval = 1; + } zval_ptr_dtor(&retval_ptr); } zval_ptr_dtor(argv[0]); @@ -1405,7 +1404,7 @@ zval*zid; php_curl*ch, *dupch; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zid) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) { return; } @@ -1621,7 +1620,6 @@ } } #endif - if (option == CURLOPT_URL) { if (!php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue))) { RETVAL_FALSE; @@ -1637,7 +1635,6 @@ zend_llist_add_element(&ch->to_free.str, ©str); #endif } - break; } case CURLOPT_FILE: @@ -1760,11 +1757,11 @@ struct HttpPost *first = NULL; struct HttpPost *last = NULL; char *postval; - zstr string_key; - char *key; - ulongnum_key; - uint string_key_len; - int type = -1; + zstr string_key; + char *key; + ulong num_key; + uint string_key_len; + int type = -1; postfields = HASH_OF(*zvalue); if (!postfields) { @@ -1995,10 +1992,10 @@ PHP_FUNCTION(curl_setopt) { zval *zid, **zvalue; - longoptions; - php_curl*ch; + longoptions; + php_curl *ch; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zlZ", &zid, &options, &zvalue) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlZ", &zid, &options, &zvalue) == FAILURE) { return; } @@ -2069,7 +2066,7 @@ zval*zid; php_curl*ch; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zid) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) { return; } @@ -2111,7 +2108,7 @@ php_curl*ch; longoption = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &zid, &option) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zid, &option) == FAILURE) { return; } @@ -2262,7 +2259,7 @@ zval*zid; php_curl*ch; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zid) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zid) == FAILURE) { return; } @@ -2280,7 +2277,7 @@ zval*zid; p
Re: [PHP-CVS] cvs: php-src /ext/standard pack.c /ext/standard/tests/strings bug38770.phpt
Hello, Em Ter, 2009-05-12 às 12:37 +, Ilia Alshanetsky escreveu: > iliaa Tue May 12 12:37:52 2009 UTC > > Modified files: > /php-src/ext/standard/tests/strings bug38770.phpt > /php-src/ext/standard pack.c > Log: > > MFB: Fixed bug #47564 (unpacking unsigned long 32bit bit endian returns > wrong result) > > > http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug38770.phpt?r1=1.3&r2=1.4&diff_format=u > Index: php-src/ext/standard/tests/strings/bug38770.phpt > diff -u php-src/ext/standard/tests/strings/bug38770.phpt:1.3 > php-src/ext/standard/tests/strings/bug38770.phpt:1.4 > --- php-src/ext/standard/tests/strings/bug38770.phpt:1.3 Tue May 27 > 10:50:45 2008 > +++ php-src/ext/standard/tests/strings/bug38770.phpt Tue May 12 12:37:52 2009 > @@ -12,7 +12,7 @@ > --EXPECT-- > Array > ( > -[1] => -3 > +[1] => 4294937296 > ) This test is failing for me: 003+ [1] => -3 003- [1] => 4294937296 http://gcov.php.net/viewer.php?version=PHP_5_3&func=tests&file=ext% 2Fstandard%2Ftests%2Fstrings%2Fbug38770.phpt -- Regards, Felipe Pena -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/curl interface.c
janiMon May 18 12:14:25 2009 UTC Modified files: /php-src/ext/curl interface.c Log: - Fix CS http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.161&r2=1.162&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.161 php-src/ext/curl/interface.c:1.162 --- php-src/ext/curl/interface.c:1.161 Mon May 18 12:03:05 2009 +++ php-src/ext/curl/interface.cMon May 18 12:14:25 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.161 2009/05/18 12:03:05 pajoye Exp $ */ +/* $Id: interface.c,v 1.162 2009/05/18 12:14:25 jani Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -158,13 +158,14 @@ #define CAAZ(s, v) add_assoc_zval_ex(return_value, s, sizeof(s), (zval *) v); #if defined(PHP_WIN32) || defined(__GNUC__) - #define php_curl_ret(__ret) RETVAL_FALSE; return __ret; +# define php_curl_ret(__ret) RETVAL_FALSE; return __ret; #else - #define php_curl_ret(__ret) RETVAL_FALSE; return; +# define php_curl_ret(__ret) RETVAL_FALSE; return; #endif -static int php_curl_option_url(php_curl *ch, const char *url, const int len) { - CURLcode error=CURLE_OK; +static int php_curl_option_url(php_curl *ch, const char *url, const int len) /* {{{ */ +{ + CURLcode error = CURLE_OK; #if LIBCURL_VERSION_NUM < 0x071100 char *copystr = NULL; #endif @@ -201,6 +202,7 @@ return (error == CURLE_OK ? 1 : 0); } +/* }}} */ /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_version, 0, 0, 0) @@ -347,7 +349,7 @@ php_info_print_table_row(2, "Age", str); /* To update on each new cURL release using src/main.c in cURL sources */ - if(d->features) { + if (d->features) { struct feat { const char *name; int bitmask; @@ -458,7 +460,6 @@ le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number); le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, "curl", module_number); - /* See http://curl.haxx.se/lxr/source/docs/libcurl/symbols-in-versions or curl src/docs/libcurl/symbols-in-versions for a (almost) complete list of options and which version they were introduced */ @@ -939,11 +940,7 @@ /* {{{ curl_progress */ -static size_t curl_progress(void *clientp, -double dltotal, -double dlnow, -double ultotal, -double ulnow) +static size_t curl_progress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { php_curl *ch = (php_curl *) clientp; php_curl_progress *t = ch->handlers->progress; @@ -1017,7 +1014,6 @@ } /* }}} */ - /* {{{ curl_read */ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) @@ -1340,7 +1336,7 @@ zend_uchar url_type = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|t", &url, &url_len, &url_type) == FAILURE) { - RETURN_FALSE; + return; } if (url.v && url_type == IS_UNICODE) { @@ -2003,7 +1999,7 @@ php_curl*ch; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zlZ", &zid, &options, &zvalue) == FAILURE) { - RETURN_FALSE; + return; } ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); @@ -2024,11 +2020,11 @@ php_curl*ch; ulong option; HashPositionpos; - zstrstring_key; - uintstr_key_len; + zstrstring_key; + uintstr_key_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "za", &zid, &arr) == FAILURE) { - RETURN_FALSE; + return; } ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); @@ -2074,7 +2070,7 @@ php_curl*ch; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zid) == FAILURE) { - RETURN_FALSE; + return; } ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); @@ -2203,13 +2199,13 @@ case CURLINFO_PRIVATE: case CURLINFO_EFFECTIVE_URL: case CURLINFO_CONTENT_TYPE: { - char *s_code = NULL; + char *s_code = NULL; - if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) { - RETURN_ASCII_STRING(s_code, 1); - } else { - RETURN_FALSE; - } + if
Re: [PHP-CVS] cvs: php-src /ext/curl interface.c
Pierre Joye wrote: On Mon, May 18, 2009 at 2:07 PM, Jani Taskinen wrote: Can't you do it all in one commit? Now you've littered the log with these half-assed commits, and STILL didn't do everything..there are several "RETURN_FALSE;"'s there where simple "return" is necessary. I do, only missed the 2nd one... but I'm done now anyway. It is already less painful to merge head and 5.3 You have missed 8 invalid parameters returning false parts. Also while adding the file:// thing, you added CS violating stuff, didn't add folding tags..etc. --Jani -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/curl interface.c
On Mon, May 18, 2009 at 2:07 PM, Jani Taskinen wrote: > Can't you do it all in one commit? Now you've littered the log with these > half-assed commits, and STILL didn't do everything..there are several > "RETURN_FALSE;"'s there where simple "return" is necessary. I do, only missed the 2nd one... but I'm done now anyway. It is already less painful to merge head and 5.3 -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/curl interface.c
Can't you do it all in one commit? Now you've littered the log with these half-assed commits, and STILL didn't do everything..there are several "RETURN_FALSE;"'s there where simple "return" is necessary. --Jani Pierre-Alain Joye wrote: pajoye Mon May 18 12:03:05 2009 UTC Modified files: /php-src/ext/curl interface.c Log: - sync with 5.3 http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.160&r2=1.161&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.160 php-src/ext/curl/interface.c:1.161 --- php-src/ext/curl/interface.c:1.160 Mon May 18 11:50:29 2009 +++ php-src/ext/curl/interface.cMon May 18 12:03:05 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.160 2009/05/18 11:50:29 pajoye Exp $ */ +/* $Id: interface.c,v 1.161 2009/05/18 12:03:05 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -1298,8 +1298,7 @@ array_init(protocol_list); while (*p != NULL) { - add_next_index_ascii_string(protocol_list, *p, 1); - *p++; + add_next_index_ascii_string(protocol_list, *p++, 1); } CAAZ("protocols", protocol_list); } @@ -1411,7 +1410,7 @@ php_curl*ch, *dupch; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zid) == FAILURE) { - RETURN_FALSE; + return; } ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/curl interface.c
pajoye Mon May 18 12:03:05 2009 UTC Modified files: /php-src/ext/curl interface.c Log: - sync with 5.3 http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.160&r2=1.161&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.160 php-src/ext/curl/interface.c:1.161 --- php-src/ext/curl/interface.c:1.160 Mon May 18 11:50:29 2009 +++ php-src/ext/curl/interface.cMon May 18 12:03:05 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.160 2009/05/18 11:50:29 pajoye Exp $ */ +/* $Id: interface.c,v 1.161 2009/05/18 12:03:05 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -1298,8 +1298,7 @@ array_init(protocol_list); while (*p != NULL) { - add_next_index_ascii_string(protocol_list, *p, 1); - *p++; + add_next_index_ascii_string(protocol_list, *p++, 1); } CAAZ("protocols", protocol_list); } @@ -1411,7 +1410,7 @@ php_curl*ch, *dupch; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zid) == FAILURE) { - RETURN_FALSE; + return; } ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/curl interface.c
pajoye Mon May 18 12:01:44 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/curl interface.c Log: - MFH: use ZEND_ARG_ARRAY_INFO for arginfo_curl_setopt_array http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.27.2.44&r2=1.62.2.14.2.27.2.45&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.27.2.44 php-src/ext/curl/interface.c:1.62.2.14.2.27.2.45 --- php-src/ext/curl/interface.c:1.62.2.14.2.27.2.44Mon May 18 11:58:04 2009 +++ php-src/ext/curl/interface.cMon May 18 12:01:44 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.27.2.44 2009/05/18 11:58:04 pajoye Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.27.2.45 2009/05/18 12:01:44 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -223,7 +223,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_curl_setopt_array, 0) ZEND_ARG_INFO(0, ch) - ZEND_ARG_INFO(0, options) + ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_curl_exec, 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_3) /ext/curl interface.c
pajoye Mon May 18 11:58:04 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/curl interface.c Log: - sync with HEAD http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.27.2.43&r2=1.62.2.14.2.27.2.44&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.27.2.43 php-src/ext/curl/interface.c:1.62.2.14.2.27.2.44 --- php-src/ext/curl/interface.c:1.62.2.14.2.27.2.43Mon May 18 11:48:31 2009 +++ php-src/ext/curl/interface.cMon May 18 11:58:04 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.27.2.43 2009/05/18 11:48:31 pajoye Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.27.2.44 2009/05/18 11:58:04 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -2044,16 +2044,15 @@ { zval*zid; php_curl*ch; - int argc = ZEND_NUM_ARGS(); long option = 0; - if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &zid, &option) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zid, &option) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); - if (argc < 2) { + if (ZEND_NUM_ARGS() < 2) { char *s_code; longl_code; double d_code; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/curl interface.c
pajoye Mon May 18 11:50:29 2009 UTC Modified files: /php-src/ext/curl interface.c Log: - return NULL on invalid args http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.159&r2=1.160&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.159 php-src/ext/curl/interface.c:1.160 --- php-src/ext/curl/interface.c:1.159 Mon May 18 11:48:56 2009 +++ php-src/ext/curl/interface.cMon May 18 11:50:29 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.159 2009/05/18 11:48:56 pajoye Exp $ */ +/* $Id: interface.c,v 1.160 2009/05/18 11:50:29 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -2117,7 +2117,7 @@ longoption = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &zid, &option) == FAILURE) { - RETURN_FALSE; + return; } ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/curl interface.c
pajoye Mon May 18 11:48:56 2009 UTC Modified files: /php-src/ext/curl interface.c Log: - WS http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.158&r2=1.159&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.158 php-src/ext/curl/interface.c:1.159 --- php-src/ext/curl/interface.c:1.158 Mon May 18 11:40:25 2009 +++ php-src/ext/curl/interface.cMon May 18 11:48:56 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.158 2009/05/18 11:40:25 pajoye Exp $ */ +/* $Id: interface.c,v 1.159 2009/05/18 11:48:56 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -2000,7 +2000,7 @@ PHP_FUNCTION(curl_setopt) { zval *zid, **zvalue; - long options; + longoptions; php_curl*ch; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zlZ", &zid, &options, &zvalue) == FAILURE) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/curl interface.c
pajoye Mon May 18 11:48:31 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/curl interface.c Log: - more WS http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.27.2.42&r2=1.62.2.14.2.27.2.43&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.27.2.42 php-src/ext/curl/interface.c:1.62.2.14.2.27.2.43 --- php-src/ext/curl/interface.c:1.62.2.14.2.27.2.42Mon May 18 11:18:59 2009 +++ php-src/ext/curl/interface.cMon May 18 11:48:31 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.27.2.42 2009/05/18 11:18:59 pajoye Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.27.2.43 2009/05/18 11:48:31 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -223,7 +223,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_curl_setopt_array, 0) ZEND_ARG_INFO(0, ch) - ZEND_ARG_INFO(0, options)/* ARRAY_INFO(0, options, 0) */ + ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_curl_exec, 0) @@ -1264,7 +1264,7 @@ PHP_FUNCTION(curl_version) { curl_version_info_data *d; - longuversion = CURLVERSION_NOW; + long uversion = CURLVERSION_NOW; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &uversion) == FAILURE) { return; @@ -1750,7 +1750,7 @@ uint string_key_len; postfields = HASH_OF(*zvalue); - if (! postfields) { + if (!postfields) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS"); RETVAL_FALSE; return 1; @@ -1929,8 +1929,8 @@ Set an option for a cURL transfer */ PHP_FUNCTION(curl_setopt) { - zval*zid, **zvalue; - longzoption; + zval *zid, **zvalue; + long zoption; php_curl*ch; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlZ", &zid, &zoption, &zvalue) == FAILURE) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/curl interface.c
pajoye Mon May 18 11:40:25 2009 UTC Modified files: /php-src/ext/curl interface.c Log: - MFB: - disable file:// when open_basedir are enabled http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.157&r2=1.158&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.157 php-src/ext/curl/interface.c:1.158 --- php-src/ext/curl/interface.c:1.157 Fri May 8 03:32:54 2009 +++ php-src/ext/curl/interface.cMon May 18 11:40:25 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.157 2009/05/08 03:32:54 shire Exp $ */ +/* $Id: interface.c,v 1.158 2009/05/18 11:40:25 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -147,6 +147,7 @@ #endif /* }}} */ +static void _php_curl_close_ex(php_curl *ch TSRMLS_DC); static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); #define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err; @@ -162,29 +163,44 @@ #define php_curl_ret(__ret) RETVAL_FALSE; return; #endif -#define PHP_CURL_CHECK_OPEN_BASEDIR(str, len, __ret) \ - if ((PG(open_basedir) && *PG(open_basedir)) && \ - strncasecmp(str, "file:", sizeof("file:") - 1) == 0) \ - { \ - php_url *tmp_url; \ - \ - if (!(tmp_url = php_url_parse_ex(str, len))) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", str); \ - php_curl_ret(__ret); \ - } \ - \ - if (!php_memnstr(str, tmp_url->path, strlen(tmp_url->path), str + len)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL '%s' contains unencoded control characters", str); \ - php_url_free(tmp_url); \ - php_curl_ret(__ret); \ - } \ - \ - if (tmp_url->query || tmp_url->fragment || php_check_open_basedir(tmp_url->path TSRMLS_CC)) { \ - php_url_free(tmp_url); \ - php_curl_ret(__ret); \ - } \ - php_url_free(tmp_url); \ +static int php_curl_option_url(php_curl *ch, const char *url, const int len) { + CURLcode error=CURLE_OK; +#if LIBCURL_VERSION_NUM < 0x071100 + char *copystr = NULL; +#endif + TSRMLS_FETCH(); + + /* Disable file:// if open_basedir or safe_mode are used */ + if ((PG(open_basedir) && *PG(open_basedir))) { +#if LIBCURL_VERSION_NUM >= 0x071304 + error = curl_easy_setopt(ch->cp, CURLOPT_PROTOCOLS, CURLPROTO_ALL & ~CURLPROTO_FILE); +#else + php_url *uri; + + if (!(uri = php_url_parse_ex(url, len))) { + php_
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/curl interface.c
pajoye Mon May 18 11:18:59 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/curl interface.c Log: - MFH: add CURLPROXY_SOCKS4 http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.27.2.41&r2=1.62.2.14.2.27.2.42&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.27.2.41 php-src/ext/curl/interface.c:1.62.2.14.2.27.2.42 --- php-src/ext/curl/interface.c:1.62.2.14.2.27.2.41Mon May 18 11:17:51 2009 +++ php-src/ext/curl/interface.cMon May 18 11:18:59 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.27.2.41 2009/05/18 11:17:51 pajoye Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.27.2.42 2009/05/18 11:18:59 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -710,6 +710,7 @@ REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED); #endif REGISTER_CURL_CONSTANT(CURLPROXY_HTTP); + REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS4); REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5); REGISTER_CURL_CONSTANT(CURL_NETRC_OPTIONAL); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/curl interface.c
pajoye Mon May 18 11:17:52 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/curl interface.c Log: - WS http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.27.2.40&r2=1.62.2.14.2.27.2.41&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.27.2.40 php-src/ext/curl/interface.c:1.62.2.14.2.27.2.41 --- php-src/ext/curl/interface.c:1.62.2.14.2.27.2.40Mon May 18 10:31:08 2009 +++ php-src/ext/curl/interface.cMon May 18 11:17:51 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.27.2.40 2009/05/18 10:31:08 pajoye Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.27.2.41 2009/05/18 11:17:51 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -582,14 +582,14 @@ REGISTER_CURL_CONSTANT(CURL_TIMECOND_LASTMOD); #if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */ - REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH); - /* http authentication options */ - REGISTER_CURL_CONSTANT(CURLAUTH_BASIC); - REGISTER_CURL_CONSTANT(CURLAUTH_DIGEST); - REGISTER_CURL_CONSTANT(CURLAUTH_GSSNEGOTIATE); - REGISTER_CURL_CONSTANT(CURLAUTH_NTLM); - REGISTER_CURL_CONSTANT(CURLAUTH_ANY); - REGISTER_CURL_CONSTANT(CURLAUTH_ANYSAFE); + REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH); + /* http authentication options */ + REGISTER_CURL_CONSTANT(CURLAUTH_BASIC); + REGISTER_CURL_CONSTANT(CURLAUTH_DIGEST); + REGISTER_CURL_CONSTANT(CURLAUTH_GSSNEGOTIATE); + REGISTER_CURL_CONSTANT(CURLAUTH_NTLM); + REGISTER_CURL_CONSTANT(CURLAUTH_ANY); + REGISTER_CURL_CONSTANT(CURLAUTH_ANYSAFE); #endif #if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH & CURLOPT_FTP_CREATE_MISSING_DIRS are available since curl 7.10.7 */ @@ -2134,13 +2134,13 @@ case CURLINFO_PRIVATE: case CURLINFO_EFFECTIVE_URL: case CURLINFO_CONTENT_TYPE: { - char *s_code = NULL; + char *s_code = NULL; - if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) { - RETURN_STRING(s_code, 1); - } else { - RETURN_FALSE; - } + if (curl_easy_getinfo(ch->cp, option, &s_code) == CURLE_OK && s_code) { + RETURN_STRING(s_code, 1); + } else { + RETURN_FALSE; + } break; } case CURLINFO_HTTP_CODE: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/curl config.m4
pajoye Mon May 18 10:32:04 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/curl config.m4 Log: - should not have been commited http://cvs.php.net/viewvc.cgi/php-src/ext/curl/config.m4?r1=1.28.2.3.2.7.2.3&r2=1.28.2.3.2.7.2.4&diff_format=u Index: php-src/ext/curl/config.m4 diff -u php-src/ext/curl/config.m4:1.28.2.3.2.7.2.3 php-src/ext/curl/config.m4:1.28.2.3.2.7.2.4 --- php-src/ext/curl/config.m4:1.28.2.3.2.7.2.3 Mon May 18 10:31:08 2009 +++ php-src/ext/curl/config.m4 Mon May 18 10:32:04 2009 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.28.2.3.2.7.2.3 2009/05/18 10:31:08 pajoye Exp $ +dnl $Id: config.m4,v 1.28.2.3.2.7.2.4 2009/05/18 10:32:04 pajoye Exp $ dnl PHP_ARG_WITH(curl, for cURL support, @@ -10,7 +10,6 @@ [ --with-curlwrappers Use cURL for url streams], no, no) if test "$PHP_CURL" != "no"; then - AC_MSG_CHECKING($PHP_CURL ..) if test -r $PHP_CURL/include/curl/easy.h; then CURL_DIR=$PHP_CURL 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_3) /ext/curl config.m4 interface.c
pajoye Mon May 18 10:31:08 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/curl config.m4 interface.c Log: - MFB: - disable file:// when safe_mode or open_basedir are enabled http://cvs.php.net/viewvc.cgi/php-src/ext/curl/config.m4?r1=1.28.2.3.2.7.2.2&r2=1.28.2.3.2.7.2.3&diff_format=u Index: php-src/ext/curl/config.m4 diff -u php-src/ext/curl/config.m4:1.28.2.3.2.7.2.2 php-src/ext/curl/config.m4:1.28.2.3.2.7.2.3 --- php-src/ext/curl/config.m4:1.28.2.3.2.7.2.2 Sat May 2 19:53:48 2009 +++ php-src/ext/curl/config.m4 Mon May 18 10:31:08 2009 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.28.2.3.2.7.2.2 2009/05/02 19:53:48 jani Exp $ +dnl $Id: config.m4,v 1.28.2.3.2.7.2.3 2009/05/18 10:31:08 pajoye Exp $ dnl PHP_ARG_WITH(curl, for cURL support, @@ -10,6 +10,7 @@ [ --with-curlwrappers Use cURL for url streams], no, no) if test "$PHP_CURL" != "no"; then + AC_MSG_CHECKING($PHP_CURL ..) if test -r $PHP_CURL/include/curl/easy.h; then CURL_DIR=$PHP_CURL else http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.27.2.39&r2=1.62.2.14.2.27.2.40&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.27.2.39 php-src/ext/curl/interface.c:1.62.2.14.2.27.2.40 --- php-src/ext/curl/interface.c:1.62.2.14.2.27.2.39Fri May 8 03:33:06 2009 +++ php-src/ext/curl/interface.cMon May 18 10:31:08 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.27.2.39 2009/05/08 03:33:06 shire Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.27.2.40 2009/05/18 10:31:08 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -147,6 +147,7 @@ #endif /* }}} */ +static void _php_curl_close_ex(php_curl *ch TSRMLS_DC); static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); #define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err; @@ -162,31 +163,44 @@ #define php_curl_ret(__ret) RETVAL_FALSE; return; #endif -#define PHP_CURL_CHECK_OPEN_BASEDIR(str, len, __ret) \ - if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && \ - strncasecmp(str, "file:", sizeof("file:") - 1) == 0) \ - { \ - php_url *tmp_url; \ - \ - if (!(tmp_url = php_url_parse_ex(str, len))) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", str); \ - php_curl_ret(__ret); \ - } \ - \ - if (tmp_url->host || !php_memnstr(str, tmp_url->path, strlen(tmp_url->path), str + len)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL '%s' contains unencoded control characters", str); \ - php_url_free(tmp_url); \ - php_curl_ret(__ret); \ - } \ - \ - if (tmp_url->query || tmp_url->fragment || php_check_open_basedir(tmp_url->path TSRMLS_CC) || \ - (PG(safe_mode) && !php_checkuid(tmp_url->path, "rb+", CHECKUID_CHECK_MODE_PARAM)) \ - ) {
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/curl interface.c
pajoye Mon May 18 09:11:31 2009 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/curl interface.c Log: - WS http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.46&r2=1.62.2.14.2.47&diff_format=u Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.62.2.14.2.46 php-src/ext/curl/interface.c:1.62.2.14.2.47 --- php-src/ext/curl/interface.c:1.62.2.14.2.46 Thu Apr 16 14:26:09 2009 +++ php-src/ext/curl/interface.cMon May 18 09:11:31 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.62.2.14.2.46 2009/04/16 14:26:09 pajoye Exp $ */ +/* $Id: interface.c,v 1.62.2.14.2.47 2009/05/18 09:11:31 pajoye Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -367,7 +367,7 @@ { le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number); le_curl_multi_handle = zend_register_list_destructors_ex(_php_curl_multi_close, NULL, "curl", module_number); - + /* Constants for curl_setopt() */ REGISTER_CURL_CONSTANT(CURLOPT_DNS_USE_GLOBAL_CACHE); REGISTER_CURL_CONSTANT(CURLOPT_DNS_CACHE_TIMEOUT); @@ -435,7 +435,7 @@ REGISTER_CURL_CONSTANT(CURLOPT_FILETIME); REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION); REGISTER_CURL_CONSTANT(CURLOPT_READFUNCTION); -#if CURLOPT_PASSWDFUNCTION != 0 +#if CURLOPT_PASSWDFUNCTION != 0 REGISTER_CURL_CONSTANT(CURLOPT_PASSWDFUNCTION); #endif REGISTER_CURL_CONSTANT(CURLOPT_HEADERFUNCTION); @@ -534,7 +534,7 @@ REGISTER_CURL_CONSTANT(CURL_VERSION_KERBEROS4); REGISTER_CURL_CONSTANT(CURL_VERSION_SSL); REGISTER_CURL_CONSTANT(CURL_VERSION_LIBZ); - + /* version constants */ REGISTER_CURL_CONSTANT(CURLVERSION_NOW); @@ -619,7 +619,7 @@ REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_NONE); REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_0); REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_1); - + REGISTER_CURL_CONSTANT(CURLM_CALL_MULTI_PERFORM); REGISTER_CURL_CONSTANT(CURLM_OK); REGISTER_CURL_CONSTANT(CURLM_BAD_HANDLE); @@ -665,13 +665,13 @@ #ifdef PHP_CURL_NEED_OPENSSL_TSL if (!CRYPTO_get_id_callback()) { int i, c = CRYPTO_num_locks(); - + php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T)); - + for (i = 0; i < c; ++i) { php_curl_openssl_tsl[i] = tsrm_mutex_alloc(); } - + CRYPTO_set_id_callback(php_curl_ssl_id); CRYPTO_set_locking_callback(php_curl_ssl_lock); } @@ -679,7 +679,7 @@ #ifdef PHP_CURL_NEED_GNUTLS_TSL gcry_control(GCRYCTL_SET_THREAD_CBS, &php_curl_gnutls_tsl); #endif - + if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) { return FAILURE; } @@ -701,7 +701,7 @@ php_register_url_stream_wrapper("ldap", &php_curl_wrapper TSRMLS_CC); # endif #endif - + return SUCCESS; } /* }}} */ @@ -720,14 +720,14 @@ #ifdef PHP_CURL_NEED_OPENSSL_TSL if (php_curl_openssl_tsl) { int i, c = CRYPTO_num_locks(); - + CRYPTO_set_id_callback(NULL); CRYPTO_set_locking_callback(NULL); - + for (i = 0; i < c; ++i) { tsrm_mutex_free(php_curl_openssl_tsl[i]); } - + free(php_curl_openssl_tsl); php_curl_openssl_tsl = NULL; } @@ -749,7 +749,7 @@ fprintf(stderr, "curl_write() called\n"); fprintf(stderr, "data = %s, size = %d, nmemb = %d, ctx = %x\n", data, size, nmemb, ctx); #endif - + switch (t->method) { case PHP_CURL_STDOUT: PHPWRITE(data, length); @@ -773,7 +773,7 @@ ZVAL_RESOURCE(handle, ch->id); zend_list_addref(ch->id); argv[0] = &handle; - + MAKE_STD_ZVAL(zdata); ZVAL_STRINGL(zdata, data, length, 1); argv[1] = &zdata; @@ -864,7 +864,7 @@ error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC); ch->in_callback = 0; if (error == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION"); #if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */ length = CURL_READFUNC_ABORT; #endif @@ -895,7 +895,7 @@ php_curl_write *t = ch->handlers->write_header; size_t length = size *