[PHP-CVS] cvs: php4 / run-tests.php /ext/curl interface.c streams.c /ext/fbsql php_fbsql.c /ext/ftp ftp.c /ext/hyperwave hg_comm.c hw.c /ext/imap php_imap.c /ext/ldap ldap.c /ext/mcal php_mcal.c /ext/mysql php_mysql.c /ext/odbc php_odbc.c /ext/rpc/com com_wrapper.c /ext/snmp snmp.c /ext/standard dns.c file.c fsock.c ftp_fopen_wrapper.c http_fopen_wrapper.c pack.c /ext/zlib zlib.c /main fopen_wrappers.c mergesort.c network.c php.h php_open_temporary_file.c streams.c /win32 php4dllts.dsp sendmail.c time.h

2003-02-15 Thread Wez Furlong
wez Sat Feb 15 22:48:49 2003 EDT

  Modified files:  
/php4/ext/curl  interface.c streams.c 
/php4/ext/fbsql php_fbsql.c 
/php4/ext/ftp   ftp.c 
/php4/ext/hyperwave hg_comm.c hw.c 
/php4/ext/imap  php_imap.c 
/php4/ext/ldap  ldap.c 
/php4/ext/mcal  php_mcal.c 
/php4/ext/mysql php_mysql.c 
/php4/ext/odbc  php_odbc.c 
/php4/ext/rpc/com   com_wrapper.c 
/php4/ext/snmp  snmp.c 
/php4/ext/standard  dns.c file.c fsock.c ftp_fopen_wrapper.c 
http_fopen_wrapper.c pack.c 
/php4/ext/zlib  zlib.c 
/php4/main  fopen_wrappers.c mergesort.c network.c php.h 
php_open_temporary_file.c streams.c 
/php4   run-tests.php 
/php4/win32 php4dllts.dsp sendmail.c time.h 
  Log:
  A add much more useful select(2) implementation than is provided by
  windows sockets.  The winsock implementation will only work with sockets;
  our implementation works with sockets and file descriptors.
  By association, stream_select() will now operate correctly with files, pipes and 
sockets.
  
  This change required linking against the winsock2 library.  In terms of
  compatibility, only older versions of windows 95 do not have winsock2
  installed by default.  It is available as a redistributable file, and is most likely 
installed by any OS patches (eg: Internet Explorer) applied by the user.
  
  Also, add a win32 compatible pipe test when opening a stream from a pipe.  This test 
will only work on NT, win2k and XP platforms.  Without this test, interleaved fread() 
and select() calls would cause the read buffer to be clobbered.  I will be working on 
a fix for this issue for win9x.
  
Index: php4/ext/curl/interface.c
diff -u php4/ext/curl/interface.c:1.7 php4/ext/curl/interface.c:1.8
--- php4/ext/curl/interface.c:1.7   Mon Feb  3 15:56:23 2003
+++ php4/ext/curl/interface.c   Sat Feb 15 22:48:43 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: interface.c,v 1.7 2003/02/03 20:56:23 iliaa Exp $ */
+/* $Id: interface.c,v 1.8 2003/02/16 03:48:43 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -30,7 +30,7 @@
 #include 
 
 #ifdef PHP_WIN32
-#include 
+#include 
 #include 
 #endif
 
Index: php4/ext/curl/streams.c
diff -u php4/ext/curl/streams.c:1.3 php4/ext/curl/streams.c:1.4
--- php4/ext/curl/streams.c:1.3 Tue Dec 31 11:06:21 2002
+++ php4/ext/curl/streams.c Sat Feb 15 22:48:43 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: streams.c,v 1.3 2002/12/31 16:06:21 sebastian Exp $ */
+/* $Id: streams.c,v 1.4 2003/02/16 03:48:43 wez Exp $ */
 
 /* This file implements cURL based wrappers.
  * NOTE: If you are implementing your own streams that are intended to
@@ -36,7 +36,7 @@
 #include 
 
 #ifdef PHP_WIN32
-#include 
+#include 
 #include 
 #endif
 
Index: php4/ext/fbsql/php_fbsql.c
diff -u php4/ext/fbsql/php_fbsql.c:1.92 php4/ext/fbsql/php_fbsql.c:1.93
--- php4/ext/fbsql/php_fbsql.c:1.92 Wed Feb 12 15:44:00 2003
+++ php4/ext/fbsql/php_fbsql.c  Sat Feb 15 22:48:44 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_fbsql.c,v 1.92 2003/02/12 20:44:00 iliaa Exp $ */
+/* $Id: php_fbsql.c,v 1.93 2003/02/16 03:48:44 wez Exp $ */
 
 /* TODO:
  *
@@ -43,7 +43,7 @@
 #include "ext/standard/php_string.h"
 
 #ifdef PHP_WIN32
-#include 
+#include 
 #else
 #include 
 
Index: php4/ext/ftp/ftp.c
diff -u php4/ext/ftp/ftp.c:1.79 php4/ext/ftp/ftp.c:1.80
--- php4/ext/ftp/ftp.c:1.79 Fri Feb 14 15:15:11 2003
+++ php4/ext/ftp/ftp.c  Sat Feb 15 22:48:44 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: ftp.c,v 1.79 2003/02/14 20:15:11 iliaa Exp $ */
+/* $Id: ftp.c,v 1.80 2003/02/16 03:48:44 wez Exp $ */
 
 #include "php.h"
 
@@ -33,7 +33,7 @@
 #include 
 #include 
 #ifdef PHP_WIN32
-#include 
+#include 
 #elif defined(NETWARE)
 #ifdef USE_WINSOCK/* Modified to use Winsock (NOVSOCK2.H), atleast for now */
 #include 
Index: php4/ext/hyperwave/hg_comm.c
diff -u php4/ext/hyperwave/hg_comm.c:1.54 php4/ext/hyperwave/hg_comm.c:1.55
--- php4/ext/hyperwave/hg_comm.c:1.54   Tue Jan 14 12:45:30 2003
+++ php4/ext/hyperwave/hg_comm.cSat Feb 15 22:48:44 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: hg_comm.c,v 1.54 2003/01/14 17:45:30 iliaa Exp $ */
+/* $Id: hg_comm.c,v 1.55 2003/02/16 03:48:44 wez Exp $ */
 
 /* #define HW_DEBUG */
 
@@ -31,7 +31,7 @@
 #include  
 #include 
 #ifdef PHP_WIN32
-# include 
+# include 
 # define EWOULDBLOCK WSAEWOULDBLOCK
 # define ETIMEDOUT WSAETIMEDOUT
 # define bcopy memcpy
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.118 php4/ext/hyperwave/hw.c:1.119
--- php4/ext/hyperwave/hw.c:1.118   Mon Jan 27

[PHP-CVS] cvs: php4 /sapi/cgi cgi_main.c getopt.c php_getopt.h /sapi/cli getopt.c php.1.in php_cli.c php_getopt.h

2003-02-15 Thread Marcus Boerger
helly   Sat Feb 15 20:23:12 2003 EDT

  Modified files:  
/php4/sapi/cgi  cgi_main.c getopt.c php_getopt.h 
/php4/sapi/cli  getopt.c php.1.in php_cli.c php_getopt.h 
  Log:
  - Allow long option names
  - Update CLI's manpage
  
  @Added support for long options in CLI & CGI (e.g. --version). (Marcus)
  
  # In contrast to the preliminary patch this should work now completely.
  # If all long option names are accepted we may even think about MFHing.
  
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.211 php4/sapi/cgi/cgi_main.c:1.212
--- php4/sapi/cgi/cgi_main.c:1.211  Fri Feb 14 09:38:20 2003
+++ php4/sapi/cgi/cgi_main.cSat Feb 15 20:23:11 2003
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.211 2003/02/14 14:38:20 sniper Exp $ */
+/* $Id: cgi_main.c,v 1.212 2003/02/16 01:23:11 helly Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -117,8 +117,31 @@
 #define PHP_MODE_LINT  4
 #define PHP_MODE_STRIP 5
 
-extern char *ap_php_optarg;
-extern int ap_php_optind;
+static char *optarg = NULL;
+static int optind = 1;
+
+static const opt_struct OPTIONS[] = {
+   {'a', 0, "interactive"},
+   {'C', 0, "no-chdir"},
+   {'c', 1, "php-ini"},
+   {'d', 1, "define"},
+   {'e', 0, "profile-info"},
+   {'f', 1, "file"},
+   {'g', 1, "global"},
+   {'h', 0, "help"},
+   {'i', 0, "info"},
+   {'l', 0, "syntax-check"},
+   {'m', 0, "modules"},
+   {'n', 0, "no-php-ini"},
+   {'q', 0, "no-header"},
+   {'s', 0, "syntax-highlight"},
+   {'s', 0, "syntax-highlighting"},
+   {'w', 0, "strip"},
+   {'?', 0, "usage"},/* help alias (both '?' and 'usage') */
+   {'v', 0, "version"},
+   {'z', 1, "zend-extension"},
+   {'-', 0, NULL} /* end of args */
+};
 
 #if ENABLE_PATHINFO_CHECK
 /* true global.  this is retreived once only, even for fastcgi */
@@ -138,8 +161,6 @@
 #define TRANSLATE_SLASHES(path)
 #endif
 
-#define OPTSTRING "abCc:d:ef:g:hilmnqsw?vz:"
-
 static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC)
 {
php_printf("%s\n", module->name);
@@ -515,7 +536,7 @@
prog = "php";
}
 
-   php_printf("Usage: %s [-q] [-h] [-s [-v] [-i] [-f ] \n"
+   php_printf("Usage: %s [-q] [-h] [-s] [-v] [-i] [-f ]\n"
   "   %s  [args...]\n"
   "  -a   Run interactively\n"
 #if PHP_FASTCGI
@@ -881,8 +902,8 @@
 /* temporary locals */
int behavior=PHP_MODE_STANDARD;
int no_headers=0;
-   int orig_optind=ap_php_optind;
-   char *orig_optarg=ap_php_optarg;
+   int orig_optind=optind;
+   char *orig_optarg=optarg;
char *script_file=NULL;
zend_llist global_vars;
int interactive=0;
@@ -958,10 +979,10 @@
/* allow ini override for fastcgi */
 #endif
) {
-   while ((c=ap_php_getopt(argc, argv, OPTSTRING))!=-1) {
+   while ((c=php_getopt(argc, argv, OPTIONS, &optarg, &optind, 0))!=-1) {
switch (c) {
case 'c':
-   cgi_sapi_module.php_ini_path_override = 
strdup(ap_php_optarg);
+   cgi_sapi_module.php_ini_path_override = 
+strdup(optarg);
break;
case 'n':
cgi_sapi_module.php_ini_ignore = 1;
@@ -971,14 +992,14 @@
   we are being started as an 'external' fastcgi
   server by accepting a bindpath parameter. */
case 'b':
-   if (!fastcgi) bindpath= strdup(ap_php_optarg);
+   if (!fastcgi) bindpath= strdup(optarg);
break;
 #endif
}
 
}
-   ap_php_optind = orig_optind;
-   ap_php_optarg = orig_optarg;
+   optind = orig_optind;
+   optarg = orig_optarg;
}
 
 #ifdef ZTS
@@ -1172,8 +1193,9 @@
&& !fastcgi
 #endif
) {
-   while ((c=ap_php_getopt(argc, argv, OPTSTRING))!=-1) {
+   while ((c=php_getopt(argc, argv, OPTIONS, &optarg, &optind, 
+1))!=-1) {
switch (c) {
+   case 'h':
case '?':
no_headers = 1;
php_output_startup();
@@ -1185,8 +1207,8 @@
break;
}
}
-   ap_

Re: [PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache2handler .cvsignoreCREDITS README apache_config.c config.m4 php.sym php4apache2.dsp php_apache.hphp_functions.c sapi_apache2.c

2003-02-15 Thread Sascha Schumann
On Sat, 15 Feb 2003, Jani Taskinen wrote:

>
> After short discussion, the #php.bugs mob decided

The so-called "#php.bugs mob" has no decisive power around
here.  Don't make it look like it has.

> that we don't want this in PHP_4_3 branch. At least
> as long as it doesn't work as well (or preferrably better :)
> than the apache2filter SAPI does.

A more appropiate branch is PHP_4.  That enables users to
test experimental code in a stable context, rather than
asking themselves whether the new extension/SAPI module or
engine is at fault.

- Sascha

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3_1) /sapi/cgi cgi_main.c

2003-02-15 Thread Jani Taskinen
sniper  Sat Feb 15 17:56:05 2003 EDT

  Modified files:  (Branch: PHP_4_3_1)
/php4/sapi/cgi  cgi_main.c 
  Log:
  revert this
  
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.190.2.9.4.1 php4/sapi/cgi/cgi_main.c:1.190.2.9.4.2
--- php4/sapi/cgi/cgi_main.c:1.190.2.9.4.1  Sat Feb 15 16:41:38 2003
+++ php4/sapi/cgi/cgi_main.cSat Feb 15 17:56:04 2003
@@ -441,6 +441,10 @@
 static int sapi_cgi_deactivate(TSRMLS_D)
 {
fflush(stdout);
+   if(SG(request_info).argv0) {
+   free(SG(request_info).argv0);
+   SG(request_info).argv0 = NULL;
+   }
return SUCCESS;
 }
 
@@ -822,6 +826,7 @@
int no_headers=0;
int orig_optind=ap_php_optind;
char *orig_optarg=ap_php_optarg;
+   char *argv0=NULL;
char *script_file=NULL;
zend_llist global_vars;
int interactive=0;
@@ -887,6 +892,11 @@
|| getenv("GATEWAY_INTERFACE")
|| getenv("REQUEST_METHOD")) {
cgi = 1;
+   if (argc > 1) {
+   argv0 = strdup(argv[1]);
+   } else {
+   argv0 = NULL;
+   }
}
 #if PHP_FASTCGI
}
@@ -991,7 +1001,7 @@
 
 #if ENABLE_PATHINFO_CHECK
if (cfg_get_long("cgi.fix_pathinfo", &fix_pathinfo) == FAILURE) {
-   fix_pathinfo = 0;
+   fix_pathinfo = 1;
}
 #endif
 
@@ -1166,6 +1176,8 @@
 
init_request_info(TSRMLS_C);
 
+   SG(request_info).argv0 = argv0;
+
zend_llist_init(&global_vars, sizeof(char *), NULL, 0);
 
CG(interactive) = 0;
@@ -1174,7 +1186,11 @@
 #if PHP_FASTCGI
&& !fastcgi
 #endif
-   ) {
+   ) { /* never execute the arguments if you are a CGI */  
+   if (SG(request_info).argv0) {
+   free(SG(request_info).argv0);
+   SG(request_info).argv0 = NULL;
+   }
 
if (cgi_sapi_module.php_ini_path_override && 
cgi_sapi_module.php_ini_ignore) {
no_headers = 1;  
@@ -1345,20 +1361,18 @@
}
}
 
-   if (cgi 
 #if PHP_FASTCGI
-   || fastcgi
-#endif
-   ) {
-   file_handle.type = ZEND_HANDLE_FILENAME;
+   if (fastcgi) {
+   file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
-   file_handle.handle.fp = NULL;
} else {
+#endif
file_handle.filename = "-";
file_handle.type = ZEND_HANDLE_FP;
file_handle.handle.fp = stdin;
+#if PHP_FASTCGI
}
-
+#endif
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
 
@@ -1380,13 +1394,17 @@
if (cgi || SG(request_info).path_translated) {
retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
}
-   if (retval == FAILURE || file_handle.handle.fp == NULL) {
-   SG(sapi_headers).http_response_code = 404;
-   PUTS("No input file specified.\n");
-   php_request_shutdown((void *) 0);
-   php_module_shutdown(TSRMLS_C);
-   return FAILURE;
-   }
+
+   if (cgi && (retval == FAILURE)) {
+   if(!argv0 || !(file_handle.handle.fp = VCWD_FOPEN(argv0, 
+"rb"))) {
+   PUTS("No input file specified.\n");
+   php_request_shutdown((void *) 0);
+   php_module_shutdown(TSRMLS_C);
+   return FAILURE;
+   }
+   file_handle.filename = argv0;
+   file_handle.opened_path = expand_filepath(argv0, NULL 
+TSRMLS_CC);
+   } 
 
if (file_handle.handle.fp && (file_handle.handle.fp != stdin)) {
/* #!php support */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3_1) /main fopen_wrappers.c

2003-02-15 Thread Jani Taskinen
sniper  Sat Feb 15 17:51:43 2003 EDT

  Modified files:  (Branch: PHP_4_3_1)
/php4/main  fopen_wrappers.c 
  Log:
  Revert this.
  
Index: php4/main/fopen_wrappers.c
diff -u php4/main/fopen_wrappers.c:1.153.2.1 php4/main/fopen_wrappers.c:1.153.2.1.4.1
--- php4/main/fopen_wrappers.c:1.153.2.1Sun Dec  1 18:23:48 2002
+++ php4/main/fopen_wrappers.c  Sat Feb 15 17:51:43 2003
@@ -16,7 +16,7 @@
|  Jim Winstead <[EMAIL PROTECTED]> |
+--+
  */
-/* $Id: fopen_wrappers.c,v 1.153.2.1 2002/12/01 23:23:48 shane Exp $ */
+/* $Id: fopen_wrappers.c,v 1.153.2.1.4.1 2003/02/15 22:51:43 sniper Exp $ */
 
 /* {{{ includes
  */
@@ -348,8 +348,8 @@
fp = NULL;
}
if (!fp) {
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to open %s", 
+filename); 
STR_FREE(SG(request_info).path_translated); /* for same reason as 
above */
-   SG(request_info).path_translated = NULL;
return FAILURE;
}
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache2handler .cvsignore README

2003-02-15 Thread Jani Taskinen
sniper  Sat Feb 15 17:20:55 2003 EDT

  Removed files:   (Branch: PHP_4_3)
/php4/sapi/apache2handler   .cvsignore README 
  Log:
  - Remove all of it.
  # Ian, this was really unnecessary..
  
  



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache2handler CREDITS README apache_config.c config.m4 php.sym php4apache2.dsp php_apache.h php_functions.c sapi_apache2.c

2003-02-15 Thread Ian Holsman
ianhSat Feb 15 17:16:03 2003 EDT

  Removed files:   (Branch: PHP_4_3)
/php4/sapi/apache2handler   CREDITS apache_config.c config.m4 php.sym 
php4apache2.dsp php_apache.h 
php_functions.c sapi_apache2.c 

  Modified files:  
/php4/sapi/apache2handler   README 
  Log:
  
  After short discussion, the #php.bugs mob decided that we don't want
  this in PHP_4_3 branch. At least as long as it doesn't work as well
  (or preferrably better :) than the apache2filter SAPI does.
  
  So please remove it from the branch for now..
  
  --Jani
  
  
  
Index: php4/sapi/apache2handler/README
diff -u php4/sapi/apache2handler/README:1.1.2.1 php4/sapi/apache2handler/README:1.1.2.2
--- php4/sapi/apache2handler/README:1.1.2.1 Sat Feb 15 00:49:31 2003
+++ php4/sapi/apache2handler/README Sat Feb 15 17:16:03 2003
@@ -1,76 +1,9 @@
-WHAT IS THIS?
 
-This module exploits the layered I/O support in Apache 2.0.
-
-HOW DOES IT WORK?
-
-In Apache 2.0, you have handlers which generate content (like
-reading a script from disk). The content goes then through
-a chain of filters. PHP can be such a filter, so that it processes
-your script and hands the output to the next filter (which will
-usually cause a write to the network).
-
-DOES IT WORK?
-
-Currently the issues with the module are:  
-* Thread safety of external PHP modules
-* The lack of re-entrancy of PHP. due to this I have disabled the 'virtual' 
-  function, and tried to stop any method where a php script can run another 
php 
-  script while it is being run.
-
-
-HOW TO INSTALL
-
-This SAPI module is known to work with Apache 2.0.44.
-
-$ cd apache-2.x
-$ cd src
-$ ./configure --enable-so
-$ make install
-
-For testing purposes, you might want to use --with-mpm=prefork.
-(Albeit PHP also works with threaded MPMs. See Thread Safety note above)
-
-Configure PHP 4:
-
-$ cd php-4.x
-$ ./configure --with-apxs2=/path/to/apache-2.0/bin/apxs
-$ make install
-   
-At the end of conf/httpd.conf, add:
-
-AddType application/x-httpd-php .php
-
-If you would like to enable source code highlighting functionality add:
+After short discussion, the #php.bugs mob decided that we don't want
+this in PHP_4_3 branch. At least as long as it doesn't work as well
+(or preferrably better :) than the apache2filter SAPI does.
 
-AddType application/x-httpd-php-source .phps
+So please remove it from the branch for now..
 
-That's it. Now start bin/httpd.
-
-HOW TO CONFIGURE
-
-The Apache 2.0 PHP module supports a new configuration directive that
-allows an admin to override the php.ini search path. For example,
-place your php.ini file in Apache's ServerRoot/conf directory and
-add this to your httpd.conf file:
-
-PHPINIDir "conf"
-
-DEBUGGING APACHE AND PHP
-
-To debug Apache, we recommened:
-
-1. Use the Prefork MPM (Apache 1.3-like process model) by
-   configuring Apache with '--with-mpm=prefork'.
-2. Start httpd using -DONE_PROCESS (e.g. (gdb) r -DONE_PROCESS).
-
-If you want to debug a part of the PHP startup procedure, set a 
-breakpoint on 'load_module'. Step through it until apr_dso_load() is 
-done. Then you can set a breakpoint on any PHP-related symbol.
-
-TODO
-
-PHP functions like apache_sub_req (see php_functions.c)
-Source Code Highlighting
-Protocol handlers
+--Jani
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 / NEWS

2003-02-15 Thread Ilia Alshanetsky
iliaa   Sat Feb 15 17:07:50 2003 EDT

  Modified files:  
/php4   NEWS 
  Log:
  New feature news.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1338 php4/NEWS:1.1339
--- php4/NEWS:1.1338Thu Feb 13 14:48:48 2003
+++ php4/NEWS   Sat Feb 15 17:07:49 2003
@@ -6,6 +6,7 @@
 - Fixed bug #22059 (ftp_chdir causes segfault). (Sara)
 - Fixed bug #20442 (upgraded bundled expat to 1.95.5). (Ilia)
 - Fixed bug #20155 (xmlrpc compile problem with ZE2). (Derick, Jan Schneider)
+- Changed ini parser to allow for handling of quoted multi-line values. (Ilia)
 - Changed get_extension_funcs() to return list of the built-in Zend Engine 
   functions if "zend" is specified as the module name. (Ilia)
 - Changed is_executable() to be available also on Windows. (Shane)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3_1) / configure.in /sapi/cgi cgi_main.c

2003-02-15 Thread Jani Taskinen
sniper  Sat Feb 15 16:41:38 2003 EDT

  Modified files:  (Branch: PHP_4_3_1)
/php4   configure.in 
/php4/sapi/cgi  cgi_main.c 
  Log:
  - correct version plus the fix.
  
  
Index: php4/configure.in
diff -u php4/configure.in:1.396.2.19 php4/configure.in:1.396.2.19.4.1
--- php4/configure.in:1.396.2.19Thu Dec 26 23:07:18 2002
+++ php4/configure.in   Sat Feb 15 16:41:38 2003
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.396.2.19 2002/12/27 04:07:18 andrei Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.396.2.19.4.1 2003/02/15 21:41:38 sniper Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -43,7 +43,7 @@
 
 MAJOR_VERSION=4
 MINOR_VERSION=3
-RELEASE_VERSION=0
+RELEASE_VERSION=1
 EXTRA_VERSION=""
 VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
 
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.190.2.9 php4/sapi/cgi/cgi_main.c:1.190.2.9.4.1
--- php4/sapi/cgi/cgi_main.c:1.190.2.9  Wed Dec 25 16:14:55 2002
+++ php4/sapi/cgi/cgi_main.cSat Feb 15 16:41:38 2003
@@ -441,10 +441,6 @@
 static int sapi_cgi_deactivate(TSRMLS_D)
 {
fflush(stdout);
-   if(SG(request_info).argv0) {
-   free(SG(request_info).argv0);
-   SG(request_info).argv0 = NULL;
-   }
return SUCCESS;
 }
 
@@ -826,7 +822,6 @@
int no_headers=0;
int orig_optind=ap_php_optind;
char *orig_optarg=ap_php_optarg;
-   char *argv0=NULL;
char *script_file=NULL;
zend_llist global_vars;
int interactive=0;
@@ -892,11 +887,6 @@
|| getenv("GATEWAY_INTERFACE")
|| getenv("REQUEST_METHOD")) {
cgi = 1;
-   if (argc > 1) {
-   argv0 = strdup(argv[1]);
-   } else {
-   argv0 = NULL;
-   }
}
 #if PHP_FASTCGI
}
@@ -1001,7 +991,7 @@
 
 #if ENABLE_PATHINFO_CHECK
if (cfg_get_long("cgi.fix_pathinfo", &fix_pathinfo) == FAILURE) {
-   fix_pathinfo = 1;
+   fix_pathinfo = 0;
}
 #endif
 
@@ -1176,8 +1166,6 @@
 
init_request_info(TSRMLS_C);
 
-   SG(request_info).argv0 = argv0;
-
zend_llist_init(&global_vars, sizeof(char *), NULL, 0);
 
CG(interactive) = 0;
@@ -1186,11 +1174,7 @@
 #if PHP_FASTCGI
&& !fastcgi
 #endif
-   ) { /* never execute the arguments if you are a CGI */  
-   if (SG(request_info).argv0) {
-   free(SG(request_info).argv0);
-   SG(request_info).argv0 = NULL;
-   }
+   ) {
 
if (cgi_sapi_module.php_ini_path_override && 
cgi_sapi_module.php_ini_ignore) {
no_headers = 1;  
@@ -1361,18 +1345,20 @@
}
}
 
+   if (cgi 
 #if PHP_FASTCGI
-   if (fastcgi) {
-   file_handle.type = ZEND_HANDLE_FILENAME;
+   || fastcgi
+#endif
+   ) {
+   file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
+   file_handle.handle.fp = NULL;
} else {
-#endif
file_handle.filename = "-";
file_handle.type = ZEND_HANDLE_FP;
file_handle.handle.fp = stdin;
-#if PHP_FASTCGI
}
-#endif
+
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
 
@@ -1394,17 +1380,13 @@
if (cgi || SG(request_info).path_translated) {
retval = php_fopen_primary_script(&file_handle TSRMLS_CC);
}
-
-   if (cgi && (retval == FAILURE)) {
-   if(!argv0 || !(file_handle.handle.fp = VCWD_FOPEN(argv0, 
"rb"))) {
-   PUTS("No input file specified.\n");
-   php_request_shutdown((void *) 0);
-   php_module_shutdown(TSRMLS_C);
-   return FAILURE;
-   }
-   file_handle.filename = argv0;
-   file_handle.opened_path = expand_filepath(argv0, NULL 
TSRMLS_CC);
-   } 
+   if (retval == FAILURE || file_handle.handle.fp == NULL) {
+   SG(sapi_headers).http_response_code = 404;
+   PUTS("No input file specified.\n");
+   php_request_shutdown((void *) 0);
+   php_module_shutdown(TSRMLS_C);
+   return FAILURE;
+   }
 
if (file_handle.handle.fp && (file_handle.handle.fp != stdin)) {
 

[PHP-CVS] cvs: php4(PHP_4_3_1) /main php_version.h

2003-02-15 Thread Edin Kadribasic
edink   Sat Feb 15 16:37:43 2003 EDT

  Modified files:  (Branch: PHP_4_3_1)
/php4/main  php_version.h 
  Log:
  New version number.
  
Index: php4/main/php_version.h
diff -u php4/main/php_version.h:1.66.2.9 php4/main/php_version.h:1.66.2.9.4.1
--- php4/main/php_version.h:1.66.2.9Thu Dec 26 23:07:19 2002
+++ php4/main/php_version.h Sat Feb 15 16:37:42 2003
@@ -2,6 +2,6 @@
 /* edit configure.in to change version number */
 #define PHP_MAJOR_VERSION 4
 #define PHP_MINOR_VERSION 3
-#define PHP_RELEASE_VERSION 0
+#define PHP_RELEASE_VERSION 1
 #define PHP_EXTRA_VERSION ""
-#define PHP_VERSION "4.3.0"
+#define PHP_VERSION "4.3.1"



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /main streams.c

2003-02-15 Thread Wez Furlong
Keep the patch in there for now.

--Wez.

On Sun, 16 Feb 2003, Moriyoshi Koizumi wrote:

> So should I revert the patch on HEAD then?
>
> Moriyoshi
>
> Wez Furlong <[EMAIL PROTECTED]> wrote:
>
> > Actually, the return values throughout that function are all bogus...
> > Don't worry about reverting (for 4.3).
> > I'll add this to my TODO for PHP 5.
> >
> > --Wez.
> >
> > On Sat, 15 Feb 2003, Wez Furlong wrote:
> >
> > > This is a bogus patch; the return value of the php_stream_copy_to_XXX
> > > functions are the number of bytes that were copied, and this patch
> > > breaks that.
> > >
> > > The correct fix for #22234 is to fix php_copy_file() to handle a 0
> > > return from this function.
> > >
> > > Please revert!
> > >
> > > --Wez.
> > >
> > > On Sat, 15 Feb 2003, Moriyoshi Koizumi wrote:
> > >
> > > > moriyoshi   Sat Feb 15 14:56:13 2003 EDT
> > > >
> > > >   Modified files:
> > > > /php4/main  streams.c
> > > >   Log:
> > > >   Fixed bug #22234
> > > >
> > > >
> > > > Index: php4/main/streams.c
> > > > diff -u php4/main/streams.c:1.154 php4/main/streams.c:1.155
> > > > --- php4/main/streams.c:1.154   Thu Feb 13 16:08:04 2003
> > > > +++ php4/main/streams.c Sat Feb 15 14:56:12 2003
> > > > @@ -20,7 +20,7 @@
> > > > +--+
> > > >   */
> > > >
> > > > -/* $Id: streams.c,v 1.154 2003/02/13 21:08:04 wez Exp $ */
> > > > +/* $Id: streams.c,v 1.155 2003/02/15 19:56:12 moriyoshi Exp $ */
> > > >
> > > >  #define _GNU_SOURCE
> > > >  #include "php.h"
> > > > @@ -1206,6 +1206,17 @@
> > > > /* fall through - we might be able to copy in smaller chunks */
> > > > }
> > > >  #endif
> > > > +
> > > > +   {
> > > > +   php_stream_statbuf sbuf;
> > > > +   if (php_stream_stat(src, &sbuf TSRMLS_CC) == 0) {
> > > > +   /* in the event that the source file is 0 bytes, 
>return 1 to indicate success
> > > > +* because opening the file to write had already 
>created a copy */
> > > > +   if (sbuf.sb.st_size == 0) {
> > > > +   return 1;
> > > > +   }
> > > > +   }
> > > > +   }
> > > >
> > > > while(1) {
> > > > readchunk = sizeof(buf);
> > > >
> > > >
> > > >
> > > > --
> > > > 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
> > >
> > >
> > >
> >
> >
> > --
> > 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: php4 /main streams.c

2003-02-15 Thread Moriyoshi Koizumi
So should I revert the patch on HEAD then?

Moriyoshi

Wez Furlong <[EMAIL PROTECTED]> wrote:

> Actually, the return values throughout that function are all bogus...
> Don't worry about reverting (for 4.3).
> I'll add this to my TODO for PHP 5.
> 
> --Wez.
> 
> On Sat, 15 Feb 2003, Wez Furlong wrote:
> 
> > This is a bogus patch; the return value of the php_stream_copy_to_XXX
> > functions are the number of bytes that were copied, and this patch
> > breaks that.
> >
> > The correct fix for #22234 is to fix php_copy_file() to handle a 0
> > return from this function.
> >
> > Please revert!
> >
> > --Wez.
> >
> > On Sat, 15 Feb 2003, Moriyoshi Koizumi wrote:
> >
> > > moriyoshi Sat Feb 15 14:56:13 2003 EDT
> > >
> > >   Modified files:
> > > /php4/mainstreams.c
> > >   Log:
> > >   Fixed bug #22234
> > >
> > >
> > > Index: php4/main/streams.c
> > > diff -u php4/main/streams.c:1.154 php4/main/streams.c:1.155
> > > --- php4/main/streams.c:1.154 Thu Feb 13 16:08:04 2003
> > > +++ php4/main/streams.c   Sat Feb 15 14:56:12 2003
> > > @@ -20,7 +20,7 @@
> > > +--+
> > >   */
> > >
> > > -/* $Id: streams.c,v 1.154 2003/02/13 21:08:04 wez Exp $ */
> > > +/* $Id: streams.c,v 1.155 2003/02/15 19:56:12 moriyoshi Exp $ */
> > >
> > >  #define _GNU_SOURCE
> > >  #include "php.h"
> > > @@ -1206,6 +1206,17 @@
> > >   /* fall through - we might be able to copy in smaller chunks */
> > >   }
> > >  #endif
> > > +
> > > + {
> > > + php_stream_statbuf sbuf;
> > > + if (php_stream_stat(src, &sbuf TSRMLS_CC) == 0) {
> > > + /* in the event that the source file is 0 bytes, return 1 to 
>indicate success
> > > +  * because opening the file to write had already created a 
>copy */
> > > + if (sbuf.sb.st_size == 0) {
> > > + return 1;
> > > + }
> > > + }
> > > + }
> > >
> > >   while(1) {
> > >   readchunk = sizeof(buf);
> > >
> > >
> > >
> > > --
> > > 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
> >
> >
> >
> 
> 
> -- 
> 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: php4 /main streams.c

2003-02-15 Thread Wez Furlong
Actually, the return values throughout that function are all bogus...
Don't worry about reverting (for 4.3).
I'll add this to my TODO for PHP 5.

--Wez.

On Sat, 15 Feb 2003, Wez Furlong wrote:

> This is a bogus patch; the return value of the php_stream_copy_to_XXX
> functions are the number of bytes that were copied, and this patch
> breaks that.
>
> The correct fix for #22234 is to fix php_copy_file() to handle a 0
> return from this function.
>
> Please revert!
>
> --Wez.
>
> On Sat, 15 Feb 2003, Moriyoshi Koizumi wrote:
>
> > moriyoshi   Sat Feb 15 14:56:13 2003 EDT
> >
> >   Modified files:
> > /php4/main  streams.c
> >   Log:
> >   Fixed bug #22234
> >
> >
> > Index: php4/main/streams.c
> > diff -u php4/main/streams.c:1.154 php4/main/streams.c:1.155
> > --- php4/main/streams.c:1.154   Thu Feb 13 16:08:04 2003
> > +++ php4/main/streams.c Sat Feb 15 14:56:12 2003
> > @@ -20,7 +20,7 @@
> > +--+
> >   */
> >
> > -/* $Id: streams.c,v 1.154 2003/02/13 21:08:04 wez Exp $ */
> > +/* $Id: streams.c,v 1.155 2003/02/15 19:56:12 moriyoshi Exp $ */
> >
> >  #define _GNU_SOURCE
> >  #include "php.h"
> > @@ -1206,6 +1206,17 @@
> > /* fall through - we might be able to copy in smaller chunks */
> > }
> >  #endif
> > +
> > +   {
> > +   php_stream_statbuf sbuf;
> > +   if (php_stream_stat(src, &sbuf TSRMLS_CC) == 0) {
> > +   /* in the event that the source file is 0 bytes, return 1 to 
>indicate success
> > +* because opening the file to write had already created a 
>copy */
> > +   if (sbuf.sb.st_size == 0) {
> > +   return 1;
> > +   }
> > +   }
> > +   }
> >
> > while(1) {
> > readchunk = sizeof(buf);
> >
> >
> >
> > --
> > 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
>
>
>


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2003-02-15 Thread Jani Taskinen
sniper  Sat Feb 15 15:42:50 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  BFN
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.91 php4/NEWS:1.1247.2.92
--- php4/NEWS:1.1247.2.91   Sat Feb 15 15:00:03 2003
+++ php4/NEWS   Sat Feb 15 15:42:49 2003
@@ -26,6 +26,7 @@
 - Fixed bug #4 (implode() changes object references in array). (Moriyoshi)
 - Fixed bug #22207 (e notation in *printf would be missing a 0 when there is
   no exponent). (Ilia)
+- Fixed bug #0 ("php_admin_value open_basedir none" does not work). (Jani)
 - Fixed bug #22191 (frontbase build broken with old version of frontbase). (Ilia)
 - Fixed bug #22187 (spprintf function did not handle floats correctly). (Ilia)
 - Fixed bug #22149 (incorrect insertion of session id when tabs are used to



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /main streams.c

2003-02-15 Thread Wez Furlong
This is a bogus patch; the return value of the php_stream_copy_to_XXX
functions are the number of bytes that were copied, and this patch
breaks that.

The correct fix for #22234 is to fix php_copy_file() to handle a 0
return from this function.

Please revert!

--Wez.

On Sat, 15 Feb 2003, Moriyoshi Koizumi wrote:

> moriyoshi Sat Feb 15 14:56:13 2003 EDT
>
>   Modified files:
> /php4/mainstreams.c
>   Log:
>   Fixed bug #22234
>
>
> Index: php4/main/streams.c
> diff -u php4/main/streams.c:1.154 php4/main/streams.c:1.155
> --- php4/main/streams.c:1.154 Thu Feb 13 16:08:04 2003
> +++ php4/main/streams.c   Sat Feb 15 14:56:12 2003
> @@ -20,7 +20,7 @@
> +--+
>   */
>
> -/* $Id: streams.c,v 1.154 2003/02/13 21:08:04 wez Exp $ */
> +/* $Id: streams.c,v 1.155 2003/02/15 19:56:12 moriyoshi Exp $ */
>
>  #define _GNU_SOURCE
>  #include "php.h"
> @@ -1206,6 +1206,17 @@
>   /* fall through - we might be able to copy in smaller chunks */
>   }
>  #endif
> +
> + {
> + php_stream_statbuf sbuf;
> + if (php_stream_stat(src, &sbuf TSRMLS_CC) == 0) {
> + /* in the event that the source file is 0 bytes, return 1 to 
>indicate success
> +  * because opening the file to write had already created a 
>copy */
> + if (sbuf.sb.st_size == 0) {
> + return 1;
> + }
> + }
> + }
>
>   while(1) {
>   readchunk = sizeof(buf);
>
>
>
> --
> 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: php4 /main main.c

2003-02-15 Thread Derick Rethans
On Sat, 15 Feb 2003, Jani Taskinen wrote:

> sniperSat Feb 15 15:22:20 2003 EDT
> 
>   Modified files:  
> /php4/mainmain.c 
>   Log:
>   - Fix unsetting of open_basedir, safe_mode_exec_dir and user_dir with
> "php_admin_value  none"
>   - Fixes bug #0  

MFH?

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /main main.c

2003-02-15 Thread Jani Taskinen
sniper  Sat Feb 15 15:23:13 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  main.c 
  Log:
  MFH: Fix for bug #0
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.512.2.9 php4/main/main.c:1.512.2.10
--- php4/main/main.c:1.512.2.9  Tue Jan 28 19:46:31 2003
+++ php4/main/main.cSat Feb 15 15:23:12 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.512.2.9 2003/01/29 00:46:31 phanto Exp $ */
+/* $Id: main.c,v 1.512.2.10 2003/02/15 20:23:12 sniper Exp $ */
 
 /* {{{ includes
  */
@@ -300,15 +300,15 @@
STD_PHP_INI_ENTRY("gpc_order",  "GPC",  
PHP_INI_ALL,OnUpdateStringUnempty,  gpc_order, 
 php_core_globals,   core_globals)
STD_PHP_INI_ENTRY("include_path",   PHP_INCLUDE_PATH,  
 PHP_INI_ALL,OnUpdateStringUnempty,  include_path, 
  php_core_globals,   core_globals)
PHP_INI_ENTRY("max_execution_time", "30",   
PHP_INI_ALL,OnUpdateTimeout)
-   STD_PHP_INI_ENTRY("open_basedir",   NULL,   
PHP_INI_SYSTEM, OnUpdateStringUnempty,  open_basedir,   
php_core_globals,   core_globals)
-   STD_PHP_INI_ENTRY("safe_mode_exec_dir", "1",
PHP_INI_SYSTEM, OnUpdateString, safe_mode_exec_dir,
 php_core_globals,   core_globals)
+   STD_PHP_INI_ENTRY("open_basedir",   NULL,   
+PHP_INI_SYSTEM, OnUpdateString, open_basedir, 
+  php_core_globals,   core_globals)
+   STD_PHP_INI_ENTRY("safe_mode_exec_dir", "", 
+PHP_INI_SYSTEM, OnUpdateString, safe_mode_exec_dir,   
+  php_core_globals,   core_globals)
 
STD_PHP_INI_BOOLEAN("file_uploads", "1",
PHP_INI_SYSTEM, OnUpdateBool,   file_uploads,  
 php_core_globals,   core_globals)
STD_PHP_INI_ENTRY("upload_max_filesize","2M",   
PHP_INI_SYSTEM|PHP_INI_PERDIR,  OnUpdateInt,
upload_max_filesize,php_core_globals,   core_globals)
STD_PHP_INI_ENTRY("post_max_size",  "8M",   
PHP_INI_SYSTEM|PHP_INI_PERDIR,  OnUpdateInt,post_max_size, 
 sapi_globals_struct,sapi_globals)
STD_PHP_INI_ENTRY("upload_tmp_dir", NULL,   
PHP_INI_SYSTEM, OnUpdateStringUnempty,  upload_tmp_dir, 
php_core_globals,   core_globals)
 
-   STD_PHP_INI_ENTRY("user_dir",   NULL,   
PHP_INI_SYSTEM, OnUpdateStringUnempty,  user_dir,  
 php_core_globals,   core_globals)
+   STD_PHP_INI_ENTRY("user_dir",   NULL,   
+PHP_INI_SYSTEM, OnUpdateString, user_dir, 
+  php_core_globals,   core_globals)
STD_PHP_INI_ENTRY("variables_order",NULL,   PHP_INI_ALL,   
 OnUpdateStringUnempty,  variables_order,php_core_globals, 
  core_globals)
 
STD_PHP_INI_ENTRY("error_append_string",NULL,   PHP_INI_ALL,   
 OnUpdateString, error_append_string,php_core_globals, 
  core_globals)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /main main.c

2003-02-15 Thread Jani Taskinen
sniper  Sat Feb 15 15:22:20 2003 EDT

  Modified files:  
/php4/main  main.c 
  Log:
  - Fix unsetting of open_basedir, safe_mode_exec_dir and user_dir with
"php_admin_value  none"
  - Fixes bug #0  
  
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.524 php4/main/main.c:1.525
--- php4/main/main.c:1.524  Tue Jan 28 19:47:31 2003
+++ php4/main/main.cSat Feb 15 15:22:19 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.524 2003/01/29 00:47:31 phanto Exp $ */
+/* $Id: main.c,v 1.525 2003/02/15 20:22:19 sniper Exp $ */
 
 /* {{{ includes
  */
@@ -301,15 +301,15 @@
STD_PHP_INI_ENTRY("gpc_order",  "GPC",  
PHP_INI_ALL,OnUpdateStringUnempty,  gpc_order, 
 php_core_globals,   core_globals)
STD_PHP_INI_ENTRY("include_path",   PHP_INCLUDE_PATH,  
 PHP_INI_ALL,OnUpdateStringUnempty,  include_path, 
  php_core_globals,   core_globals)
PHP_INI_ENTRY("max_execution_time", "30",   
PHP_INI_ALL,OnUpdateTimeout)
-   STD_PHP_INI_ENTRY("open_basedir",   NULL,   
PHP_INI_SYSTEM, OnUpdateStringUnempty,  open_basedir,   
php_core_globals,   core_globals)
-   STD_PHP_INI_ENTRY("safe_mode_exec_dir", "1",
PHP_INI_SYSTEM, OnUpdateString, safe_mode_exec_dir,
 php_core_globals,   core_globals)
+   STD_PHP_INI_ENTRY("open_basedir",   NULL,   
+PHP_INI_SYSTEM, OnUpdateString, open_basedir, 
+  php_core_globals,   core_globals)
+   STD_PHP_INI_ENTRY("safe_mode_exec_dir", "", 
+PHP_INI_SYSTEM, OnUpdateString, safe_mode_exec_dir,   
+  php_core_globals,   core_globals)
 
STD_PHP_INI_BOOLEAN("file_uploads", "1",
PHP_INI_SYSTEM, OnUpdateBool,   file_uploads,  
 php_core_globals,   core_globals)
STD_PHP_INI_ENTRY("upload_max_filesize","2M",   
PHP_INI_SYSTEM|PHP_INI_PERDIR,  OnUpdateInt,
upload_max_filesize,php_core_globals,   core_globals)
STD_PHP_INI_ENTRY("post_max_size",  "8M",   
PHP_INI_SYSTEM|PHP_INI_PERDIR,  OnUpdateInt,post_max_size, 
 sapi_globals_struct,sapi_globals)
STD_PHP_INI_ENTRY("upload_tmp_dir", NULL,   
PHP_INI_SYSTEM, OnUpdateStringUnempty,  upload_tmp_dir, 
php_core_globals,   core_globals)
 
-   STD_PHP_INI_ENTRY("user_dir",   NULL,   
PHP_INI_SYSTEM, OnUpdateStringUnempty,  user_dir,  
 php_core_globals,   core_globals)
+   STD_PHP_INI_ENTRY("user_dir",   NULL,   
+PHP_INI_SYSTEM, OnUpdateString, user_dir, 
+  php_core_globals,   core_globals)
STD_PHP_INI_ENTRY("variables_order",NULL,   PHP_INI_ALL,   
 OnUpdateStringUnempty,  variables_order,php_core_globals, 
  core_globals)
 
STD_PHP_INI_ENTRY("error_append_string",NULL,   PHP_INI_ALL,   
 OnUpdateString, error_append_string,php_core_globals, 
  core_globals)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/mysqli config.m4

2003-02-15 Thread Ilia Alshanetsky
iliaa   Sat Feb 15 15:09:49 2003 EDT

  Modified files:  
/php4/ext/mysqliconfig.m4 
  Log:
  Proper lib detection.
  
  
Index: php4/ext/mysqli/config.m4
diff -u php4/ext/mysqli/config.m4:1.1 php4/ext/mysqli/config.m4:1.2
--- php4/ext/mysqli/config.m4:1.1   Wed Feb 12 11:24:41 2003
+++ php4/ext/mysqli/config.m4   Sat Feb 15 15:09:49 2003
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.1 2003/02/12 16:24:41 derick Exp $
+dnl $Id: config.m4,v 1.2 2003/02/15 20:09:49 iliaa Exp $
 dnl config.m4 for extension mysqli
 
 dnl Comments in this file start with the string 'dnl'.
@@ -50,7 +50,7 @@
   ],[
 AC_MSG_ERROR([wrong mysql library version or lib not found])
   ],[
--L$MYSQLI_DIR -lm -ldl
+`$PHP_MYSQLI/bin/mysql_config --libs | sed -e "s/'//g"`
   ])
   PHP_SUBST(MYSQLI_SHARED_LIBADD)
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2003-02-15 Thread Moriyoshi Koizumi
moriyoshi   Sat Feb 15 15:00:05 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  B.F.N.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.90 php4/NEWS:1.1247.2.91
--- php4/NEWS:1.1247.2.90   Sat Feb 15 11:00:20 2003
+++ php4/NEWS   Sat Feb 15 15:00:03 2003
@@ -20,6 +20,7 @@
 - Added improved JPEG 2000 support for getimagesize(). (Marcus, Adam Wright)
 - Added XBM and WBMP support for getimagesize(). (Marcus)
 - Fixed several errors in hwapi extension. Objects weren't handled properly. (Uwe)
+- Fixed bug #22234 (copy() fails if source file has 0 length). (Moriyoshi)
 - Fixed bug #7 (printf() field limiters broke between 4.2.3 and 4.3.0).
   (Moriyoshi)
 - Fixed bug #4 (implode() changes object references in array). (Moriyoshi)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /main streams.c

2003-02-15 Thread Moriyoshi Koizumi
moriyoshi   Sat Feb 15 14:59:27 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  streams.c 
  Log:
  MFH(r1.155): Fixed bug #22234
  
  
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.125.2.30 php4/main/streams.c:1.125.2.31
--- php4/main/streams.c:1.125.2.30  Thu Feb 13 16:03:25 2003
+++ php4/main/streams.c Sat Feb 15 14:59:26 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.125.2.30 2003/02/13 21:03:25 wez Exp $ */
+/* $Id: streams.c,v 1.125.2.31 2003/02/15 19:59:26 moriyoshi Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -1200,6 +1200,17 @@
/* fall through - we might be able to copy in smaller chunks */
}
 #endif
+
+   {
+   php_stream_statbuf sbuf;
+   if (php_stream_stat(src, &sbuf TSRMLS_CC) == 0) {
+   /* in the event that the source file is 0 bytes, return 1 to 
+indicate success
+* because opening the file to write had already created a 
+copy */
+   if (sbuf.sb.st_size == 0) {
+   return 1;
+   }
+   }
+   }
 
while(1) {
readchunk = sizeof(buf);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /main streams.c

2003-02-15 Thread Moriyoshi Koizumi
moriyoshi   Sat Feb 15 14:56:13 2003 EDT

  Modified files:  
/php4/main  streams.c 
  Log:
  Fixed bug #22234
  
  
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.154 php4/main/streams.c:1.155
--- php4/main/streams.c:1.154   Thu Feb 13 16:08:04 2003
+++ php4/main/streams.c Sat Feb 15 14:56:12 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.154 2003/02/13 21:08:04 wez Exp $ */
+/* $Id: streams.c,v 1.155 2003/02/15 19:56:12 moriyoshi Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -1206,6 +1206,17 @@
/* fall through - we might be able to copy in smaller chunks */
}
 #endif
+
+   {
+   php_stream_statbuf sbuf;
+   if (php_stream_stat(src, &sbuf TSRMLS_CC) == 0) {
+   /* in the event that the source file is 0 bytes, return 1 to 
+indicate success
+* because opening the file to write had already created a 
+copy */
+   if (sbuf.sb.st_size == 0) {
+   return 1;
+   }
+   }
+   }
 
while(1) {
readchunk = sizeof(buf);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 / run-tests.php

2003-02-15 Thread Wez Furlong
wez Sat Feb 15 13:09:52 2003 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
  If a test does not have any data after 60 seconds of waiting, assume that
  it died a horrible death and kill it.
  This is useful on windows when a message box is popped-up during an automated
  test-run.
  
  
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.142 php4/run-tests.php:1.143
--- php4/run-tests.php:1.142Mon Feb  3 07:14:13 2003
+++ php4/run-tests.php  Sat Feb 15 13:09:52 2003
@@ -516,6 +516,40 @@
}
 }
 
+function system_with_timeout($commandline)
+{
+   $data = "";
+   
+   $proc = proc_open($commandline, array(1 => array('pipe', 'w')), $pipes);
+
+   if (!$proc)
+   return false;
+
+   while (true) {
+   /* hide errors from interrupted syscalls */
+   $r = $pipes;
+   $w = null;
+   $e = null;
+   $n = stream_select($r, $w, $e, 60);
+
+   if ($n == 0) {
+   /* timed out */
+   $data .= "\n ** ERROR: process timed out **\n";
+   proc_terminate($proc);
+   return $data;
+   } else if ($n) {
+   $line = fgets($pipes[1]);
+   if ($line === false) {
+   /* EOF */
+   break;
+   }
+   $data .= $line;
+   }
+   }
+   $code = proc_close($proc);
+   return $data;
+}
+
 //
 //  Run an individual test case.
 //
@@ -667,7 +701,8 @@
 COMMAND $cmd
 ";
 
-   $out = `$cmd`;
+// $out = `$cmd`;
+   $out = system_with_timeout($cmd);
 
@unlink($tmp_post);
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4(PHP_4_3) /sapi/apache2handler .cvsignoreCREDITS README apache_config.c config.m4 php.sym php4apache2.dsp php_apache.hphp_functions.c sapi_apache2.c

2003-02-15 Thread Jani Taskinen

After short discussion, the #php.bugs mob decided
that we don't want this in PHP_4_3 branch. At least
as long as it doesn't work as well (or preferrably better :)
than the apache2filter SAPI does.

So please remove it from the branch for now..

--Jani


On Sat, 15 Feb 2003, Ian Holsman wrote:

>ianh   Sat Feb 15 00:49:31 2003 EDT
>
>  Added files: (Branch: PHP_4_3)
>/php4/sapi/apache2handler  .cvsignore CREDITS README apache_config.c 
>   config.m4 php.sym php4apache2.dsp 
>   php_apache.h php_functions.c 
>   sapi_apache2.c 
>  Log:
>  alternate apache2 SAPI.
>  
>  

-- 
<- For Sale! ->


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/standard proc_open.c

2003-02-15 Thread Wez Furlong
wez Sat Feb 15 12:33:11 2003 EDT

  Modified files:  
/php4/ext/standard  proc_open.c 
  Log:
  Add optional signal parameter to proc_terminate.
  
  
Index: php4/ext/standard/proc_open.c
diff -u php4/ext/standard/proc_open.c:1.4 php4/ext/standard/proc_open.c:1.5
--- php4/ext/standard/proc_open.c:1.4   Sat Feb 15 12:18:57 2003
+++ php4/ext/standard/proc_open.c   Sat Feb 15 12:33:11 2003
@@ -15,7 +15,7 @@
| Author: Wez Furlong <[EMAIL PROTECTED]>   |
+--+
  */
-/* $Id: proc_open.c,v 1.4 2003/02/15 17:18:57 wez Exp $ */
+/* $Id: proc_open.c,v 1.5 2003/02/15 17:33:11 wez Exp $ */
 
 #include 
 #include "php.h"
@@ -175,14 +175,15 @@
 }
 
 
-/* {{{ proto int proc_terminate(resource process)
+/* {{{ proto int proc_terminate(resource process [, long signal])
kill a process opened by proc_open */
 PHP_FUNCTION(proc_terminate)
 {
zval *zproc;
struct php_process_handle *proc;
+   long sig_no = SIGTERM;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &zproc, &sig_no) 
+== FAILURE) {
RETURN_FALSE;
}
 
@@ -191,7 +192,7 @@
 #ifdef PHP_WIN32
TerminateProcess(proc->child, 255);
 #else
-   kill(proc->child, SIGTERM);
+   kill(proc->child, sig_no);
 #endif

zend_list_delete(Z_LVAL_P(zproc));



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/standard basic_functions.c exec.h proc_open.c

2003-02-15 Thread Wez Furlong
wez Sat Feb 15 12:18:57 2003 EDT

  Modified files:  
/php4/ext/standard  exec.h proc_open.c basic_functions.c 
  Log:
  Add proc_terminate() function to forcibly kill off a process created
  with proc_open().
  
  
Index: php4/ext/standard/exec.h
diff -u php4/ext/standard/exec.h:1.17 php4/ext/standard/exec.h:1.18
--- php4/ext/standard/exec.h:1.17   Wed Jan 15 13:54:03 2003
+++ php4/ext/standard/exec.hSat Feb 15 12:18:57 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: exec.h,v 1.17 2003/01/15 18:54:03 wez Exp $ */
+/* $Id: exec.h,v 1.18 2003/02/15 17:18:57 wez Exp $ */
 
 #ifndef EXEC_H
 #define EXEC_H
@@ -30,6 +30,7 @@
 PHP_FUNCTION(proc_open);
 PHP_FUNCTION(proc_get_status);
 PHP_FUNCTION(proc_close);
+PHP_FUNCTION(proc_terminate);
 PHP_MINIT_FUNCTION(proc_open);
 
 char *php_escape_shell_cmd(char *);
Index: php4/ext/standard/proc_open.c
diff -u php4/ext/standard/proc_open.c:1.3 php4/ext/standard/proc_open.c:1.4
--- php4/ext/standard/proc_open.c:1.3   Fri Jan 24 11:45:34 2003
+++ php4/ext/standard/proc_open.c   Sat Feb 15 12:18:57 2003
@@ -15,7 +15,7 @@
| Author: Wez Furlong <[EMAIL PROTECTED]>   |
+--+
  */
-/* $Id: proc_open.c,v 1.3 2003/01/24 16:45:34 iliaa Exp $ */
+/* $Id: proc_open.c,v 1.4 2003/02/15 17:18:57 wez Exp $ */
 
 #include 
 #include "php.h"
@@ -173,6 +173,32 @@
le_proc_open = zend_register_list_destructors_ex(proc_open_rsrc_dtor, NULL, 
"process", module_number);
return SUCCESS;
 }
+
+
+/* {{{ proto int proc_terminate(resource process)
+   kill a process opened by proc_open */
+PHP_FUNCTION(proc_terminate)
+{
+   zval *zproc;
+   struct php_process_handle *proc;
+   
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zproc) == FAILURE) {
+   RETURN_FALSE;
+   }
+
+   ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, &zproc, -1, "process", 
+le_proc_open);
+   
+#ifdef PHP_WIN32
+   TerminateProcess(proc->child, 255);
+#else
+   kill(proc->child, SIGTERM);
+#endif
+   
+   zend_list_delete(Z_LVAL_P(zproc));
+   RETURN_LONG(FG(pclose_ret));
+}
+/* }}} */
+
 
 /* {{{ proto int proc_close(resource process)
close a process opened by proc_open */
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.577 
php4/ext/standard/basic_functions.c:1.578
--- php4/ext/standard/basic_functions.c:1.577   Tue Feb 11 17:47:26 2003
+++ php4/ext/standard/basic_functions.c Sat Feb 15 12:18:57 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.577 2003/02/11 22:47:26 iliaa Exp $ */
+/* $Id: basic_functions.c,v 1.578 2003/02/15 17:18:57 wez Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -419,6 +419,7 @@
 #ifdef PHP_CAN_SUPPORT_PROC_OPEN
PHP_FE(proc_open,   third_arg_force_ref)
PHP_FE(proc_close, 
 NULL)
+   PHP_FE(proc_terminate, 
+ NULL)
PHP_FE(proc_get_status,
 NULL)
 #endif
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/mysqli/tests 014.phpt

2003-02-15 Thread Ilia Alshanetsky
iliaa   Sat Feb 15 12:06:35 2003 EDT

  Modified files:  
/php4/ext/mysqli/tests  014.phpt 
  Log:
  Fixed skip condition.
  
  
Index: php4/ext/mysqli/tests/014.phpt
diff -u php4/ext/mysqli/tests/014.phpt:1.2 php4/ext/mysqli/tests/014.phpt:1.3
--- php4/ext/mysqli/tests/014.phpt:1.2  Sat Feb 15 11:21:35 2003
+++ php4/ext/mysqli/tests/014.phpt  Sat Feb 15 12:06:35 2003
@@ -9,7 +9,7 @@
mysqli_free_result($result);
mysqli_close($link);

-   if ($row[1] == "NO") {
+   if ($row[1] == "DISABLED") {
printf ("skip innodb support not installed.");
}
 ?>



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/mysqli/tests 014.phpt 015.phpt

2003-02-15 Thread Georg Richter
georg   Sat Feb 15 11:21:35 2003 EDT

  Modified files:  
/php4/ext/mysqli/tests  014.phpt 015.phpt 
  Log:
  added skipif section (innodb-support) 
  
  
Index: php4/ext/mysqli/tests/014.phpt
diff -u php4/ext/mysqli/tests/014.phpt:1.1 php4/ext/mysqli/tests/014.phpt:1.2
--- php4/ext/mysqli/tests/014.phpt:1.1  Tue Feb 11 19:46:29 2003
+++ php4/ext/mysqli/tests/014.phpt  Sat Feb 15 11:21:35 2003
@@ -1,10 +1,21 @@
 --TEST--
 mysqli autocommit/commit/rollback 
+--SKIPIF--
+
 --FILE--
 
 --FILE--
 http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2003-02-15 Thread Moriyoshi Koizumi
moriyoshi   Sat Feb 15 11:00:22 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  B.F.N.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.89 php4/NEWS:1.1247.2.90
--- php4/NEWS:1.1247.2.89   Sat Feb 15 10:16:58 2003
+++ php4/NEWS   Sat Feb 15 11:00:20 2003
@@ -20,6 +20,8 @@
 - Added improved JPEG 2000 support for getimagesize(). (Marcus, Adam Wright)
 - Added XBM and WBMP support for getimagesize(). (Marcus)
 - Fixed several errors in hwapi extension. Objects weren't handled properly. (Uwe)
+- Fixed bug #7 (printf() field limiters broke between 4.2.3 and 4.3.0).
+  (Moriyoshi)
 - Fixed bug #4 (implode() changes object references in array). (Moriyoshi)
 - Fixed bug #22207 (e notation in *printf would be missing a 0 when there is
   no exponent). (Ilia)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /ext/standard formatted_print.c /ext/standard/tests/strings bug22227.phpt

2003-02-15 Thread Moriyoshi Koizumi
moriyoshi   Sat Feb 15 10:59:13 2003 EDT

  Added files: (Branch: PHP_4_3)
/php4/ext/standard/tests/stringsbug7.phpt 

  Modified files:  
/php4/ext/standard  formatted_print.c 
  Log:
  MFH(r1.65): Fixed bug #7
  MFH: Added test case for bug #7
  
  
Index: php4/ext/standard/formatted_print.c
diff -u php4/ext/standard/formatted_print.c:1.59.2.2 
php4/ext/standard/formatted_print.c:1.59.2.3
--- php4/ext/standard/formatted_print.c:1.59.2.2Thu Feb 13 12:26:02 2003
+++ php4/ext/standard/formatted_print.c Sat Feb 15 10:59:13 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: formatted_print.c,v 1.59.2.2 2003/02/13 17:26:02 iliaa Exp $ */
+/* $Id: formatted_print.c,v 1.59.2.3 2003/02/15 15:59:13 moriyoshi Exp $ */
 
 #include   /* modf() */
 #include "php.h"
@@ -158,12 +158,11 @@
   int alignment, int len, int sign, 
int expprec)
 {
register int npad;
+   int req_size;
+   int copy_len;
 
-   if (max_width && min_width) {
-   expprec = max_width = 0;
-   }
-
-   npad = min_width - MIN(len, (expprec ? max_width : len));
+   copy_len = (expprec ? MIN(max_width, len) : len);
+   npad = min_width - copy_len;
 
if (npad < 0) {
npad = 0;
@@ -171,11 +170,11 @@

PRINTF_DEBUG(("sprintf: appendstring(%x, %d, %d, \"%s\", %d, '%c', %d)\n",
  *buffer, *pos, *size, add, min_width, padding, 
alignment));
-   if ((max_width == 0) && (! expprec)) {
-   max_width = MAX(min_width, len);
-   }
-   if ((*pos + max_width) >= *size) {
-   while ((*pos + max_width) >= *size) {
+
+   req_size = *pos + MAX(min_width, copy_len) + 1;
+
+   if (req_size > *size) {
+   while (req_size > *size) {
*size <<= 1;
}
PRINTF_DEBUG(("sprintf ereallocing buffer to %d bytes\n", *size));
@@ -192,8 +191,8 @@
}
}
PRINTF_DEBUG(("sprintf: appending \"%s\"\n", add));
-   memcpy(&(*buffer)[*pos], add, MIN(max_width, len)+1);
-   *pos += MIN(max_width, len);
+   memcpy(&(*buffer)[*pos], add, copy_len + 1);
+   *pos += copy_len;
if (alignment == ALIGN_LEFT) {
while (npad--) {
(*buffer)[(*pos)++] = padding;

Index: php4/ext/standard/tests/strings/bug7.phpt
+++ php4/ext/standard/tests/strings/bug7.phpt
--TEST--
Bug #7 (printf() field limiters broke between 4.2.3 and 4.3.0)
--FILE--

--EXPECT--
abc



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/standard formatted_print.c /ext/standard/tests/strings bug22227.phpt

2003-02-15 Thread Moriyoshi Koizumi
moriyoshi   Sat Feb 15 10:57:31 2003 EDT

  Added files: 
/php4/ext/standard/tests/stringsbug7.phpt 

  Modified files:  
/php4/ext/standard  formatted_print.c 
  Log:
  Fixed bug #7
  Added test case for bug #7
  
  
Index: php4/ext/standard/formatted_print.c
diff -u php4/ext/standard/formatted_print.c:1.64 
php4/ext/standard/formatted_print.c:1.65
--- php4/ext/standard/formatted_print.c:1.64Thu Feb 13 12:25:31 2003
+++ php4/ext/standard/formatted_print.c Sat Feb 15 10:57:31 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: formatted_print.c,v 1.64 2003/02/13 17:25:31 iliaa Exp $ */
+/* $Id: formatted_print.c,v 1.65 2003/02/15 15:57:31 moriyoshi Exp $ */
 
 #include   /* modf() */
 #include "php.h"
@@ -158,12 +158,11 @@
   int alignment, int len, int sign, 
int expprec)
 {
register int npad;
+   int req_size;
+   int copy_len;
 
-   if (max_width && min_width) {
-   expprec = max_width = 0;
-   }
-
-   npad = min_width - MIN(len, (expprec ? max_width : len));
+   copy_len = (expprec ? MIN(max_width, len) : len);
+   npad = min_width - copy_len;
 
if (npad < 0) {
npad = 0;
@@ -171,11 +170,11 @@

PRINTF_DEBUG(("sprintf: appendstring(%x, %d, %d, \"%s\", %d, '%c', %d)\n",
  *buffer, *pos, *size, add, min_width, padding, 
alignment));
-   if ((max_width == 0) && (! expprec)) {
-   max_width = MAX(min_width, len);
-   }
-   if ((*pos + max_width) >= *size) {
-   while ((*pos + max_width) >= *size) {
+
+   req_size = *pos + MAX(min_width, copy_len) + 1;
+
+   if (req_size > *size) {
+   while (req_size > *size) {
*size <<= 1;
}
PRINTF_DEBUG(("sprintf ereallocing buffer to %d bytes\n", *size));
@@ -192,8 +191,8 @@
}
}
PRINTF_DEBUG(("sprintf: appending \"%s\"\n", add));
-   memcpy(&(*buffer)[*pos], add, MIN(max_width, len)+1);
-   *pos += MIN(max_width, len);
+   memcpy(&(*buffer)[*pos], add, copy_len + 1);
+   *pos += copy_len;
if (alignment == ALIGN_LEFT) {
while (npad--) {
(*buffer)[(*pos)++] = padding;

Index: php4/ext/standard/tests/strings/bug7.phpt
+++ php4/ext/standard/tests/strings/bug7.phpt
--TEST--
Bug #7 (printf() field limiters broke between 4.2.3 and 4.3.0)
--FILE--

--EXPECT--
abc



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /sapi/cli php_cli.c

2003-02-15 Thread Marcus Boerger
helly   Sat Feb 15 10:20:17 2003 EDT

  Modified files:  
/php4/sapi/cli  php_cli.c 
  Log:
  fix parameter string (-R & -H)
  
Index: php4/sapi/cli/php_cli.c
diff -u php4/sapi/cli/php_cli.c:1.69 php4/sapi/cli/php_cli.c:1.70
--- php4/sapi/cli/php_cli.c:1.69Tue Feb 11 15:34:24 2003
+++ php4/sapi/cli/php_cli.c Sat Feb 15 10:20:17 2003
@@ -87,7 +87,7 @@
 extern char *ap_php_optarg;
 extern int ap_php_optind;
 
-#define OPTSTRING "aB:Cc:d:E:eF:f:g:hilmnqRH:r:sw?vz"
+#define OPTSTRING "aB:Cc:d:E:eF:f:g:hilmnqR:Hr:sw?vz"
 
 static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC)
 {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) / NEWS

2003-02-15 Thread Wez Furlong
wez Sat Feb 15 10:16:58 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   NEWS 
  Log:
  bug fixed.
  
  
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.88 php4/NEWS:1.1247.2.89
--- php4/NEWS:1.1247.2.88   Fri Feb 14 14:48:57 2003
+++ php4/NEWS   Sat Feb 15 10:16:58 2003
@@ -43,6 +43,7 @@
 - Fixed bug #21998 (array_pop() did not reset the current array position). (Jani)
 - Fixed bug #21815 (fpassthru() ignored buffered data but complained anyway). 
   (Wez)
+- Fixed bug #21809 (select would not always timeout during socket shutdown). (Wez)
 - Fixed bug #21725 (return behaviour differs between include and require). (Zeev)
 - Fixed bug #21597 (made glob() understand Windows paths). (Edin)
 - Fixed bug #21549 (problem with Ingres II persistent connections). (Jani)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /tests/lang bug22231.phpt

2003-02-15 Thread Moriyoshi Koizumi
moriyoshi   Sat Feb 15 10:15:45 2003 EDT

  Added files: (Branch: PHP_4_3)
/php4/tests/langbug22231.phpt 
  Log:
  MFH: added test case for bug #22231
  
  

Index: php4/tests/lang/bug22231.phpt
+++ php4/tests/lang/bug22231.phpt
--TEST--
Bug #22231 (segfault when returning a global variable by reference)
--FILE--
fubar);
unset($bar);
$bar = &foo();
var_dump($bar->fubar);

$foo = &foo();
var_dump($foo);
var_dump($foo->fubar);
unset($foo);
$foo = &foo();
var_dump($foo->fubar);
?>
--EXPECT--
object(foo)(1) {
  ["fubar"]=>
  string(5) "fubar"
}
string(5) "fubar"
string(5) "fubar"
object(foo)(1) {
  ["fubar"]=>
  string(5) "fubar"
}
string(5) "fubar"
string(5) "fubar"



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /tests/lang bug22231.phpt

2003-02-15 Thread Moriyoshi Koizumi
moriyoshi   Sat Feb 15 10:15:14 2003 EDT

  Added files: 
/php4/tests/langbug22231.phpt 
  Log:
  Added test case for bug #22231
  
  

Index: php4/tests/lang/bug22231.phpt
+++ php4/tests/lang/bug22231.phpt
--TEST--
Bug #22231 (segfault when returning a global variable by reference)
--FILE--
fubar);
unset($bar);
$bar = &foo();
var_dump($bar->fubar);

$foo = &foo();
var_dump($foo);
var_dump($foo->fubar);
unset($foo);
$foo = &foo();
var_dump($foo->fubar);
?>
--EXPECT--
object(foo)(1) {
  ["fubar"]=>
  string(5) "fubar"
}
string(5) "fubar"
string(5) "fubar"
object(foo)(1) {
  ["fubar"]=>
  string(5) "fubar"
}
string(5) "fubar"
string(5) "fubar"



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /main network.c

2003-02-15 Thread Wez Furlong
wez Sat Feb 15 10:11:57 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  network.c 
  Log:
  MFH: Fix for Bug #21809 (select() never times out during socket shutdown)
  
  
Index: php4/main/network.c
diff -u php4/main/network.c:1.83.2.2 php4/main/network.c:1.83.2.3
--- php4/main/network.c:1.83.2.2Tue Dec 31 11:26:11 2002
+++ php4/main/network.c Sat Feb 15 10:11:57 2003
@@ -16,7 +16,7 @@
| Streams work by Wez Furlong <[EMAIL PROTECTED]>   |
+--+
  */
-/* $Id: network.c,v 1.83.2.2 2002/12/31 16:26:11 sebastian Exp $ */
+/* $Id: network.c,v 1.83.2.3 2003/02/15 15:11:57 wez Exp $ */
 
 /*#define DEBUG_MAIN_NETWORK 1*/
 
@@ -599,6 +599,7 @@
 
sock->is_blocked = 1;
sock->timeout.tv_sec = FG(default_socket_timeout);
+   sock->timeout.tv_usec = 0;
sock->socket = socket;
 
stream = php_stream_alloc_rel(&php_stream_socket_ops, sock, persistent_id, 
"r+");
@@ -974,6 +975,7 @@
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
fd_set wrfds, efds;
int n;
+   struct timeval timeout;
 
if (close_handle) {
 #if HAVE_OPENSSL_EXT
@@ -990,13 +992,21 @@
/* prevent more data from coming in */
shutdown(sock->socket, SHUT_RD);
 
-   /* make sure that the OS sends all data before we close the connection 
*/
+   /* try to make sure that the OS sends all data before we close the 
+connection.
+* Essentially, we are waiting for the socket to become writeable, 
+which means
+* that all pending data has been sent.
+* We use a small timeout which should encourage the OS to send the 
+data,
+* but at the same time avoid hanging indefintely.
+* */
do {
FD_ZERO(&wrfds);
FD_SET(sock->socket, &wrfds);
efds = wrfds;
+
+   timeout.tv_sec = 0;
+   timeout.tv_usec = 5000; /* arbitrary */

-   n = select(sock->socket + 1, NULL, &wrfds, &efds, NULL);
+   n = select(sock->socket + 1, NULL, &wrfds, &efds, &timeout);
} while (n == -1 && php_socket_errno() == EINTR);

closesocket(sock->socket);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4(PHP_4_3) /sapi/cgi cgi_main.c

2003-02-15 Thread Edin Kadribasic
edink   Sat Feb 15 08:26:05 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/sapi/cgi  cgi_main.c 
  Log:
  Option -b needs an argument. This fixes #9.
  # Note -b still seems to be broken:
  # sapi/cgi/php -b   
  # Status: 404
  # Content-type: text/html
  # X-Powered-By: PHP/4.3.1-dev
  #
  # No input file specified.
  
  
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.190.2.15 php4/sapi/cgi/cgi_main.c:1.190.2.16
--- php4/sapi/cgi/cgi_main.c:1.190.2.15 Fri Feb 14 09:38:01 2003
+++ php4/sapi/cgi/cgi_main.cSat Feb 15 08:26:05 2003
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: cgi_main.c,v 1.190.2.15 2003/02/14 14:38:01 sniper Exp $ */
+/* $Id: cgi_main.c,v 1.190.2.16 2003/02/15 13:26:05 edink Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -138,7 +138,7 @@
 #define TRANSLATE_SLASHES(path)
 #endif
 
-#define OPTSTRING "abCc:d:ef:g:hilmnqsw?vz:"
+#define OPTSTRING "ab:Cc:d:ef:g:hilmnqsw?vz:"
 
 static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC)
 {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php