[PHP-CVS] cvs: php4 /ext/domxml php_domxml.c

2002-12-09 Thread Christian Stocker
chregu  Mon Dec  9 03:14:16 2002 EDT

  Modified files:  
/php4/ext/domxmlphp_domxml.c 
  Log:
  PHP_FALIAS for doc_get_elements_by_tagname got lost 
  
  
Index: php4/ext/domxml/php_domxml.c
diff -u php4/ext/domxml/php_domxml.c:1.226 php4/ext/domxml/php_domxml.c:1.227
--- php4/ext/domxml/php_domxml.c:1.226  Thu Dec  5 16:50:21 2002
+++ php4/ext/domxml/php_domxml.cMon Dec  9 03:14:15 2002
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_domxml.c,v 1.226 2002/12/05 21:50:21 helly Exp $ */
+/* $Id: php_domxml.c,v 1.227 2002/12/09 08:14:15 chregu Exp $ */
 
 /* TODO
  * - Support Notation Nodes
@@ -317,6 +317,7 @@
PHP_FALIAS(create_cdata_section,domxml_doc_create_cdata_section,   
 NULL)
PHP_FALIAS(create_entity_reference, domxml_doc_create_entity_reference,
 NULL)
PHP_FALIAS(create_processing_instruction,   
domxml_doc_create_processing_instruction,   NULL)
+   PHP_FALIAS(get_elements_by_tagname, domxml_doc_get_elements_by_tagname,
+ NULL)
PHP_FALIAS(get_element_by_id,   domxml_doc_get_element_by_id,   NULL)
/* Everything below this comment is none DOM compliant */
/* children is deprecated because it is inherited from DomNode */



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




Re: [PHP-CVS] cvs: php4 /ext/sybase_ct php_sybase_ct.c

2002-12-09 Thread Markus Fischer
Make a separate checkout in an empty directory and try this:

cvs co -r PHP_4_3 php4/ext/sybase_ct/php_sybase_ct.c

On Sun, Dec 08, 2002 at 04:01:32PM +0100, Timm Friebe wrote : 
 On Sun, 2002-12-08 at 10:28, Jani Taskinen wrote:
  MFH??
  
  --Jani
 
 I'm sorry, I've tried the following:
 
 $ cvs update -j PHP_4_3 ext/sybase_ct/php_sybase_ct.c
   doesn't do anything, nor does:
 $ cvs update -j PHP_4_3 -j 1.74 ext/sybase_ct/php_sybase_ct.c
 
 Then again:
 $ cvs update -j 1.74 -j PHP_4_3 ext/sybase_ct/php_sybase_ct.c
   wants to remove php_sybase_ct.c
 
 cvs server: scheduling ext/sybase_ct/php_sybase_ct.c for removal
 $ cvs status -v ext/sybase_ct/php_sybase_ct.c
 ===
 File: no file php_sybase_ct.c   Status: Locally Removed
 
Working revision:-1.74
Repository revision: 1.74   
 /repository/php4/ext/sybase_ct/php_sybase_ct.c,v
Sticky Tag:  (none)
Sticky Date: (none)
Sticky Options:  (none)
 
 OK, so this is _definitely_ not what I want.
 
 So, currently, this is what is showing (and what was showing before,
 e.g. yesterday):
 $ cvs status -v ext/sybase_ct/php_sybase_ct.c
 ===
 File: php_sybase_ct.c   Status: Up-to-date
 
Working revision:1.74
Repository revision: 1.74   
 /repository/php4/ext/sybase_ct/php_sybase_ct.c,v
Sticky Tag:  (none)
Sticky Date: (none)
Sticky Options:  (none)
 
Existing Tags:
 php_4_3_0RC2(revision: 1.73)
 php_4_3_0RC1(revision: 1.73)
 PHP_4_3 (branch: 1.73.2)
 php_4_3_0pre2   (revision: 1.70)
 php_4_3_0pre1   (revision: 1.70)
 php_4_3_0_dev_zend2_alpha3  (revision: 1.70)
 [...shortened for brevity...]
 
 What's wrong? How does this magic MFH (merge from head?) work? I mean,
 I see it all the time, and have been reading
 http://www.cvshome.org/docs/manual/cvs_5.html#SEC54 for a while now, but
 don't seem to get what I have to do to make the PHP_4_3 branch contain
 the contents of HEAD (1.74).
 
 I know you're not here to support CVS lamers... maybe you can give me a
 hint, anyway?
 
  On Sat, 7 Dec 2002, Timm Friebe wrote:
  
  thekid Sat Dec  7 14:49:31 2002 EDT
  
Modified files:  
  /php4/ext/sybase_ctphp_sybase_ct.c 
Log:
- Fixed three memory leaks
- Fixed segfault with sybase_unbuffered_query() and unfetched resultsets 
 [...]
 
 -- 
 Timm Friebe [EMAIL PROTECTED]
 
 
 -- 
 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 /ext/standard dns.c

2002-12-09 Thread Derick Rethans
On Sun, 8 Dec 2002, Sara Golemon wrote:

 pollita   Sun Dec  8 03:14:43 2002 EDT
 
   Modified files:  
 /php4/ext/standarddns.c 
   Log:
   Bug #17174 Added IPv6 ( record) support to dns_check_record() also added 
support to dns_get_record

This might break builds on some platforms, as T_ is not always 
defined. See the comment in bug #19555.

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 streams.c

2002-12-09 Thread Wez Furlong
wez Mon Dec  9 05:34:32 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  streams.c 
  Log:
  Fix for bug #20831; include() from UNC paths does not work.
  
  
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.125.2.15 php4/main/streams.c:1.125.2.16
--- php4/main/streams.c:1.125.2.15  Fri Nov 22 20:17:39 2002
+++ php4/main/streams.c Mon Dec  9 05:34:32 2002
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.125.2.15 2002/11/23 01:17:39 helly Exp $ */
+/* $Id: streams.c,v 1.125.2.16 2002/12/09 10:34:32 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1749,7 +1749,16 @@
if (fp) {
/* sanity checks for include/require */
if (options  STREAM_OPEN_FOR_INCLUDE  (fstat(fileno(fp), st) == -1 
|| !S_ISREG(st.st_mode))) {
-   goto err;
+   int is_unc = 0;
+
+#ifdef PHP_WIN32
+   /* skip the sanity check; fstat doesn't appear to work on
+* UNC paths */
+   is_unc = (filename[0] == '\\'  filename[1] == '\\');
+#endif
+   if (!is_unc) {
+   goto err;
+   }
} 

ret = php_stream_fopen_from_file_rel(fp, mode);



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




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

2002-12-09 Thread Wez Furlong
wez Mon Dec  9 05:38:35 2002 EDT

  Modified files:  
/php4/main  streams.c 
  Log:
  MFB: #20831 fix
  
  
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.131 php4/main/streams.c:1.132
--- php4/main/streams.c:1.131   Fri Nov 22 20:24:08 2002
+++ php4/main/streams.c Mon Dec  9 05:38:35 2002
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.131 2002/11/23 01:24:08 helly Exp $ */
+/* $Id: streams.c,v 1.132 2002/12/09 10:38:35 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1751,7 +1751,16 @@
if (fp) {
/* sanity checks for include/require */
if (options  STREAM_OPEN_FOR_INCLUDE  (fstat(fileno(fp), st) == -1 
|| !S_ISREG(st.st_mode))) {
-   goto err;
+   int is_unc = 0;
+
+#ifdef PHP_WIN32
+   /* skip the sanity check; fstat doesn't appear to work on
+* UNC paths */
+   is_unc = (filename[0] == '\\'  filename[1] == '\\');
+#endif
+   if (!is_unc) {
+   goto err;
+   }
} 

ret = php_stream_fopen_from_file_rel(fp, mode);
@@ -2317,7 +2326,7 @@
return stream;
case PHP_STREAM_RELEASED:
 #if ZEND_DEBUG
-   newstream-__orig_path = estrdup(copy_of_path);
+   newstream-__orig_path = estrdup(path);
 #endif
return newstream;
default:
@@ -2339,8 +2348,9 @@
}
tidy_wrapper_error_log(wrapper TSRMLS_CC);
 #if ZEND_DEBUG
-   if (stream == NULL  copy_of_path != NULL)
+   if (stream == NULL  copy_of_path != NULL) {
efree(copy_of_path);
+   }
 #endif
return stream;
 }



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




[PHP-CVS] cvs: php4 /ext/zlib zlib_fopen_wrapper.c

2002-12-09 Thread Wez Furlong
wez Mon Dec  9 05:54:20 2002 EDT

  Modified files:  
/php4/ext/zlib  zlib_fopen_wrapper.c 
  Log:
  MFB zlib related fixes
  (sorry I didn't get around to doing this sooner)
  
  
Index: php4/ext/zlib/zlib_fopen_wrapper.c
diff -u php4/ext/zlib/zlib_fopen_wrapper.c:1.34 php4/ext/zlib/zlib_fopen_wrapper.c:1.35
--- php4/ext/zlib/zlib_fopen_wrapper.c:1.34 Mon Nov 25 07:30:27 2002
+++ php4/ext/zlib/zlib_fopen_wrapper.c  Mon Dec  9 05:54:20 2002
@@ -16,7 +16,7 @@
| Hartmut Holzgraefe [EMAIL PROTECTED]|
+--+
  */
-/* $Id: zlib_fopen_wrapper.c,v 1.34 2002/11/25 12:30:27 hholzgra Exp $ */
+/* $Id: zlib_fopen_wrapper.c,v 1.35 2002/12/09 10:54:20 wez Exp $ */
 #define IS_EXT_MODULE
 #define _GNU_SOURCE
 
@@ -26,26 +26,27 @@
 
 struct php_gz_stream_data_t{
gzFile gz_file;
-   php_stream *stream;
 };
 
 static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
 {
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t 
*)stream-abstract;
-   size_t ret;
+   int read;

-   ret = gzread(self-gz_file, buf, count);
+   read = gzread(self-gz_file, buf, count);

if (gzeof(self-gz_file))
stream-eof = 1;

-   return ret;
+   return read  0 ? 0 : read;
 }
 
 static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count 
TSRMLS_DC)
 {
struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t 
*)stream-abstract;
-   return gzwrite(self-gz_file, (char*)buf, count);
+   int wrote;
+   wrote = gzwrite(self-gz_file, (char*)buf, count);
+   return wrote  0 ? 0 : wrote;
 }
 
 static int php_gziop_seek(php_stream *stream, off_t offset, int whence, off_t 
*newoffs TSRMLS_DC)
@@ -58,7 +59,7 @@
ret = gzseek(self-gz_file, offset, whence);
*newoffs = gztell(self-gz_file);

-   return ret;
+   return ret  0 ? -1 : 0;
 }
 
 static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC)
@@ -67,9 +68,11 @@
int ret = EOF;

if (close_handle) {
-   ret = gzclose(self-gz_file);
+   if (self-gz_file) {
+   ret = gzclose(self-gz_file);
+   self-gz_file = NULL;
+   }
}
-   php_stream_free(self-stream, PHP_STREAM_FREE_CLOSE | (close_handle == 0 ? 
PHP_STREAM_FREE_PRESERVE_HANDLE : 0));
efree(self);
 
return ret;
@@ -95,7 +98,21 @@
int options, char **opened_path, php_stream_context *context 
STREAMS_DC TSRMLS_DC)
 {
struct php_gz_stream_data_t *self;
-   php_stream *stream = NULL;
+   php_stream *stream = NULL, *innerstream = NULL;
+
+   /* sanity check the stream: it can be either read-only or write-only */
+   if (strchr(mode, '+')) {
+   if (options  REPORT_ERRORS) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, cannot open a 
+zlib stream for reading and writing at the same time!);
+   }
+   return NULL;
+   }
+   if (strchr(mode, 'a')) {
+   if (options  REPORT_ERRORS) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, cannot append to 
+a zlib stream!);
+   }
+   return NULL;
+   }

self = emalloc(sizeof(*self));
 
@@ -104,11 +121,11 @@
else if (strncasecmp(zlib:, path, 5) == 0)
path += 5;

-   self-stream = php_stream_open_wrapper(path, mode, STREAM_MUST_SEEK|options, 
opened_path);
+   innerstream = php_stream_open_wrapper(path, mode, 
+STREAM_MUST_SEEK|options|STREAM_WILL_CAST, opened_path);

-   if (self-stream) {
+   if (innerstream) {
int fd;
-   if (SUCCESS == php_stream_cast(self-stream, PHP_STREAM_AS_FD, 
(void**)fd, REPORT_ERRORS)) {
+   if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD | 
+PHP_STREAM_CAST_RELEASE, (void**)fd, REPORT_ERRORS)) {
self-gz_file = gzdopen(fd, mode);
if (self-gz_file)  {
stream = php_stream_alloc_rel(php_stream_gzio_ops, 
self, 0, mode);
@@ -120,12 +137,12 @@
}
if (options  REPORT_ERRORS)
php_error_docref(NULL TSRMLS_CC, E_WARNING, gzopen 
failed);
+   } else if (innerstream) {
+   php_stream_close(innerstream);
}
}
if (stream)
php_stream_close(stream);
-   if (self  self-stream)
-   php_stream_close(self-stream);
if (self)
efree(self);
 



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




FW: [PHP-CVS] cvs: php4(THREADED) /sapi/milter php_milter.c

2002-12-09 Thread Harald Radi
forgot to cc the list.

 -Original Message-
 From: Harald Radi [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, December 09, 2002 12:19 PM
 To: 'Derick Rethans'
 Subject: RE: [PHP-CVS] cvs: php4(THREADED) /sapi/milter php_milter.c 
 
 
 because i still didn't find the leak. HLP ;)
 
 valgrind tells me 0 lost blocks, but when running it 
 standalone i can watch memory usage grewing by about 300k per 
 request. if i comment out all php specific code 
 (module_startup, request_startup  co) all works fine, so it 
 seems like request_shutdown isn't done correctly, on the 
 other hand valgrind tells me, that it is done.
 
 harald
 
  -Original Message-
  From: Derick Rethans [mailto:[EMAIL PROTECTED]] 
  Sent: Monday, December 09, 2002 10:33 AM
  To: Harald Radi
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP-CVS] cvs: php4(THREADED) /sapi/milter 
 php_milter.c 
  
  
  On Sun, 8 Dec 2002, Harald Radi wrote:
  
   phantoSun Dec  8 14:04:38 2002 EDT
   
 Modified files:  (Branch: THREADED)
   /php4/sapi/milter php_milter.c 
 Log:
 threaded version to 1:1 map connections and php request 
  handler threads
  
  Cool! But why is this in a different branch?
  
  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) /ext/sockets sockets.c

2002-12-09 Thread Edin Kadribasic
edink   Mon Dec  9 06:29:32 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/sockets   sockets.c 
  Log:
  Fixed crash in socket_read on windows #20894 (patch by Wez Furlong).
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.125 php4/ext/sockets/sockets.c:1.125.2.1
--- php4/ext/sockets/sockets.c:1.125Sun Oct 27 22:05:04 2002
+++ php4/ext/sockets/sockets.c  Mon Dec  9 06:29:31 2002
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: sockets.c,v 1.125 2002/10/28 03:05:04 sterling Exp $ */
+/* $Id: sockets.c,v 1.125.2.1 2002/12/09 11:29:31 edink Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -766,30 +766,28 @@
 }
 /* }}} */
 
-typedef int (*read_func)(int, void *, size_t, int);
-
 /* {{{ proto string socket_read(resource socket, int length [, int type])
Reads a maximum of length bytes from socket */
 PHP_FUNCTION(socket_read)
 {
zval*arg1;
php_socket  *php_sock;
-   read_func   read_function = (read_func) recv;
char*tmpbuf;
int retval, length, type = PHP_BINARY_READ;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl|l, arg1, length, 
type) == FAILURE)
return;
 
+   tmpbuf = emalloc(length + 1);
+   
ZEND_FETCH_RESOURCE(php_sock, php_socket *, arg1, -1, le_socket_name, 
le_socket);
 
if (type == PHP_NORMAL_READ) {
-   read_function = (read_func) php_read;
+   retval = php_read(php_sock-bsd_socket, tmpbuf, length, 0);
+   } else {
+   retval = recv(php_sock-bsd_socket, tmpbuf, length, 0);
}
 
-   tmpbuf = emalloc(length + 1);
-
-   retval = (*read_function)(php_sock-bsd_socket, tmpbuf, length, 0);
if (retval == -1) {
PHP_SOCKET_ERROR(php_sock, unable to read from socket, errno);
efree(tmpbuf);



-- 
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

2002-12-09 Thread Sebastian Bergmann
sebastian   Mon Dec  9 06:45:47 2002 EDT

  Modified files:  
/php4/sapi/cli  php_cli.c 
  Log:
  Fix build.
  
  
Index: php4/sapi/cli/php_cli.c
diff -u php4/sapi/cli/php_cli.c:1.54 php4/sapi/cli/php_cli.c:1.55
--- php4/sapi/cli/php_cli.c:1.54Sun Dec  8 05:23:50 2002
+++ php4/sapi/cli/php_cli.c Mon Dec  9 06:45:46 2002
@@ -23,6 +23,7 @@
 #include php.h
 #include php_globals.h
 #include php_variables.h
+#include zend_hash.h
 #include zend_modules.h
 
 #include SAPI.h



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




[PHP-CVS] cvs: php4 /ext/ircg ircg.c php_ircg_formats.h php_ircg_private.h php_ircg_tokenizer.h

2002-12-09 Thread Sascha Schumann
sas Mon Dec  9 07:42:28 2002 EDT

  Added files: 
/php4/ext/ircg  php_ircg_formats.h 

  Modified files:  
/php4/ext/ircg  ircg.c php_ircg_private.h php_ircg_tokenizer.h 
  Log:
  It is now possible to run 'apachectl restart' even if PHP
  and/or the IRCG extension are a shared module. 
  
  In those cases, the heap will be initialized to zero during
  a restart, so we basically lose all state information,
  including pointers to already allocated data structures.
  
  We compensate that by introducing a separate area manager
  which maintains a id = ptr mapping.  That manager can be
  queried through a UNIX domain socket, so that the newly
  loaded DSO (which still has the shared memory segment 
  attached) can ask the manager for the pointers.
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.158 php4/ext/ircg/ircg.c:1.159
--- php4/ext/ircg/ircg.c:1.158  Fri Dec  6 01:52:47 2002
+++ php4/ext/ircg/ircg.cMon Dec  9 07:42:28 2002
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: ircg.c,v 1.158 2002/12/06 06:52:47 sas Exp $ */
+/* $Id: ircg.c,v 1.159 2002/12/09 12:42:28 sas Exp $ */
 
 /* {{{ includes */
 
@@ -83,44 +83,6 @@
 
 /* }}} */
 
-/* {{{ Format string numbers */
-enum {
-   FMT_MSG_CHAN = 0,
-   FMT_MSG_PRIV_TO_ME,
-   FMT_MSG_PRIV_FROM_ME,
-   FMT_MSG_LEAVE,
-   FMT_MSG_JOIN,
-   FMT_MSG_KICK,
-   FMT_MSG_TOPIC,
-   FMT_MSG_ERROR,
-   FMT_MSG_FATAL_ERROR,
-   FMT_MSG_JOIN_LIST_END,
-   FMT_MSG_SELF_PART,
-   FMT_MSG_NICK,
-   FMT_MSG_QUIT,
-   FMT_MSG_MASS_JOIN_BEGIN,
-   FMT_MSG_MASS_JOIN_ELEMENT,
-   FMT_MSG_MASS_JOIN_END,
-   FMT_MSG_WHOIS_USER,
-   FMT_MSG_WHOIS_SERVER,
-   FMT_MSG_WHOIS_IDLE,
-   FMT_MSG_WHOIS_CHANNEL,
-   FMT_MSG_WHOIS_END,
-   FMT_MSG_MODE_VOICE,
-   FMT_MSG_MODE_OP,
-   FMT_MSG_BANLIST,
-   FMT_MSG_BANLIST_END,
-   FMT_MSG_DISCONNECTED,
-   FMT_MSG_LIST,
-   FMT_MSG_LISTEND,
-   FMT_MSG_WHOREPLY1,
-   FMT_MSG_WHOREPLY2,
-   FMT_MSG_ENDOFWHO,
-   FMT_MSG_INVITE,
-   NO_FMTS
-};
-/* }}} */
-
 /* {{{ ircg_functions[] */
 function_entry ircg_functions[] = {
 #ifdef IRCG_PENDING_URL
@@ -177,10 +139,6 @@
 #endif
 
 typedef struct {
-   format_msg_t *fmt_msgs[NO_FMTS];
-} php_fmt_msgs_t;
-
-typedef struct {
irconn_t conn;
smart_str buffer;
time_t login;
@@ -209,7 +167,6 @@
char *realname; /* dito */
 } php_irconn_t;
 
-static php_fmt_msgs_t fmt_msgs_default_compiled;
 
 #define format_msg php_ircg_format_msg
 
@@ -1754,7 +1711,7 @@
}
 
if (!fmt_msgs)
-   fmt_msgs = fmt_msgs_default_compiled;
+   fmt_msgs = php_ircg-fmt_msgs_default_compiled;
 
/*
 * conn must be able to live longer than the hash entry in h_irconn,
@@ -2126,20 +2083,23 @@
 #endif
 /* }}} */
 
-static void setup(int stage)
+static int init(void *p)
 {
-   if (stage == 0) {
-   int i;
+   int i;
 
-   php_ircg = IRCG_SHARED_ALLOC(sizeof *php_ircg);
-   memset(php_ircg, 0, sizeof *php_ircg);
-   
-   IRCG_LOCK_INIT(php_ircg-fmt_msgs_lock);
-   IRCG_LOCK_INIT(php_ircg-error_msgs_lock);
+   IRCG_LOCK_INIT(php_ircg-fmt_msgs_lock);
+   IRCG_LOCK_INIT(php_ircg-error_msgs_lock);
 
-   for (i = 0; i  NO_FMTS; i++) {
-   php_ircg_token_compiler(fmt_msgs_default[i], 
fmt_msgs_default_compiled.fmt_msgs[i]);
-   }
+   for (i = 0; i  NO_FMTS; i++) {
+   php_ircg_token_compiler(fmt_msgs_default[i], 
+php_ircg-fmt_msgs_default_compiled.fmt_msgs[i]);
+   }
+   return 0;
+}
+   
+static void setup(int stage)
+{
+   if (stage == 0) {
+   ircg_fetch_area(php-ircg-main, php_ircg, sizeof *php_ircg, init);
} else if (stage == 1) {
php_ircg_cache_entries = malloc(sizeof(struct cache_entry) * 
NR_CACHE_ENTRIES);
memset(php_ircg_cache_entries, 0, sizeof(struct cache_entry) * 
NR_CACHE_ENTRIES);
Index: php4/ext/ircg/php_ircg_private.h
diff -u php4/ext/ircg/php_ircg_private.h:1.4 php4/ext/ircg/php_ircg_private.h:1.5
--- php4/ext/ircg/php_ircg_private.h:1.4Wed Dec  4 04:53:20 2002
+++ php4/ext/ircg/php_ircg_private.hMon Dec  9 07:42:28 2002
@@ -10,6 +10,8 @@
 #define USE_IRCONN_MANAGEMENT
 #define USE_FD2IRCONN
 
+#define ircg_fetch_area(name, ptr, size, fn) do { *(ptr) = IRCG_SHARED_ALLOC((size)); 
+memset(*(ptr), 0, (size)); (fn)(*(ptr)); } while (0)
+
 /* provide dummy definitions */
 #include php_ircg_hash.h
 #include php_ircg_lock.h
@@ -22,6 +24,13 @@
 
 #include php_ircg_error.h
 
+#include php_ircg_tokenizer.h
+#include php_ircg_formats.h
+
+typedef struct {
+   format_msg_t *fmt_msgs[NO_FMTS];
+} php_fmt_msgs_t;
+
 struct php_ircg_global {

[PHP-CVS] cvs: php4 /ext/ircg ircg_scanner.c ircg_scanner.re

2002-12-09 Thread Sascha Schumann
sas Mon Dec  9 10:28:23 2002 EDT

  Modified files:  
/php4/ext/ircg  ircg_scanner.c ircg_scanner.re 
  Log:
  turn frequently called functions into macros to reduce function call
  and pointer dereference overhead.
  
  
Index: php4/ext/ircg/ircg_scanner.c
diff -u php4/ext/ircg/ircg_scanner.c:1.20 php4/ext/ircg/ircg_scanner.c:1.21
--- php4/ext/ircg/ircg_scanner.c:1.20   Sun Dec  1 01:30:01 2002
+++ php4/ext/ircg/ircg_scanner.cMon Dec  9 10:28:23 2002
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.5 on Sun Dec  1 07:27:15 2002 */
+/* Generated by re2c 0.5 on Mon Dec  9 16:23:46 2002 */
 #line 1 /lrg2/php4/ext/ircg/ircg_scanner.re
 /*
+--+
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: ircg_scanner.c,v 1.20 2002/12/01 06:30:01 sas Exp $ */
+/* $Id: ircg_scanner.c,v 1.21 2002/12/09 15:28:23 sas Exp $ */
 
 #include php_ircg_alloc.h
 
@@ -78,10 +78,9 @@
 #define STD_PARA ircg_msg_scanner *ctx, const char *start, const char *YYCURSOR
 #define STD_ARGS ctx, start, YYCURSOR
 
-static inline void passthru(STD_PARA)
-{
-   smart_str_appendl_ex(ctx-result, start, YYCURSOR - start, 1);
-}
+#define PASSTHRU() do {   
+ \
+   smart_str_appendl_ex(result, start, YYCURSOR - start, 1);   \
+} while (0)
 
 static inline void handle_scheme(STD_PARA)
 {
@@ -186,10 +185,9 @@
}
 }
 
-static void add_entity(STD_PARA, const char *entity)
-{
-   smart_str_appends_ex(ctx-result, entity, 1);
-}
+#define ADD_CONST(entity) do {
+ \
+   smart_str_appends_ex(result, entity, 1);   
+ \
+} while (0)
 
 void ircg_mirc_color(const char *msg, smart_str *result, size_t msg_len, int 
auto_links, int gen_br) 
 {
@@ -310,43 +308,43 @@
if(yych = 'z') goto yy25;
}
 yy4:
-#line 234
-   { passthru(STD_ARGS); goto state_plain; }
+#line 232
+   { PASSTHRU(); goto state_plain; }
 yy5:   yych = *++YYCURSOR;
 yy6:
-#line 225
+#line 223
{ mctx.fg_code = mctx.bg_code = -1; goto state_color_fg; }
 yy7:   yych = *++YYCURSOR;
 yy8:
-#line 226
-   { add_entity(STD_ARGS, lt;); goto state_plain; }
+#line 224
+   { ADD_CONST(lt;); goto state_plain; }
 yy9:   yych = *++YYCURSOR;
 yy10:
-#line 227
-   { add_entity(STD_ARGS, gt;); goto state_plain; }
+#line 225
+   { ADD_CONST(gt;); goto state_plain; }
 yy11:  yych = *++YYCURSOR;
 yy12:
-#line 228
-   { add_entity(STD_ARGS, amp;); goto state_plain; }
+#line 226
+   { ADD_CONST(amp;); goto state_plain; }
 yy13:  yych = *++YYCURSOR;
 yy14:
-#line 229
-   { add_entity(STD_ARGS, quot;); goto state_plain; }
+#line 227
+   { ADD_CONST(quot;); goto state_plain; }
 yy15:  yych = *++YYCURSOR;
 yy16:
-#line 230
-   { if (gen_br) smart_str_appendl_ex(result, br, 4, 1); goto state_plain; }
+#line 228
+   { if (gen_br) ADD_CONST(br); goto state_plain; }
 yy17:  yych = *++YYCURSOR;
 yy18:
-#line 231
+#line 229
{ handle_bold(STD_ARGS, 0); goto state_plain; }
 yy19:  yych = *++YYCURSOR;
 yy20:
-#line 232
+#line 230
{ handle_underline(STD_ARGS, 0); goto state_plain; }
 yy21:  yych = *++YYCURSOR;
 yy22:
-#line 233
+#line 231
{ handle_italic(STD_ARGS, 0); goto state_plain; }
 yy23:  yych = *++YYCURSOR;
goto yy4;
@@ -361,10 +359,10 @@
if(yych != '/') goto yy2;
 yy28:  yych = *++YYCURSOR;
 yy29:
-#line 224
-   { if (auto_links) { handle_scheme(STD_ARGS); goto state_url; } else { 
passthru(STD_ARGS); goto state_plain; } }
+#line 222
+   { if (auto_links) { handle_scheme(STD_ARGS); goto state_url; } else { 
+PASSTHRU(); goto state_plain; } }
 }
-#line 235
+#line 233
 
 
 state_url: 
@@ -430,19 +428,19 @@
 yy32:  yych = *++YYCURSOR;
goto yy37;
 yy33:
-#line 240
+#line 238
{ handle_url(STD_ARGS); goto state_plain; }
 yy34:  yych = *++YYCURSOR;
 yy35:
-#line 241
-   { passthru(STD_ARGS); goto state_plain; }
+#line 239
+   { PASSTHRU(); goto state_plain; }
 yy36:  ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
 yy37:  if(yybm[0+yych]  128)  goto yy36;
goto yy33;
 }
-#line 242
+#line 240
 
 
 
@@ -462,16 +460,16 @@
if(yych = '/') goto yy41;
if(yych = '9') goto yy44;
 yy41:
-#line 248
+#line 246
{ handle_color_digit(STD_ARGS, 0); goto state_color_comma; }
 yy42:  yych = *++YYCURSOR;
 yy43:
-#line 249
-   { finish_color_stuff(STD_ARGS); passthru(STD_ARGS); goto state_plain; }
+#line 247
+   { finish_color_stuff(STD_ARGS); PASSTHRU(); goto state_plain; }
 yy44:  yych = *++YYCURSOR;
goto yy41;
 }
-#line 250
+#line 248
 
 

@@ -488,14 +486,14 @@
if(yych != ',') goto yy49;
 yy47:  yych = 

[PHP-CVS] cvs: php4 / Makefile.global

2002-12-09 Thread Sascha Schumann
sas Mon Dec  9 10:32:17 2002 EDT

  Modified files:  
/php4   Makefile.global 
  Log:
  Use $(INSTALL) rather than cp to install modules.
  
  $(INSTALL) will usually unlink the target file first, so that in-memory
  instances of the old file don't get simply overwritten (and crash and burn).
  
  
Index: php4/Makefile.global
diff -u php4/Makefile.global:1.40 php4/Makefile.global:1.41
--- php4/Makefile.global:1.40   Tue Nov 12 12:40:38 2002
+++ php4/Makefile.globalMon Dec  9 10:32:17 2002
@@ -37,7 +37,7 @@
$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR)  \
echo Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/  \
rm -f modules/*.la  \
-   cp modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) /dev/null 21 || true
+   $(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) /dev/null 21 || true
 
 install-tester:
@echo Installing regression tester: $(INSTALL_ROOT)$(PEAR_INSTALLDIR)/



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




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

2002-12-09 Thread Moriyoshi Koizumi
moriyoshi   Mon Dec  9 10:54:38 2002 EDT

  Modified files:  
/php4/ext/standard  array.c 
  Log:
  @- Let array_search() accept objects as a needle under ZendEngine2. (Moriyoshi)
  
  
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.209 php4/ext/standard/array.c:1.210
--- php4/ext/standard/array.c:1.209 Fri Dec  6 12:35:52 2002
+++ php4/ext/standard/array.c   Mon Dec  9 10:54:38 2002
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.209 2002/12/06 17:35:52 iliaa Exp $ */
+/* $Id: array.c,v 1.210 2002/12/09 15:54:38 moriyoshi Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1054,11 +1054,13 @@
zend_get_parameters_ex(ZEND_NUM_ARGS(), value, array, strict) == 
FAILURE) {
WRONG_PARAM_COUNT;
}
-   
+
+#ifndef ZEND_ENGINE_2  
if (Z_TYPE_PP(value) == IS_OBJECT) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Wrong datatype for first 
argument);
RETURN_FALSE;
}
+#endif

if (Z_TYPE_PP(array) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Wrong datatype for second 
argument);



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




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

2002-12-09 Thread Wez Furlong
wez Mon Dec  9 11:14:28 2002 EDT

  Modified files:  
/php4   configure.in 
/php4/main  streams.c 
  Log:
  Emulate fopencookie on *BSD systems.
  Patch mostly from Melvyn Sopacua [EMAIL PROTECTED]
  
  
Index: php4/configure.in
diff -u php4/configure.in:1.404 php4/configure.in:1.405
--- php4/configure.in:1.404 Mon Dec  2 02:03:00 2002
+++ php4/configure.in   Mon Dec  9 11:14:27 2002
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.404 2002/12/02 07:03:00 iliaa Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.405 2002/12/09 16:14:27 wez Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -451,6 +451,7 @@
 crypt \
 flock \
 ftok \
+funopen \
 gai_strerror \
 gcvt \
 getlogin \
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.132 php4/main/streams.c:1.133
--- php4/main/streams.c:1.132   Mon Dec  9 05:38:35 2002
+++ php4/main/streams.c Mon Dec  9 11:14:28 2002
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.132 2002/12/09 10:38:35 wez Exp $ */
+/* $Id: streams.c,v 1.133 2002/12/09 16:14:28 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -72,6 +72,25 @@
 #endif
 /* }}} */
 
+/* Under BSD, emulate fopencookie using funopen */
+#if HAVE_FUNOPEN
+typedef struct {
+   int (*reader)(void *, char *, int);
+   int (*writer)(void *, const char *, int);
+   fpos_t (*seeker)(void *, fpos_t, int);
+   int (*closer)(void *);
+} COOKIE_IO_FUNCTIONS_T;
+
+FILE *fopencookie(void *cookie, const char *mode, COOKIE_IO_FUNCTIONS_T *funcs)
+{
+   return funopen(cookie, funcs-reader, funcs-writer, funcs-seeker, 
+funcs-closer);
+}
+# define HAVE_FOPENCOOKIE 1
+# define PHP_STREAM_COOKIE_FUNCTIONS   stream_cookie_functions
+#elif HAVE_FOPENCOOKIE
+# define PHP_STREAM_COOKIE_FUNCTIONS   stream_cookie_functions
+#endif
+   
 static HashTable url_stream_wrappers_hash;
 static int le_stream = FAILURE; /* true global */
 static int le_pstream = FAILURE; /* true global */
@@ -1784,7 +1803,39 @@
 /* }}} */
 
 /* {{{ STDIO with fopencookie */
-#if HAVE_FOPENCOOKIE
+#if HAVE_FUNOPEN
+/* use our fopencookie emulation */
+static int stream_cookie_reader(void *cookie, char *buffer, int size)
+{
+   int ret;
+   TSRMLS_FETCH();
+   ret = php_stream_read((php_stream*)cookie, buffer, size);
+   return ret;
+}
+
+static int stream_cookie_writer(void *cookie, const char *buffer, int size)
+{
+   TSRMLS_FETCH();
+   return php_stream_write((php_stream *)cookie, (char *)buffer, size);
+}
+
+static fpos_t stream_cookie_seeker(void *cookie, off_t position, int whence)
+{
+   TSRMLS_FETCH();
+   return (fpos_t)php_stream_seek((php_stream *)cookie, position, whence);
+}
+
+static int stream_cookie_closer(void *cookie)
+{
+   php_stream *stream = (php_stream*)cookie;
+   TSRMLS_FETCH();
+
+   /* prevent recursion */
+   stream-fclose_stdiocast = PHP_STREAM_FCLOSE_NONE;
+   return php_stream_close(stream);
+}
+
+#elif HAVE_FOPENCOOKIE
 static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size)
 {
ssize_t ret;
@@ -1827,7 +1878,9 @@
stream-fclose_stdiocast = PHP_STREAM_FCLOSE_NONE;
return php_stream_close(stream);
 }
+#endif /* elif HAVE_FOPENCOOKIE */
 
+#if HAVE_FOPENCOOKIE
 static COOKIE_IO_FUNCTIONS_T stream_cookie_functions =
 {
stream_cookie_reader, stream_cookie_writer,
@@ -1880,7 +1933,7 @@
if (ret == NULL)
goto exit_success;
 
-   *ret = fopencookie(stream, stream-mode, stream_cookie_functions);
+   *ret = fopencookie(stream, stream-mode, PHP_STREAM_COOKIE_FUNCTIONS);
 
if (*ret != NULL) {
off_t pos;



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




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

2002-12-09 Thread Wez Furlong
wez Mon Dec  9 11:22:06 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   configure.in 
/php4/main  streams.c 
  Log:
  MFH: fopencookie for BSD patch
  
  
Index: php4/configure.in
diff -u php4/configure.in:1.396.2.9 php4/configure.in:1.396.2.10
--- php4/configure.in:1.396.2.9 Thu Dec  5 06:38:13 2002
+++ php4/configure.in   Mon Dec  9 11:22:05 2002
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.396.2.9 2002/12/05 11:38:13 helly Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.396.2.10 2002/12/09 16:22:05 wez Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -451,6 +451,7 @@
 crypt \
 flock \
 ftok \
+funopen \
 gai_strerror \
 gcvt \
 getlogin \
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.125.2.16 php4/main/streams.c:1.125.2.17
--- php4/main/streams.c:1.125.2.16  Mon Dec  9 05:34:32 2002
+++ php4/main/streams.c Mon Dec  9 11:22:06 2002
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.125.2.16 2002/12/09 10:34:32 wez Exp $ */
+/* $Id: streams.c,v 1.125.2.17 2002/12/09 16:22:06 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -72,6 +72,25 @@
 #endif
 /* }}} */
 
+/* Under BSD, emulate fopencookie using funopen */
+#if HAVE_FUNOPEN
+typedef struct {
+   int (*reader)(void *, char *, int);
+   int (*writer)(void *, const char *, int);
+   fpos_t (*seeker)(void *, fpos_t, int);
+   int (*closer)(void *);
+} COOKIE_IO_FUNCTIONS_T;
+
+FILE *fopencookie(void *cookie, const char *mode, COOKIE_IO_FUNCTIONS_T *funcs)
+{
+   return funopen(cookie, funcs-reader, funcs-writer, funcs-seeker, 
+funcs-closer);
+}
+# define HAVE_FOPENCOOKIE 1
+# define PHP_STREAM_COOKIE_FUNCTIONS   stream_cookie_functions
+#elif HAVE_FOPENCOOKIE
+# define PHP_STREAM_COOKIE_FUNCTIONS   stream_cookie_functions
+#endif
+   
 static HashTable url_stream_wrappers_hash;
 static int le_stream = FAILURE; /* true global */
 static int le_pstream = FAILURE; /* true global */
@@ -1782,7 +1801,39 @@
 /* }}} */
 
 /* {{{ STDIO with fopencookie */
-#if HAVE_FOPENCOOKIE
+#if HAVE_FUNOPEN
+/* use our fopencookie emulation */
+static int stream_cookie_reader(void *cookie, char *buffer, int size)
+{
+   int ret;
+   TSRMLS_FETCH();
+   ret = php_stream_read((php_stream*)cookie, buffer, size);
+   return ret;
+}
+
+static int stream_cookie_writer(void *cookie, const char *buffer, int size)
+{
+   TSRMLS_FETCH();
+   return php_stream_write((php_stream *)cookie, (char *)buffer, size);
+}
+
+static fpos_t stream_cookie_seeker(void *cookie, off_t position, int whence)
+{
+   TSRMLS_FETCH();
+   return (fpos_t)php_stream_seek((php_stream *)cookie, position, whence);
+}
+
+static int stream_cookie_closer(void *cookie)
+{
+   php_stream *stream = (php_stream*)cookie;
+   TSRMLS_FETCH();
+
+   /* prevent recursion */
+   stream-fclose_stdiocast = PHP_STREAM_FCLOSE_NONE;
+   return php_stream_close(stream);
+}
+
+#elif HAVE_FOPENCOOKIE
 static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size)
 {
ssize_t ret;
@@ -1825,7 +1876,9 @@
stream-fclose_stdiocast = PHP_STREAM_FCLOSE_NONE;
return php_stream_close(stream);
 }
+#endif /* elif HAVE_FOPENCOOKIE */
 
+#if HAVE_FOPENCOOKIE
 static COOKIE_IO_FUNCTIONS_T stream_cookie_functions =
 {
stream_cookie_reader, stream_cookie_writer,
@@ -1878,7 +1931,7 @@
if (ret == NULL)
goto exit_success;
 
-   *ret = fopencookie(stream, stream-mode, stream_cookie_functions);
+   *ret = fopencookie(stream, stream-mode, PHP_STREAM_COOKIE_FUNCTIONS);
 
if (*ret != NULL) {
off_t pos;



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




[PHP-CVS] cvs: php4 /ext/zlib/tests gzreadgzwrite.phpt gzreadgzwriteplain.phpt

2002-12-09 Thread Wez Furlong
wez Mon Dec  9 11:43:15 2002 EDT

  Modified files:  
/php4/ext/zlib/testsgzreadgzwrite.phpt gzreadgzwriteplain.phpt 
  Log:
  MFB: zlib stream tests
  
  
Index: php4/ext/zlib/tests/gzreadgzwrite.phpt
diff -u /dev/null php4/ext/zlib/tests/gzreadgzwrite.phpt:1.2
--- /dev/null   Mon Dec  9 11:43:15 2002
+++ php4/ext/zlib/tests/gzreadgzwrite.phpt  Mon Dec  9 11:43:15 2002
@@ -0,0 +1,33 @@
+--TEST--
+gzopen(), gzread(), gzwrite()
+--SKIPIF--
+?php # vim600:syn=php:
+if (!extension_loaded(zlib)) print skip; ?
+--POST--
+--GET--
+--FILE--
+?php
+$original = str_repeat(hallo php,4096);
+$filename = tempnam(/tmp, phpt);
+
+$fp = gzopen($filename, wb);
+gzwrite($fp, $original);
+var_dump(strlen($original));
+var_dump(gztell($fp));
+fclose($fp);
+
+$fp = gzopen($filename, rb);
+$data = gzread($fp, strlen($original));
+if ($data == $original) {
+   echo Strings are equal\n;
+} else {
+   echo Strings are not equal\n;
+   var_dump($data);
+}
+gzclose($fp);
+unlink($filename);
+?
+--EXPECT--
+int(36864)
+int(36864)
+Strings are equal
Index: php4/ext/zlib/tests/gzreadgzwriteplain.phpt
diff -u /dev/null php4/ext/zlib/tests/gzreadgzwriteplain.phpt:1.2
--- /dev/null   Mon Dec  9 11:43:15 2002
+++ php4/ext/zlib/tests/gzreadgzwriteplain.phpt Mon Dec  9 11:43:15 2002
@@ -0,0 +1,47 @@
+--TEST--
+gzopen(), gzread(), gzwrite() for non-compressed data
+--SKIPIF--
+?php # vim600:syn=php:
+if (!extension_loaded(zlib)) print skip; ?
+--POST--
+--GET--
+--FILE--
+?php
+$original = str_repeat(hallo php,4096);
+$filename = tempnam(/tmp, phpt);
+
+$fp = fopen($filename, wb);
+fwrite($fp, $original);
+var_dump(strlen($original));
+var_dump(ftell($fp));
+fclose($fp);
+
+$fp = gzopen($filename, rb);
+$data = gzread($fp, strlen($original));
+if ($data == $original) {
+   echo Strings are equal\n;
+} else {
+   echo Strings are not equal\n;
+   var_dump($data);
+}
+
+gzseek($fp, strlen($original) / 2);
+$data = gzread($fp, strlen($original));
+
+var_dump(strlen($data));
+if ($data == substr($original, strlen($original) / 2)) {
+   echo Strings are equal\n;
+} else {
+   echo Strings are not equal\n;
+   var_dump($data);
+}
+
+gzclose($fp);
+unlink($filename);
+?
+--EXPECT--
+int(36864)
+int(36864)
+Strings are equal
+int(18432)
+Strings are equal



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




[PHP-CVS] cvs: php4 /sapi/cgi config9.m4 /sapi/cli config.m4

2002-12-09 Thread Melvyn Sopacua
msopacuaMon Dec  9 12:02:39 2002 EDT

  Modified files:  
/php4/sapi/cli  config.m4 
/php4/sapi/cgi  config9.m4 
  Log:
  Fix make install target on Cygwin, bug #20807
  
  
Index: php4/sapi/cli/config.m4
diff -u php4/sapi/cli/config.m4:1.12 php4/sapi/cli/config.m4:1.13
--- php4/sapi/cli/config.m4:1.12Wed Nov 13 20:09:46 2002
+++ php4/sapi/cli/config.m4 Mon Dec  9 12:02:38 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.12 2002/11/14 01:09:46 sas Exp $
+dnl $Id: config.m4,v 1.13 2002/12/09 17:02:38 msopacua Exp $
 dnl
 
 AC_MSG_CHECKING(for CLI build)
@@ -21,6 +21,10 @@
   case $host_alias in
   *darwin*)
 BUILD_CLI=\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) 
\$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) 
\$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
+;;
+  *cygwin*)
+SAPI_CLI_PATH=sapi/cli/php.exe
+BUILD_CLI=\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) 
+\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) 
+\$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
 ;;
   *)
 BUILD_CLI=\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) 
\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) 
\$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
Index: php4/sapi/cgi/config9.m4
diff -u php4/sapi/cgi/config9.m4:1.3 php4/sapi/cgi/config9.m4:1.4
--- php4/sapi/cgi/config9.m4:1.3Sun Dec  1 16:50:35 2002
+++ php4/sapi/cgi/config9.m4Mon Dec  9 12:02:38 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config9.m4,v 1.3 2002/12/01 21:50:35 shane Exp $
+dnl $Id: config9.m4,v 1.4 2002/12/09 17:02:38 msopacua Exp $
 dnl
 
 AC_ARG_ENABLE(cgi,
@@ -86,7 +86,14 @@
 AC_MSG_RESULT(yes)
 
 PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cgi/Makefile.frag)
-SAPI_CGI_PATH=sapi/cgi/php-cgi
+case $host_alias in
+  *cygwin* )
+SAPI_CGI_PATH=sapi/cgi/php-cgi.exe
+;;
+  * )
+SAPI_CGI_PATH=sapi/cgi/php-cgi
+;;
+esac
 PHP_SUBST(SAPI_CGI_PATH)
 
 PHP_TEST_WRITE_STDOUT



-- 
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 config9.m4 /sapi/cli config.m4

2002-12-09 Thread Melvyn Sopacua
msopacuaMon Dec  9 12:25:01 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/sapi/cli  config.m4 
/php4/sapi/cgi  config9.m4 
  Log:
  MFH: fix make install target on Cygwin
  
  
Index: php4/sapi/cli/config.m4
diff -u php4/sapi/cli/config.m4:1.11 php4/sapi/cli/config.m4:1.11.2.1
--- php4/sapi/cli/config.m4:1.11Sun Sep 29 12:22:48 2002
+++ php4/sapi/cli/config.m4 Mon Dec  9 12:25:01 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.11 2002/09/29 16:22:48 sas Exp $
+dnl $Id: config.m4,v 1.11.2.1 2002/12/09 17:25:01 msopacua Exp $
 dnl
 
 AC_MSG_CHECKING(for CLI build)
@@ -21,6 +21,10 @@
   case $host_alias in
   *darwin*)
 BUILD_CLI=\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) 
\$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) 
\$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
+;;
+  *cygwin*)
+SAPI_CLI_PATH=sapi/cli/php.exe
+BUILD_CLI=\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) 
+\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) 
+\$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
 ;;
   *)
 BUILD_CLI=\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) 
\$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) 
\$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)
Index: php4/sapi/cgi/config9.m4
diff -u php4/sapi/cgi/config9.m4:1.1.2.1 php4/sapi/cgi/config9.m4:1.1.2.2
--- php4/sapi/cgi/config9.m4:1.1.2.1Sun Dec  1 18:27:14 2002
+++ php4/sapi/cgi/config9.m4Mon Dec  9 12:25:01 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config9.m4,v 1.1.2.1 2002/12/01 23:27:14 shane Exp $
+dnl $Id: config9.m4,v 1.1.2.2 2002/12/09 17:25:01 msopacua Exp $
 dnl
 
 AC_ARG_ENABLE(cgi,
@@ -86,7 +86,14 @@
 AC_MSG_RESULT(yes)
 
 PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cgi/Makefile.frag)
-SAPI_CGI_PATH=sapi/cgi/php-cgi
+case $host_alias in
+  *cygwin* )
+SAPI_CGI_PATH=sapi/cgi/php-cgi.exe
+;;
+  * )
+SAPI_CGI_PATH=sapi/cgi/php-cgi
+;;
+esac
 PHP_SUBST(SAPI_CGI_PATH)
 
 PHP_TEST_WRITE_STDOUT



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




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

2002-12-09 Thread Marcus Boerger
helly   Mon Dec  9 12:54:13 2002 EDT

  Modified files:  
/php4/ext/dba   dba.c 
  Log:
  Added open modifier '-' to skip/ignore locking. See bug #20828, #20858
  
  
Index: php4/ext/dba/dba.c
diff -u php4/ext/dba/dba.c:1.65 php4/ext/dba/dba.c:1.66
--- php4/ext/dba/dba.c:1.65 Tue Nov 26 07:05:59 2002
+++ php4/ext/dba/dba.c  Mon Dec  9 12:54:13 2002
@@ -1,790 +1,804 @@
-/*
-   +--+
-   | PHP Version 4|
-   +--+
-   | Copyright (c) 1997-2002 The PHP Group|
-   +--+
-   | This source file is subject to version 2.02 of the PHP license,  |
-   | that is bundled with this package in the file LICENSE, and is|
-   | available at through the world-wide-web at   |
-   | http://www.php.net/license/2_02.txt. |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to  |
-   | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
-   +--+
-   | Authors: Sascha Schumann [EMAIL PROTECTED]|
-   |  Marcus Boerger [EMAIL PROTECTED]  |
-   +--+
- */
-
-/* $Id: dba.c,v 1.65 2002/11/26 12:05:59 helly Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include config.h
-#endif
-
-#include php.h
-
-#if HAVE_DBA
-
-#include ext/standard/flock_compat.h 
-#include stdio.h 
-#include fcntl.h
-#ifdef HAVE_SYS_FILE_H
-#include sys/file.h
-#endif
- 
-#include php_dba.h
-#include ext/standard/info.h
-#include ext/standard/php_string.h
-
-#include php_gdbm.h
-#include php_ndbm.h
-#include php_dbm.h
-#include php_cdb.h
-#include php_db2.h
-#include php_db3.h
-#include php_db4.h
-#include php_flatfile.h
-
-/* {{{ dba_functions[]
- */
-function_entry dba_functions[] = {
-   PHP_FE(dba_open, NULL)
-   PHP_FE(dba_popen, NULL)
-   PHP_FE(dba_close, NULL)
-   PHP_FE(dba_delete, NULL)
-   PHP_FE(dba_exists, NULL)
-   PHP_FE(dba_fetch, NULL)
-   PHP_FE(dba_insert, NULL)
-   PHP_FE(dba_replace, NULL)
-   PHP_FE(dba_firstkey, NULL)
-   PHP_FE(dba_nextkey, NULL)
-   PHP_FE(dba_optimize, NULL)
-   PHP_FE(dba_sync, NULL)
-   PHP_FE(dba_handlers, NULL)
-   PHP_FE(dba_list, NULL)
-   {NULL, NULL, NULL}
-};
-/* }}} */
-
-PHP_MINIT_FUNCTION(dba);
-PHP_MINFO_FUNCTION(dba);
-
-zend_module_entry dba_module_entry = {
-   STANDARD_MODULE_HEADER,
-   dba,
-   dba_functions, 
-   PHP_MINIT(dba), 
-   NULL,
-   NULL,
-   NULL,
-   PHP_MINFO(dba),
-   NO_VERSION_YET,
-   STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_DBA
-ZEND_GET_MODULE(dba)
-#endif
-
-typedef struct dba_handler {
-   char *name; /* handler name */
-   int flags; /* whether and how dba does locking and other flags*/
-   int (*open)(dba_info *, char **error TSRMLS_DC);
-   void (*close)(dba_info * TSRMLS_DC);
-   char* (*fetch)(dba_info *, char *, int, int, int * TSRMLS_DC);
-   int (*update)(dba_info *, char *, int, char *, int, int TSRMLS_DC);
-   int (*exists)(dba_info *, char *, int TSRMLS_DC);
-   int (*delete)(dba_info *, char *, int TSRMLS_DC);
-   char* (*firstkey)(dba_info *, int * TSRMLS_DC);
-   char* (*nextkey)(dba_info *, int * TSRMLS_DC);
-   int (*optimize)(dba_info * TSRMLS_DC);
-   int (*sync)(dba_info * TSRMLS_DC);
-} dba_handler;
-
-/* {{{ macromania */
-
-#define DBA_ID_PARS   
 \
-   zval **id; 
 \
-   dba_info *info = NULL; 
 \
-   int ac = ZEND_NUM_ARGS()
-
-/* these are used to get the standard arguments */
-
-#define DBA_GET1  
 \
-   if(ac != 1 || zend_get_parameters_ex(ac, id) != SUCCESS) { \
-   WRONG_PARAM_COUNT; 
 \
-   }
-
-#define DBA_GET2  
 \
-   zval **key;
 \
-   if(ac != 2 || zend_get_parameters_ex(ac, key, id) != SUCCESS) {   \
-   WRONG_PARAM_COUNT;

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

2002-12-09 Thread Jani Taskinen
sniper  Mon Dec  9 13:05:37 2002 EDT

  Modified files:  
/php4/ext/cyrus config.m4 
  Log:
  Fix the build with new cyrus and sasl2 libs
  
  
Index: php4/ext/cyrus/config.m4
diff -u php4/ext/cyrus/config.m4:1.8 php4/ext/cyrus/config.m4:1.9
--- php4/ext/cyrus/config.m4:1.8Sun Sep  8 16:59:53 2002
+++ php4/ext/cyrus/config.m4Mon Dec  9 13:05:37 2002
@@ -1,9 +1,9 @@
 dnl
-dnl $Id: config.m4,v 1.8 2002/09/08 20:59:53 jon Exp $
+dnl $Id: config.m4,v 1.9 2002/12/09 18:05:37 sniper Exp $
 dnl
 
 PHP_ARG_WITH(cyrus, for cyrus imap support,
-[  --with-cyrusInclude Cyrus IMAP support])
+[  --with-cyrus[=dir]  Include Cyrus IMAP support])
 
 if test $PHP_CYRUS != no; then
   found_cyrus=no
@@ -19,12 +19,18 @@
 
 if test -r $i/include/sasl.h  test $found_sasl = no; then
   PHP_ADD_INCLUDE($i/include)
-  PHP_ADD_LIBRARY_WITH_PATH(sasl, $i/lib, CYRUS_SHARED_LIBADD)
   found_sasl=yes
 elif test -r $i/include/sasl/sasl.h  test $found_sasl = no; then
   PHP_ADD_INCLUDE($i/include/sasl)
-  PHP_ADD_LIBRARY_WITH_PATH(sasl, $i/lib, CYRUS_SHARED_LIBADD)
   found_sasl=yes
+fi
+
+if test $found_sasl = yes; then
+  if test -f $i/lib/libsasl2.a || test -f $i/lib/libsasl2.$SHLIB_SUFFIX_NAME; then
+PHP_ADD_LIBRARY_WITH_PATH(sasl2, $i/lib, CYRUS_SHARED_LIBADD)
+  else
+PHP_ADD_LIBRARY_WITH_PATH(sasl, $i/lib, CYRUS_SHARED_LIBADD)
+  fi
 fi
 
 if test -r $i/include/openssl/ssl.h  test $found_openssl = no  test 
$PHP_OPENSSL = no; then



-- 
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/dba dba.c

2002-12-09 Thread Marcus Boerger
helly   Mon Dec  9 13:07:23 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/dba   dba.c 
  Log:
  MFH: '-' modifier (bug #20282, #20858)
  
  
Index: php4/ext/dba/dba.c
diff -u php4/ext/dba/dba.c:1.61.2.3 php4/ext/dba/dba.c:1.61.2.4
--- php4/ext/dba/dba.c:1.61.2.3 Fri Nov 22 10:53:00 2002
+++ php4/ext/dba/dba.c  Mon Dec  9 13:07:23 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: dba.c,v 1.61.2.3 2002/11/22 15:53:00 helly Exp $ */
+/* $Id: dba.c,v 1.61.2.4 2002/12/09 18:07:23 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -422,14 +422,22 @@
 */
strlcpy(mode, Z_STRVAL_PP(args[1]), sizeof(mode));
pmode = mode[0];
-   if (pmode[0]  (pmode[1]=='d' || pmode[1]=='l')) { /* force lock on db file 
or lck file */
-   if (pmode[1]=='d') {
+   if (pmode[0]  (pmode[1]=='d' || pmode[1]=='l' || pmode[1]=='-')) { /* force 
+lock on db file or lck file or disable locking */
+   switch (pmode[1]) {
+   case 'd':
if ((hptr-flags  DBA_LOCK_ALL) == 0) {
php_error_docref2(NULL TSRMLS_CC, 
Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_NOTICE, Handler %s does locking 
internally, hptr-name);
}
lock_dbf = 1;
+   /* no break */
+   case 'l':
+   lock_flag = DBA_LOCK_ALL;
+   break;
+   default:
+   case '-':
+   lock_flag = 0;
+   break;
}
-   lock_flag = DBA_LOCK_ALL;
} else {
lock_flag = (hptr-flagsDBA_LOCK_ALL);
}
@@ -459,18 +467,23 @@
lock_mode = 0;
file_mode = ;
}
-   if (*pmode=='d' || *pmode=='l') {
+   if (*pmode=='d' || *pmode=='l' || *pmode=='-') {
pmode++; /* done already - skip here */
}
if (*pmode=='t') {
pmode++;
+   if (!lock_flag) {
+   php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), 
+Z_STRVAL_PP(args[1]), E_WARNING, You cannot combine modifiers - (no lock) and t 
+(test lock), hptr-name);
+   FREENOW;
+   RETURN_FALSE;
+   }
if (!lock_mode) {
if ((hptr-flags  DBA_LOCK_ALL) == 0) {
-   php_error_docref2(NULL TSRMLS_CC, 
Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, Handler %s uses its own 
locking which doesn't support mode modifier t (testing), hptr-name);
+   php_error_docref2(NULL TSRMLS_CC, 
+Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, Handler %s uses its own 
+locking which doesn't support mode modifier t (test lock), hptr-name);
FREENOW;
RETURN_FALSE;
} else {
-   php_error_docref2(NULL TSRMLS_CC, 
Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, Handler %s doesn't uses 
locking for this mode which makes modifier t (testing) obsolete, hptr-name);
+   php_error_docref2(NULL TSRMLS_CC, 
+Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, Handler %s doesn't uses 
+locking for this mode which makes modifier t (test lock) obsolete, hptr-name);
FREENOW;
RETURN_FALSE;
}
@@ -784,3 +797,4 @@
  * vim600: sw=4 ts=4 fdm=marker
  * vim600: sw=4 ts=4
  */
+



-- 
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/curl curlstreams.c

2002-12-09 Thread Wez Furlong
wez Mon Dec  9 13:25:37 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/curl  curlstreams.c 
  Log:
  No need to compile this code if curl streams are not enabled, which they
  cannot be in 4.3 (configure option is disabled and they don't work yet anyway).
  
  
Index: php4/ext/curl/curlstreams.c
diff -u php4/ext/curl/curlstreams.c:1.2 php4/ext/curl/curlstreams.c:1.2.2.1
--- php4/ext/curl/curlstreams.c:1.2 Sun Sep 22 21:47:00 2002
+++ php4/ext/curl/curlstreams.c Mon Dec  9 13:25:37 2002
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: curlstreams.c,v 1.2 2002/09/23 01:47:00 wez Exp $ */
+/* $Id: curlstreams.c,v 1.2.2.1 2002/12/09 18:25:37 wez Exp $ */
 
 /* This file implements cURL based wrappers.
  * NOTE: If you are implementing your own streams that are intended to
@@ -30,7 +30,7 @@
 #include php.h
 #include php_memory_streams.h
 
-#if HAVE_CURL
+#if HAVE_CURL  defined(PHP_CURL_URL_WRAPPERS)
 
 #include stdio.h
 #include string.h



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




[PHP-CVS] cvs: php4(PHP_4_3) / configure.in /ext/zip config.m4 /ext/zlib config0.m4

2002-12-09 Thread Wez Furlong
wez Mon Dec  9 13:28:03 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   configure.in 
/php4/ext/zlib  config0.m4 
/php4/ext/zip   config.m4 
  Log:
  Centralize the fopencookie test.
  
  
Index: php4/configure.in
diff -u php4/configure.in:1.396.2.10 php4/configure.in:1.396.2.11
--- php4/configure.in:1.396.2.10Mon Dec  9 11:22:05 2002
+++ php4/configure.in   Mon Dec  9 13:28:03 2002
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.396.2.10 2002/12/09 16:22:05 wez Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.396.2.11 2002/12/09 18:28:03 wez Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -381,7 +381,7 @@
 #endif
 ])
 
-
+PHP_FOPENCOOKIE
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 dnl -
Index: php4/ext/zlib/config0.m4
diff -u php4/ext/zlib/config0.m4:1.12 php4/ext/zlib/config0.m4:1.12.2.1
--- php4/ext/zlib/config0.m4:1.12   Mon Oct  7 18:27:50 2002
+++ php4/ext/zlib/config0.m4Mon Dec  9 13:28:03 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config0.m4,v 1.12 2002/10/07 22:27:50 rasmus Exp $
+dnl $Id: config0.m4,v 1.12.2.1 2002/12/09 18:28:03 wez Exp $
 dnl
 
 PHP_ARG_WITH(zlib,for ZLIB support,
@@ -50,5 +50,4 @@
   PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD)
   PHP_ADD_INCLUDE($ZLIB_INCDIR)
 
-  PHP_FOPENCOOKIE
 fi
Index: php4/ext/zip/config.m4
diff -u php4/ext/zip/config.m4:1.5 php4/ext/zip/config.m4:1.5.2.1
--- php4/ext/zip/config.m4:1.5  Thu Oct 17 01:06:53 2002
+++ php4/ext/zip/config.m4  Mon Dec  9 13:28:03 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.5 2002/10/17 05:06:53 sniper Exp $
+dnl $Id: config.m4,v 1.5.2.1 2002/12/09 18:28:03 wez Exp $
 dnl 
 
 PHP_ARG_WITH(zip,for ZIP support, 
@@ -33,8 +33,6 @@
 
   PHP_ADD_LIBRARY_WITH_PATH(zzip, $ZZIPLIB_LIBDIR, ZIP_SHARED_LIBADD)
   PHP_ADD_INCLUDE($ZZIPLIB_INCDIR)
-
-  PHP_FOPENCOOKIE
 
   PHP_NEW_EXTENSION(zip, zip.c, $ext_shared)
   PHP_SUBST(ZIP_SHARED_LIBADD)



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




[PHP-CVS] cvs: php4 / configure.in /ext/zip config.m4 /ext/zlib config0.m4

2002-12-09 Thread Wez Furlong
wez Mon Dec  9 13:29:07 2002 EDT

  Modified files:  
/php4   configure.in 
/php4/ext/zlib  config0.m4 
/php4/ext/zip   config.m4 
  Log:
  Centralize fopencookie test
  
  
Index: php4/configure.in
diff -u php4/configure.in:1.405 php4/configure.in:1.406
--- php4/configure.in:1.405 Mon Dec  9 11:14:27 2002
+++ php4/configure.in   Mon Dec  9 13:29:07 2002
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.405 2002/12/09 16:14:27 wez Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.406 2002/12/09 18:29:07 wez Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -381,7 +381,7 @@
 #endif
 ])
 
-
+PHP_FOPENCOOKIE
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 dnl -
Index: php4/ext/zlib/config0.m4
diff -u php4/ext/zlib/config0.m4:1.12 php4/ext/zlib/config0.m4:1.13
--- php4/ext/zlib/config0.m4:1.12   Mon Oct  7 18:27:50 2002
+++ php4/ext/zlib/config0.m4Mon Dec  9 13:29:07 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config0.m4,v 1.12 2002/10/07 22:27:50 rasmus Exp $
+dnl $Id: config0.m4,v 1.13 2002/12/09 18:29:07 wez Exp $
 dnl
 
 PHP_ARG_WITH(zlib,for ZLIB support,
@@ -50,5 +50,4 @@
   PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD)
   PHP_ADD_INCLUDE($ZLIB_INCDIR)
 
-  PHP_FOPENCOOKIE
 fi
Index: php4/ext/zip/config.m4
diff -u php4/ext/zip/config.m4:1.5 php4/ext/zip/config.m4:1.6
--- php4/ext/zip/config.m4:1.5  Thu Oct 17 01:06:53 2002
+++ php4/ext/zip/config.m4  Mon Dec  9 13:29:07 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.5 2002/10/17 05:06:53 sniper Exp $
+dnl $Id: config.m4,v 1.6 2002/12/09 18:29:07 wez Exp $
 dnl 
 
 PHP_ARG_WITH(zip,for ZIP support, 
@@ -33,8 +33,6 @@
 
   PHP_ADD_LIBRARY_WITH_PATH(zzip, $ZZIPLIB_LIBDIR, ZIP_SHARED_LIBADD)
   PHP_ADD_INCLUDE($ZZIPLIB_INCDIR)
-
-  PHP_FOPENCOOKIE
 
   PHP_NEW_EXTENSION(zip, zip.c, $ext_shared)
   PHP_SUBST(ZIP_SHARED_LIBADD)



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




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

2002-12-09 Thread Jani Taskinen
sniper  Mon Dec  9 13:29:23 2002 EDT

  Modified files:  
/php4/ext/cyrus config.m4 
  Log:
  Make this actually work too.
  
  
Index: php4/ext/cyrus/config.m4
diff -u php4/ext/cyrus/config.m4:1.9 php4/ext/cyrus/config.m4:1.10
--- php4/ext/cyrus/config.m4:1.9Mon Dec  9 13:05:37 2002
+++ php4/ext/cyrus/config.m4Mon Dec  9 13:29:22 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.9 2002/12/09 18:05:37 sniper Exp $
+dnl $Id: config.m4,v 1.10 2002/12/09 18:29:22 sniper Exp $
 dnl
 
 PHP_ARG_WITH(cyrus, for cyrus imap support,
@@ -10,13 +10,27 @@
   found_sasl=no
   found_openssl=no
 
-  for i in /usr /usr/local $PHP_CYRUS; do
+  dnl
+  dnl Cyrus
+  dnl
+  for i in $PHP_CYRUS /usr/local /usr; do
 if test -r $i/include/cyrus/imclient.h  test $found_cyrus = no; then
   PHP_ADD_INCLUDE($i/include)
   PHP_ADD_LIBRARY_WITH_PATH(cyrus, $i/lib, CYRUS_SHARED_LIBADD)
   found_cyrus=yes
+  break 2
 fi
+  done
+
+  if test $found_cyrus = no; then
+AC_MSG_RESULT(not found)
+AC_MSG_ERROR(Please Re-install the cyrus distribution)
+  fi
 
+  dnk
+  dnl sasl/sasl2 
+  dnl
+  for i in $PHP_CYRUS /usr/local /usr; do
 if test -r $i/include/sasl.h  test $found_sasl = no; then
   PHP_ADD_INCLUDE($i/include)
   found_sasl=yes
@@ -31,25 +45,28 @@
   else
 PHP_ADD_LIBRARY_WITH_PATH(sasl, $i/lib, CYRUS_SHARED_LIBADD)
   fi
-fi
-
-if test -r $i/include/openssl/ssl.h  test $found_openssl = no  test 
$PHP_OPENSSL = no; then
-  PHP_ADD_LIBRARY_WITH_PATH(ssl, $i/lib, CYRUS_SHARED_LIBADD)
-  PHP_ADD_LIBRARY_WITH_PATH(crypto, $i/lib, CYRUS_SHARED_LIBADD)
-  found_openssl=yes
+  break 2
 fi
   done
-
-  if test $found_cyrus = no; then
-AC_MSG_RESULT(not found)
-AC_MSG_ERROR(Please Re-install the cyrus distribution)
-  fi
-
+  
   if test $found_sasl = no; then
 AC_MSG_RESULT(sasl not found)
 AC_MSG_ERROR(Please Re-install the cyrus distribution)
   fi
 
+  dnk
+  dnl OpenSSL
+  dnl
+  if test $PHP_OPENSSL = no; then
+for i in $PHP_CYRUS /usr/local /usr; do
+  if test -r $i/include/openssl/ssl.h; then
+PHP_ADD_LIBRARY_WITH_PATH(ssl, $i/lib, CYRUS_SHARED_LIBADD)
+PHP_ADD_LIBRARY_WITH_PATH(crypto, $i/lib, CYRUS_SHARED_LIBADD)
+break 2
+  fi
+done
+  fi
+  
   PHP_NEW_EXTENSION(cyrus, cyrus.c, $ext_shared)
   PHP_SUBST(CYRUS_SHARED_LIBADD)
   AC_DEFINE(HAVE_CYRUS,1,[ ])



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




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

2002-12-09 Thread Jani Taskinen
sniper  Mon Dec  9 13:30:51 2002 EDT

  Modified files:  
/php4/ext/cyrus config.m4 
  Log:
  fix typos
  
  
Index: php4/ext/cyrus/config.m4
diff -u php4/ext/cyrus/config.m4:1.10 php4/ext/cyrus/config.m4:1.11
--- php4/ext/cyrus/config.m4:1.10   Mon Dec  9 13:29:22 2002
+++ php4/ext/cyrus/config.m4Mon Dec  9 13:30:50 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.10 2002/12/09 18:29:22 sniper Exp $
+dnl $Id: config.m4,v 1.11 2002/12/09 18:30:50 sniper Exp $
 dnl
 
 PHP_ARG_WITH(cyrus, for cyrus imap support,
@@ -27,7 +27,7 @@
 AC_MSG_ERROR(Please Re-install the cyrus distribution)
   fi
 
-  dnk
+  dnl
   dnl sasl/sasl2 
   dnl
   for i in $PHP_CYRUS /usr/local /usr; do
@@ -54,7 +54,7 @@
 AC_MSG_ERROR(Please Re-install the cyrus distribution)
   fi
 
-  dnk
+  dnl
   dnl OpenSSL
   dnl
   if test $PHP_OPENSSL = no; then



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




Re: [PHP-CVS] cvs: php4 /ext/dba dba.c

2002-12-09 Thread Sascha Schumann
On Mon, 9 Dec 2002, Marcus Boerger wrote:

 helly Mon Dec  9 13:03:01 2002 EDT

   Modified files:
 /php4/ext/dba dba.c
   Log:
   Recheckin as unix
   # *** sorry ** a new diff tool converted it to dos before last comit *** sorry ***

That's why you should run a 'cvs diff' _always_ before any
commit.  There is no exception for that rule.

- Sascha

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




Re: [PHP-CVS] cvs: php4 /ext/dba dba.c

2002-12-09 Thread Marcus Börger
At 19:38 09.12.2002, Sascha Schumann wrote:

On Mon, 9 Dec 2002, Marcus Boerger wrote:

 helly Mon Dec  9 13:03:01 2002 EDT

   Modified files:
 /php4/ext/dba dba.c
   Log:
   Recheckin as unix
   # *** sorry ** a new diff tool converted it to dos before last comit 
*** sorry ***

That's why you should run a 'cvs diff' _always_ before any
commit.  There is no exception for that rule.

- Sascha

In this special case that was the problem. I removed a part which i did not
want to commit yet in the diff and that resulted in changing the file to dos.
When you use wincvs you are alloed to do so by using an external diff tool
and calling it in the commit dialog.

marcus


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




[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2002-12-09 Thread Ilia Alshanetsky
iliaa   Mon Dec  9 13:45:32 2002 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  Replaced deprecated APR_BRIGADE_FOREACH macro.
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.92 
php4/sapi/apache2filter/sapi_apache2.c:1.93
--- php4/sapi/apache2filter/sapi_apache2.c:1.92 Tue Nov 26 00:57:02 2002
+++ php4/sapi/apache2filter/sapi_apache2.c  Mon Dec  9 13:45:32 2002
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.92 2002/11/26 05:57:02 sniper Exp $ */
+/* $Id: sapi_apache2.c,v 1.93 2002/12/09 18:45:32 iliaa Exp $ */
 
 #include fcntl.h
 
@@ -328,7 +328,7 @@
return rv;
}
 
-   APR_BRIGADE_FOREACH(b, bb) {
+   for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = 
+APR_BUCKET_NEXT(b)) {
apr_bucket_read(b, str, n, 1);
if (n  0) {
old_index = ctx-post_len;
@@ -415,7 +415,7 @@
return ap_pass_brigade(f-next, bb);
}
 
-   APR_BRIGADE_FOREACH(b, bb) {
+   for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = 
+APR_BUCKET_NEXT(b)) {
zend_file_handle zfd;
 
if (!ctx-request_processed  APR_BUCKET_IS_FILE(b)) {



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




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

2002-12-09 Thread Ilia Alshanetsky
iliaa   Mon Dec  9 19:10:28 2002 EDT

  Modified files:  
/php4/ext/exif  exif.c 
  Log:
  Fixed bug #20907, patch by [EMAIL PROTECTED]
  
  
Index: php4/ext/exif/exif.c
diff -u php4/ext/exif/exif.c:1.123 php4/ext/exif/exif.c:1.124
--- php4/ext/exif/exif.c:1.123  Tue Nov 26 21:42:41 2002
+++ php4/ext/exif/exif.cMon Dec  9 19:10:27 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: exif.c,v 1.123 2002/11/27 02:42:41 helly Exp $ */
+/* $Id: exif.c,v 1.124 2002/12/10 00:10:27 iliaa Exp $ */
 
 /*  ToDos
  *
@@ -89,7 +89,7 @@
 };
 /* }}} */
 
-#define EXIF_VERSION 1.4 $Id: exif.c,v 1.123 2002/11/27 02:42:41 helly Exp $
+#define EXIF_VERSION 1.4 $Id: exif.c,v 1.124 2002/12/10 00:10:27 iliaa Exp $
 
 /* {{{ PHP_MINFO_FUNCTION
  */
@@ -765,8 +765,8 @@
   { 0x, GPSVersion},
   { 0x0001, GPSLatitudeRef},
   { 0x0002, GPSLatitude},
-  { 0x0003, GPSLongitude},
-  { 0x0004, GPSLongitudeRef},
+  { 0x0003, GPSLongitudeRef},
+  { 0x0004, GPSLongitude},
   { 0x0005, GPSAltitudeRef},
   { 0x0006, GPSAltitude},
   { 0x0007, GPSTimeStamp},
@@ -1520,6 +1520,7 @@
 static void exif_iif_add_value(image_info_type *image_info, int section_index, char 
*name, int tag, int format, size_t length, void* value, int motorola_intel TSRMLS_DC)
 {
size_t index;
+   void *vptr;
image_info_value *info_value;
image_info_data  *info_data;
image_info_data  *list;
@@ -1614,35 +1615,35 @@
} else {
info_value = info_data-value;
}
-   for (index=0; indexlength; index++) {
+   for (index=0,vptr=value; indexlength; 
+index++,vptr+=php_tiff_bytes_per_format[format]) {
if (length1) {
info_value = info_data-value.list[index];
}
switch (format) {
case TAG_FMT_USHORT:
-   info_value-u = php_ifd_get16u(value, 
motorola_intel);
+   info_value-u = php_ifd_get16u(vptr, 
+motorola_intel);
break;
 
case TAG_FMT_ULONG:
-   info_value-u = php_ifd_get32u(value, 
motorola_intel);
+   info_value-u = php_ifd_get32u(vptr, 
+motorola_intel);
break;
 
case TAG_FMT_URATIONAL:
-   info_value-ur.num = 
php_ifd_get32u(value, motorola_intel);
-   info_value-ur.den = 
php_ifd_get32u(4+(char *)value, motorola_intel);
+   info_value-ur.num = 
+php_ifd_get32u(vptr, motorola_intel);
+   info_value-ur.den = 
+php_ifd_get32u(4+(char *)vptr, motorola_intel);
break;
 
case TAG_FMT_SSHORT:
-   info_value-i = php_ifd_get16s(value, 
motorola_intel);
+   info_value-i = php_ifd_get16s(vptr, 
+motorola_intel);
break;
 
case TAG_FMT_SLONG:
-   info_value-i = php_ifd_get32s(value, 
motorola_intel);
+   info_value-i = php_ifd_get32s(vptr, 
+motorola_intel);
break;
 
case TAG_FMT_SRATIONAL:
-   info_value-sr.num = 
php_ifd_get32u(value, motorola_intel);
-   info_value-sr.den = 
php_ifd_get32u(4+(char *)value, motorola_intel);
+   info_value-sr.num = 
+php_ifd_get32u(vptr, motorola_intel);
+   info_value-sr.den = 
+php_ifd_get32u(4+(char *)vptr, motorola_intel);
break;
 
case TAG_FMT_SINGLE:



-- 
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/exif exif.c

2002-12-09 Thread Ilia Alshanetsky
iliaa   Mon Dec  9 19:10:37 2002 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/exif  exif.c 
  Log:
  MFH
  
  
Index: php4/ext/exif/exif.c
diff -u php4/ext/exif/exif.c:1.118.2.3 php4/ext/exif/exif.c:1.118.2.4
--- php4/ext/exif/exif.c:1.118.2.3  Tue Nov 26 21:43:21 2002
+++ php4/ext/exif/exif.cMon Dec  9 19:10:37 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: exif.c,v 1.118.2.3 2002/11/27 02:43:21 helly Exp $ */
+/* $Id: exif.c,v 1.118.2.4 2002/12/10 00:10:37 iliaa Exp $ */
 
 /*  ToDos
  *
@@ -89,7 +89,7 @@
 };
 /* }}} */
 
-#define EXIF_VERSION 1.4 $Id: exif.c,v 1.118.2.3 2002/11/27 02:43:21 helly Exp $
+#define EXIF_VERSION 1.4 $Id: exif.c,v 1.118.2.4 2002/12/10 00:10:37 iliaa Exp $
 
 /* {{{ PHP_MINFO_FUNCTION
  */
@@ -765,8 +765,8 @@
   { 0x, GPSVersion},
   { 0x0001, GPSLatitudeRef},
   { 0x0002, GPSLatitude},
-  { 0x0003, GPSLongitude},
-  { 0x0004, GPSLongitudeRef},
+  { 0x0003, GPSLongitudeRef},
+  { 0x0004, GPSLongitude},
   { 0x0005, GPSAltitudeRef},
   { 0x0006, GPSAltitude},
   { 0x0007, GPSTimeStamp},
@@ -1520,6 +1520,7 @@
 static void exif_iif_add_value(image_info_type *image_info, int section_index, char 
*name, int tag, int format, size_t length, void* value, int motorola_intel TSRMLS_DC)
 {
size_t index;
+   void *vptr;
image_info_value *info_value;
image_info_data  *info_data;
image_info_data  *list;
@@ -1604,35 +1605,35 @@
} else {
info_value = info_data-value;
}
-   for (index=0; indexlength; index++) {
+   for (index=0,vptr=value; indexlength; 
+index++,vptr+=php_tiff_bytes_per_format[format]) {
if (length1) {
info_value = info_data-value.list[index];
}
switch (format) {
case TAG_FMT_USHORT:
-   info_value-u = php_ifd_get16u(value, 
motorola_intel);
+   info_value-u = php_ifd_get16u(vptr, 
+motorola_intel);
break;
 
case TAG_FMT_ULONG:
-   info_value-u = php_ifd_get32u(value, 
motorola_intel);
+   info_value-u = php_ifd_get32u(vptr, 
+motorola_intel);
break;
 
case TAG_FMT_URATIONAL:
-   info_value-ur.num = 
php_ifd_get32u(value, motorola_intel);
-   info_value-ur.den = 
php_ifd_get32u(4+(char *)value, motorola_intel);
+   info_value-ur.num = 
+php_ifd_get32u(vptr, motorola_intel);
+   info_value-ur.den = 
+php_ifd_get32u(4+(char *)vptr, motorola_intel);
break;
 
case TAG_FMT_SSHORT:
-   info_value-i = php_ifd_get16s(value, 
motorola_intel);
+   info_value-i = php_ifd_get16s(vptr, 
+motorola_intel);
break;
 
case TAG_FMT_SLONG:
-   info_value-i = php_ifd_get32s(value, 
motorola_intel);
+   info_value-i = php_ifd_get32s(vptr, 
+motorola_intel);
break;
 
case TAG_FMT_SRATIONAL:
-   info_value-sr.num = 
php_ifd_get32u(value, motorola_intel);
-   info_value-sr.den = 
php_ifd_get32u(4+(char *)value, motorola_intel);
+   info_value-sr.num = 
+php_ifd_get32u(vptr, motorola_intel);
+   info_value-sr.den = 
+php_ifd_get32u(4+(char *)vptr, motorola_intel);
break;
 
case TAG_FMT_SINGLE:



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