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

2003-01-01 Thread Wez Furlong
wez Wed Jan  1 04:55:38 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4   acinclude.m4 configure.in 
/php4/main  streams.c 
  Log:
  Workaround a bug in glibc 2.2.9x and later that causes it not to seek to EOF
  for stdio streams opened with a mode of a+.
  
  
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.218.2.2 php4/acinclude.m4:1.218.2.3
--- php4/acinclude.m4:1.218.2.2 Sun Nov 17 14:28:57 2002
+++ php4/acinclude.m4   Wed Jan  1 04:55:38 2003
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.218.2.2 2002/11/17 19:28:57 wez Exp $
+dnl $Id: acinclude.m4,v 1.218.2.3 2003/01/01 09:55:38 wez Exp $
 dnl
 dnl This file contains local autoconf functions.
 
@@ -1461,6 +1461,45 @@
 AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC])
   fi
 ])
+
+AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND],[
+  AC_MSG_CHECKING([for broken libc stdio])
+  AC_TRY_RUN([
+#include stdio.h
+int main(int argc, char *argv[])
+{
+  FILE *fp;
+  long position;
+  char *filename = /tmp/phpglibccheck;
+  
+  fp = fopen(filename, w);
+  if (fp == NULL) {
+ perror(fopen);
+ exit(2);
+  }
+  fputs(foobar, fp);
+  fclose(fp);
+
+  fp = fopen(filename, a+);
+  position = ftell(fp);
+  fclose(fp);
+  unlink(filename);
+  if (position == 0)
+   return 1;
+  return 0;
+}
+],
+[have_broken_glibc_fopen_append=no],
+[have_broken_glibc_fopen_append=yes ])
+
+  if test $have_broken_glibc_fopen_append = yes; then
+   AC_MSG_RESULT(yes)
+   AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on 
+fopen with mode a+])
+  else
+   AC_MSG_RESULT(no)
+  fi
+])
+
 
 AC_DEFUN([PHP_FOPENCOOKIE],[
AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
Index: php4/configure.in
diff -u php4/configure.in:1.396.2.20 php4/configure.in:1.396.2.21
--- php4/configure.in:1.396.2.20Fri Dec 27 17:11:40 2002
+++ php4/configure.in   Wed Jan  1 04:55:38 2003
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.396.2.20 2002/12/27 22:11:40 edink Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.396.2.21 2003/01/01 09:55:38 wez Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -382,6 +382,7 @@
 ])
 
 PHP_FOPENCOOKIE
+PHP_BROKEN_GLIBC_FOPEN_APPEND
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 dnl -
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.125.2.24 php4/main/streams.c:1.125.2.25
--- php4/main/streams.c:1.125.2.24  Tue Dec 31 11:26:28 2002
+++ php4/main/streams.c Wed Jan  1 04:55:38 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.125.2.24 2002/12/31 16:26:28 sebastian Exp $ */
+/* $Id: streams.c,v 1.125.2.25 2003/01/01 09:55:38 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1317,6 +1317,12 @@

stream = php_stream_alloc_rel(php_stream_stdio_ops, self, 0, mode);
 
+#ifdef HAVE_BROKEN_GLIBC_FOPEN_APPEND
+   if (strchr(mode, 'a')) {
+   fseek(file, 0, SEEK_END);
+   }
+#endif
+   
if (stream) {
if (self-is_pipe) {
stream-flags |= PHP_STREAM_FLAG_NO_SEEK;
@@ -2417,7 +2423,7 @@
}
}
 
-   if (stream  stream-ops-seek  (stream-flags  PHP_STREAM_FLAG_NO_SEEK) 
== 0  strchr(mode, 'a')) {
+   if (stream  stream-ops-seek  (stream-flags  PHP_STREAM_FLAG_NO_SEEK) 
+== 0  strchr(mode, 'a')  stream-position == 0) {
off_t newpos = 0;
 
/* if opened for append, we need to revise our idea of the initial 
file position */



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




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

2003-01-01 Thread Wez Furlong
wez Wed Jan  1 04:58:17 2003 EDT

  Modified files:  
/php4   acinclude.m4 configure.in 
/php4/main  streams.c 
  Log:
  Workaround for glibc 2.2.9x and later a+ bug that does not seek to EOF for
  files fopen()ed with that mode.
  
  
  
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.221 php4/acinclude.m4:1.222
--- php4/acinclude.m4:1.221 Mon Nov 18 06:39:41 2002
+++ php4/acinclude.m4   Wed Jan  1 04:58:16 2003
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.221 2002/11/18 11:39:41 wez Exp $
+dnl $Id: acinclude.m4,v 1.222 2003/01/01 09:58:16 wez Exp $
 dnl
 dnl This file contains local autoconf functions.
 
@@ -1454,6 +1454,45 @@
 AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC])
   fi
 ])
+
+AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND],[
+  AC_MSG_CHECKING([for broken libc stdio])
+  AC_TRY_RUN([
+#include stdio.h
+int main(int argc, char *argv[])
+{
+  FILE *fp;
+  long position;
+  char *filename = /tmp/phpglibccheck;
+  
+  fp = fopen(filename, w);
+  if (fp == NULL) {
+ perror(fopen);
+ exit(2);
+  }
+  fputs(foobar, fp);
+  fclose(fp);
+
+  fp = fopen(filename, a+);
+  position = ftell(fp);
+  fclose(fp);
+  unlink(filename);
+  if (position == 0)
+   return 1;
+  return 0;
+}
+],
+[have_broken_glibc_fopen_append=no],
+[have_broken_glibc_fopen_append=yes ])
+
+  if test $have_broken_glibc_fopen_append = yes; then
+   AC_MSG_RESULT(yes)
+   AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on 
+fopen with mode a+])
+  else
+   AC_MSG_RESULT(no)
+  fi
+])
+
 
 AC_DEFUN([PHP_FOPENCOOKIE],[
AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
Index: php4/configure.in
diff -u php4/configure.in:1.409 php4/configure.in:1.410
--- php4/configure.in:1.409 Thu Dec 19 12:02:39 2002
+++ php4/configure.in   Wed Jan  1 04:58:16 2003
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.409 2002/12/19 17:02:39 edink Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.410 2003/01/01 09:58:16 wez Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -382,6 +382,7 @@
 ])
 
 PHP_FOPENCOOKIE
+PHP_BROKEN_GLIBC_FOPEN_APPEND
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 dnl -
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.139 php4/main/streams.c:1.140
--- php4/main/streams.c:1.139   Tue Dec 31 10:58:54 2002
+++ php4/main/streams.c Wed Jan  1 04:58:17 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.139 2002/12/31 15:58:54 sebastian Exp $ */
+/* $Id: streams.c,v 1.140 2003/01/01 09:58:17 wez Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1317,6 +1317,12 @@

stream = php_stream_alloc_rel(php_stream_stdio_ops, self, 0, mode);
 
+#ifdef HAVE_BROKEN_GLIBC_FOPEN_APPEND
+   if (strchr(mode, 'a')) {
+   fseek(file, 0, SEEK_END);
+   }
+#endif
+   
if (stream) {
if (self-is_pipe) {
stream-flags |= PHP_STREAM_FLAG_NO_SEEK;
@@ -2417,7 +2423,7 @@
}
}
 
-   if (stream  stream-ops-seek  (stream-flags  PHP_STREAM_FLAG_NO_SEEK) 
== 0  strchr(mode, 'a')) {
+   if (stream  stream-ops-seek  (stream-flags  PHP_STREAM_FLAG_NO_SEEK) 
+== 0  strchr(mode, 'a')  stream-position == 0) {
off_t newpos = 0;
 
/* if opened for append, we need to revise our idea of the initial 
file position */



-- 
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 config.m4 filters.c php_standard.h php_string.h string.c user_filters.c /ext/standard/tests/file userfilters.phpt

2003-01-01 Thread Wez Furlong
wez Wed Jan  1 06:04:45 2003 EDT

  Added files: 
/php4/ext/standard  filters.c 

  Modified files:  
/php4/ext/standard  basic_functions.c config.m4 php_standard.h 
php_string.h string.c user_filters.c 
/php4/ext/standard/tests/file   userfilters.phpt 
  Log:
  Move rot13 filter into a new filters.c source file.
  Tidy up some other filter related code.
  
  # win32 - someone please add user_filters.c and filters.c to the .dsp
  
  
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.551 
php4/ext/standard/basic_functions.c:1.552
--- php4/ext/standard/basic_functions.c:1.551   Tue Dec 31 13:39:29 2002
+++ php4/ext/standard/basic_functions.c Wed Jan  1 06:04:43 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.551 2002/12/31 18:39:29 wez Exp $ */
+/* $Id: basic_functions.c,v 1.552 2003/01/01 11:04:43 wez Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -1031,7 +1031,7 @@
PHP_MINIT(file) (INIT_FUNC_ARGS_PASSTHRU);
PHP_MINIT(pack) (INIT_FUNC_ARGS_PASSTHRU);
PHP_MINIT(browscap) (INIT_FUNC_ARGS_PASSTHRU);
-   PHP_MINIT(string_filters) (INIT_FUNC_ARGS_PASSTHRU);
+   PHP_MINIT(standard_filters) (INIT_FUNC_ARGS_PASSTHRU);
PHP_MINIT(user_filters) (INIT_FUNC_ARGS_PASSTHRU);
 
 #if defined(HAVE_LOCALECONV)  defined(ZTS)
@@ -1104,7 +1104,7 @@
PHP_MSHUTDOWN(assert) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
PHP_MSHUTDOWN(url_scanner_ex) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
PHP_MSHUTDOWN(file) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
-   PHP_MSHUTDOWN(string_filters) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
+   PHP_MSHUTDOWN(standard_filters) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
 #if defined(HAVE_LOCALECONV)  defined(ZTS)
PHP_MSHUTDOWN(localeconv) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
 #endif
Index: php4/ext/standard/config.m4
diff -u php4/ext/standard/config.m4:1.49 php4/ext/standard/config.m4:1.50
--- php4/ext/standard/config.m4:1.49Tue Dec 31 13:39:35 2002
+++ php4/ext/standard/config.m4 Wed Jan  1 06:04:44 2003
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.49 2002/12/31 18:39:35 wez Exp $ -*- sh -*-
+dnl $Id: config.m4,v 1.50 2003/01/01 11:04:44 wez Exp $ -*- sh -*-
 
 divert(3)dnl
 
@@ -255,6 +255,7 @@
 url_scanner.c var.c versioning.c assert.c strnatcmp.c 
levenshtein.c \
 incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
 http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
-var_unserializer.c ftok.c aggregation.c sha1.c 
user_filters.c )
+var_unserializer.c ftok.c aggregation.c sha1.c 
+user_filters.c \
+   filters.c )
 
 PHP_ADD_MAKEFILE_FRAGMENT
Index: php4/ext/standard/php_standard.h
diff -u php4/ext/standard/php_standard.h:1.17 php4/ext/standard/php_standard.h:1.18
--- php4/ext/standard/php_standard.h:1.17   Tue Dec 31 11:07:53 2002
+++ php4/ext/standard/php_standard.hWed Jan  1 06:04:44 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_standard.h,v 1.17 2002/12/31 16:07:53 sebastian Exp $ */
+/* $Id: php_standard.h,v 1.18 2003/01/01 11:04:44 wez Exp $ */
 
 #include basic_functions.h
 #include php_math.h
@@ -62,6 +62,9 @@
 #include aggregation.h
 
 #define phpext_standard_ptr basic_functions_module_ptr
+PHP_MINIT_FUNCTION(standard_filters);
+PHP_MSHUTDOWN_FUNCTION(standard_filters);
+
 
 /*
  * Local variables:
Index: php4/ext/standard/php_string.h
diff -u php4/ext/standard/php_string.h:1.66 php4/ext/standard/php_string.h:1.67
--- php4/ext/standard/php_string.h:1.66 Tue Dec 31 11:07:53 2002
+++ php4/ext/standard/php_string.h  Wed Jan  1 06:04:44 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: php_string.h,v 1.66 2002/12/31 16:07:53 sebastian Exp $ */
+/* $Id: php_string.h,v 1.67 2003/01/01 11:04:44 wez Exp $ */
 
 /* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
 
@@ -90,9 +90,6 @@
 #if HAVE_STRFMON
 PHP_FUNCTION(money_format);
 #endif
-
-PHP_MINIT_FUNCTION(string_filters);
-PHP_MSHUTDOWN_FUNCTION(string_filters);
 
 #if defined(HAVE_LOCALECONV)  defined(ZTS)
 PHP_MINIT_FUNCTION(localeconv);
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.340 php4/ext/standard/string.c:1.341
--- php4/ext/standard/string.c:1.340Tue Dec 31 11:07:55 2002
+++ php4/ext/standard/string.c  Wed Jan  1 06:04:44 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.340 2002/12/31 16:07:55 sebastian Exp $ */
+/* $Id: string.c,v 1.341 2003/01/01 11:04:44 wez Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -4166,82 

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

2003-01-01 Thread Wez Furlong
wez Wed Jan  1 06:21:40 2003 EDT

  Modified files:  
/php4/ext/standard  filters.c 
  Log:
  Tidy up
  
  
Index: php4/ext/standard/filters.c
diff -u php4/ext/standard/filters.c:1.1 php4/ext/standard/filters.c:1.2
--- php4/ext/standard/filters.c:1.1 Wed Jan  1 06:04:44 2003
+++ php4/ext/standard/filters.c Wed Jan  1 06:21:40 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: filters.c,v 1.1 2003/01/01 11:04:44 wez Exp $ */
+/* $Id: filters.c,v 1.2 2003/01/01 11:21:40 wez Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -97,9 +97,11 @@
php_stream_filter_factory *factory;
 } standard_filters[] = {
{ strfilter_rot13_ops, strfilter_rot13_factory },
+   /* additional filters to go here */
{ NULL, NULL }
 };
 
+/* {{{ filter MINIT and MSHUTDOWN */
 PHP_MINIT_FUNCTION(standard_filters)
 {
int i;
@@ -112,7 +114,6 @@
return FAILURE;
}
}
-
return SUCCESS;
 }
 
@@ -125,6 +126,7 @@
}
return SUCCESS;
 }
+/* }}} */
 
 /*
  * Local variables:



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




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

2003-01-01 Thread Sebastian Bergmann
sebastian   Wed Jan  1 07:36:06 2003 EDT

  Modified files:  
/php4/ext/standard  filters.c user_filters.c 
  Log:
  Fix warnings.
  
Index: php4/ext/standard/filters.c
diff -u php4/ext/standard/filters.c:1.2 php4/ext/standard/filters.c:1.3
--- php4/ext/standard/filters.c:1.2 Wed Jan  1 06:21:40 2003
+++ php4/ext/standard/filters.c Wed Jan  1 07:36:06 2003
@@ -17,12 +17,13 @@
+--+
 */
 
-/* $Id: filters.c,v 1.2 2003/01/01 11:21:40 wez Exp $ */
+/* $Id: filters.c,v 1.3 2003/01/01 12:36:06 sebastian Exp $ */
 
 #include php.h
 #include php_globals.h
 #include ext/standard/basic_functions.h
 #include ext/standard/file.h
+#include ext/standard/php_string.h
 
 /* {{{ rot13 stream filter implementation */
 static char rot13_from[] = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ;
Index: php4/ext/standard/user_filters.c
diff -u php4/ext/standard/user_filters.c:1.2 php4/ext/standard/user_filters.c:1.3
--- php4/ext/standard/user_filters.c:1.2Wed Jan  1 06:04:44 2003
+++ php4/ext/standard/user_filters.cWed Jan  1 07:36:06 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: user_filters.c,v 1.2 2003/01/01 11:04:44 wez Exp $ */
+/* $Id: user_filters.c,v 1.3 2003/01/01 12:36:06 sebastian Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -324,7 +324,6 @@
zval *obj, *zfilter;
zval func_name;
zval *retval = NULL;
-   zval **tmp; 

/* some sanity checks */
if (persistent) {



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




[PHP-CVS] cvs: php4 /win32 php4dll.dsp php4dllts.dsp

2003-01-01 Thread Sebastian Bergmann
sebastian   Wed Jan  1 07:36:43 2003 EDT

  Modified files:  
/php4/win32 php4dll.dsp php4dllts.dsp 
  Log:
  Add filter.c, user_filters.c. Group stream related sources.
  
Index: php4/win32/php4dll.dsp
diff -u php4/win32/php4dll.dsp:1.38 php4/win32/php4dll.dsp:1.39
--- php4/win32/php4dll.dsp:1.38 Wed Nov 13 16:29:55 2002
+++ php4/win32/php4dll.dsp  Wed Jan  1 07:36:42 2003
@@ -217,15 +217,27 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\main\strlcat.c
+SOURCE=..\main\memory_streams.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\main\strlcpy.c
+SOURCE=..\main\user_streams.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\main\user_streams.c
+SOURCE=..\ext\standard\filters.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\user_filters.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\strlcat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\strlcpy.c
 # End Source File
 # End Group
 # Begin Group Header Files
Index: php4/win32/php4dllts.dsp
diff -u php4/win32/php4dllts.dsp:1.93 php4/win32/php4dllts.dsp:1.94
--- php4/win32/php4dllts.dsp:1.93   Sun Dec 29 10:42:55 2002
+++ php4/win32/php4dllts.dspWed Jan  1 07:36:43 2003
@@ -178,10 +178,6 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\main\memory_streams.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\main\mergesort.c
 # End Source File
 # Begin Source File
@@ -250,15 +246,27 @@
 # End Source File
 # Begin Source File
 
-SOURCE=..\main\strlcat.c
+SOURCE=..\main\memory_streams.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\main\strlcpy.c
+SOURCE=..\main\user_streams.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\main\user_streams.c
+SOURCE=..\ext\standard\filters.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\user_filters.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\strlcat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\strlcpy.c
 # End Source File
 # End Group
 # Begin Group Header Files



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




[PHP-CVS] cvs: php4 /tests/run-test test005.phpt test008.phpt

2003-01-01 Thread Derick Rethans
derick  Wed Jan  1 07:44:00 2003 EDT

  Added files: 
/php4/tests/run-testtest008.phpt 

  Modified files:  
/php4/tests/run-testtest005.phpt 
  Log:
  - Fix tests if Zend Optimizer is loaded
  
  
Index: php4/tests/run-test/test005.phpt
diff -u php4/tests/run-test/test005.phpt:1.1 php4/tests/run-test/test005.phpt:1.2
--- php4/tests/run-test/test005.phpt:1.1Mon Nov  4 05:43:22 2002
+++ php4/tests/run-test/test005.phptWed Jan  1 07:43:59 2003
@@ -1,5 +1,9 @@
 --TEST--
-Error message handling
+Error message handling (without ZendOptimizer)
+--SKIPIF--
+?php
+!extension_loaded(Zend Optimizer) or die(skip Zend Optimizer is loaded);
+?
 --FILE--
 ?php
 // If this test fails ask the developers of run-test.php

Index: php4/tests/run-test/test008.phpt
+++ php4/tests/run-test/test008.phpt
--TEST--
Error message handling (with ZendOptimizer)
--SKIPIF--
?php
extension_loaded(Zend Optimizer) or die(skip Zend Optimizer is loaded);
?
--FILE--
?php
// If this test fails ask the developers of run-test.php
//
// We check the general ini settings which affect error handling
// and than verify if a message is given by a division by zero.
// EXPECTF is used here since the error format may change but ut 
// should always contain 'Division by zero'.
var_dump(ini_get('display_errors'));
var_dump(ini_get('error_reporting'));
var_dump(ini_get('log_errors'));
var_dump(ini_get('track_errors'));
ini_set('display_errors', 0);
var_dump(ini_get('display_errors'));
var_dump($php_errormsg);
$error = 1 / 0;
var_dump($php_errormsg);
?
--EXPECTF--
%s: %sivision by zero in %s on line %d
string(1) 1
string(4) 2047
string(1) 0
string(1) 1
string(1) 0
string(%d) %sivision by zer%s
string(%d) %sivision by zer%s



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




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

2003-01-01 Thread Zeev Suraski
zeevWed Jan  1 08:26:17 2003 EDT

  Modified files:  
/php4/ext/standard  browscap.c incomplete_class.c 
  Log:
  build fixes
  
  
Index: php4/ext/standard/browscap.c
diff -u php4/ext/standard/browscap.c:1.63 php4/ext/standard/browscap.c:1.64
--- php4/ext/standard/browscap.c:1.63   Tue Dec 31 11:07:34 2002
+++ php4/ext/standard/browscap.cWed Jan  1 08:26:17 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: browscap.c,v 1.63 2002/12/31 16:07:34 sebastian Exp $ */
+/* $Id: browscap.c,v 1.64 2003/01/01 13:26:17 zeev Exp $ */
 
 #include php.h
 #include php_regex.h
@@ -35,6 +35,8 @@
 static void browscap_entry_dtor(zval *pvalue)
 {
if (Z_TYPE_P(pvalue) == IS_OBJECT) {
+   TSRMLS_FETCH();
+
zend_hash_destroy(Z_OBJPROP_P(pvalue));
free(Z_OBJPROP_P(pvalue));
}
@@ -102,6 +104,7 @@
if (current_section  arg2) {
zval *new_property;
char *new_key;
+   TSRMLS_FETCH();
 
new_property = (zval *) malloc(sizeof(zval));
INIT_PZVAL(new_property);
@@ -189,6 +192,7 @@
regex_t r;
char *lookup_browser_name = va_arg(args, char *);
zval **found_browser_entry = va_arg(args, zval **);
+   TSRMLS_FETCH();
 
if (*found_browser_entry) { /* already found */
return 0;
Index: php4/ext/standard/incomplete_class.c
diff -u php4/ext/standard/incomplete_class.c:1.16 
php4/ext/standard/incomplete_class.c:1.17
--- php4/ext/standard/incomplete_class.c:1.16   Tue Dec 31 11:07:43 2002
+++ php4/ext/standard/incomplete_class.cWed Jan  1 08:26:17 2003
@@ -17,7 +17,7 @@
  */
 
 
-/* $Id: incomplete_class.c,v 1.16 2002/12/31 16:07:43 sebastian Exp $ */
+/* $Id: incomplete_class.c,v 1.17 2003/01/01 13:26:17 zeev Exp $ */
 
 #include php.h
 #include basic_functions.h
@@ -107,6 +107,7 @@
zval **val;
char *retval = NULL;
HashTable *object_properties;
+   TSRMLS_FETCH();
 
object_properties = Z_OBJPROP_P(object);
 
@@ -129,6 +130,7 @@
 void php_store_class_name(zval *object, const char *name, size_t len)
 {
zval *val;
+   TSRMLS_FETCH();
 
MAKE_STD_ZVAL(val);
 



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