[PHP-CVS] cvs: php4 /ext/dbase dbf_rec.c /ext/oci8 oci8.c /ext/oracle oracle.c /ext/rpc/java java.c /ext/w32api w32api.c

2003-01-19 Thread Ilia Alshanetsky
iliaa   Sun Jan 19 03:32:24 2003 EDT

  Modified files:  
/php4/ext/dbase dbf_rec.c 
/php4/ext/oci8  oci8.c 
/php4/ext/oracleoracle.c 
/php4/ext/rpc/java  java.c 
/php4/ext/w32apiw32api.c 
  Log:
  ZTS fixes.
  
  
Index: php4/ext/dbase/dbf_rec.c
diff -u php4/ext/dbase/dbf_rec.c:1.8 php4/ext/dbase/dbf_rec.c:1.9
--- php4/ext/dbase/dbf_rec.c:1.8Sat Jan 18 19:45:40 2003
+++ php4/ext/dbase/dbf_rec.cSun Jan 19 03:32:21 2003
@@ -136,6 +136,7 @@
 
/* Try to truncate the file to the right size. */
if (ftruncate(dbh->db_fd, out_off) != 0) {
+   TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbase_pack() couldn't 
truncate the file to the right size. Some deleted records may still be left in 
there.");
}
 
Index: php4/ext/oci8/oci8.c
diff -u php4/ext/oci8/oci8.c:1.200 php4/ext/oci8/oci8.c:1.201
--- php4/ext/oci8/oci8.c:1.200  Sat Jan 18 19:45:41 2003
+++ php4/ext/oci8/oci8.cSun Jan 19 03:32:22 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: oci8.c,v 1.200 2003/01/19 00:45:41 iliaa Exp $ */
+/* $Id: oci8.c,v 1.201 2003/01/19 08:32:22 iliaa Exp $ */
 
 /* TODO list:
  *
@@ -640,7 +640,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.200 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.201 $");
 #ifndef PHP_WIN32
php_info_print_table_row(2, "Oracle Version", PHP_OCI8_VERSION );
php_info_print_table_row(2, "Compile-time ORACLE_HOME", PHP_OCI8_DIR );
@@ -1113,6 +1113,7 @@
 {
oci_out_column *outcol = NULL;
int i;
+   TSRMLS_FETCH();
 
if (statement->columns == 0) { /* we release the columns at the end of a fetch 
*/
return NULL;
Index: php4/ext/oracle/oracle.c
diff -u php4/ext/oracle/oracle.c:1.84 php4/ext/oracle/oracle.c:1.85
--- php4/ext/oracle/oracle.c:1.84   Sat Jan 18 19:45:42 2003
+++ php4/ext/oracle/oracle.cSun Jan 19 03:32:22 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: oracle.c,v 1.84 2003/01/19 00:45:42 iliaa Exp $ */
+/* $Id: oracle.c,v 1.85 2003/01/19 08:32:22 iliaa Exp $ */
 
 /* comment out the next line if you're on Oracle 7.x and don't have the olog 
call. */
@@ -619,7 +619,7 @@
}
ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", 
le_conn, le_pconn);
 
-   cursor = (oraCursor *)emalloc(sizeof(oraCursor);
+   cursor = (oraCursor *)emalloc(sizeof(oraCursor));
memset(cursor, 0, sizeof(oraCursor));
if (oopen(&cursor->cda, &conn->lda, (text *) 0, -1, -1, (text *) 0, -1)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open new cursor 
(%s)",
Index: php4/ext/rpc/java/java.c
diff -u php4/ext/rpc/java/java.c:1.74 php4/ext/rpc/java/java.c:1.75
--- php4/ext/rpc/java/java.c:1.74   Sat Jan 18 19:45:48 2003
+++ php4/ext/rpc/java/java.cSun Jan 19 03:32:22 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: java.c,v 1.74 2003/01/19 00:45:48 iliaa Exp $ */
+/* $Id: java.c,v 1.75 2003/01/19 08:32:22 iliaa Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -407,7 +407,7 @@
 
 /* {{{ checkError 
  */
-static int checkError(pval *value)
+static int checkError(pval *value TSRMLS_DC)
 {
   if (Z_TYPE_P(value) == IS_EXCEPTION) {
 php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", Z_STRVAL_P(value));
@@ -493,7 +493,7 @@
   efree(arguments);
   pval_destructor(&function_name->element);
 
-  checkError((pval*)(long)result);
+  checkError((pval*)(long)result TSRMLS_CC);
 }
 /* }}} */
 
@@ -593,7 +593,7 @@
   TSRMLS_FETCH();
 
   presult = _java_getset_property(property_reference, 0 TSRMLS_CC);
-  checkError(&presult);
+  checkError(&presult TSRMLS_CC);
   return presult;
 }
 /* }}} */
@@ -606,7 +606,7 @@
   TSRMLS_FETCH();
 
   presult = _java_getset_property(property_reference, _java_makeArray(1, &value 
TSRMLS_CC) TSRMLS_CC);
-  return checkError(&presult) ? FAILURE : SUCCESS;
+  return checkError(&presult TSRMLS_CC) ? FAILURE : SUCCESS;
 }
 /* }}} */
 
Index: php4/ext/w32api/w32api.c
diff -u php4/ext/w32api/w32api.c:1.7 php4/ext/w32api/w32api.c:1.8
--- php4/ext/w32api/w32api.c:1.7Sat Jan 18 19:45:50 2003
+++ php4/ext/w32api/w32api.cSun Jan 19 03:32:23 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: w32api.c,v 1.7 2003/01/19 00:45:50 iliaa Exp $ */
+/* $Id: w32api.c,v 1.8 2003/01/19 08:32:23 iliaa Exp $ */
 
 /*
  * Win32 API Extension for PHP 4
@@ -2178,8 +2178,8 @@
argument_value->type_name = arg_type;
argument_value->type_id = php_w32api_get_type_id_from_name(arg_type);
 
-   if(argument_value->type_id == W

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

2003-01-19 Thread Moriyoshi Koizumi
moriyoshi   Sun Jan 19 06:32:55 2003 EDT

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

  Modified files:  
/php4/ext/standard  string.c 
  Log:
  Fixed bug #21744(21741)
  Added test case for the bug
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.347 php4/ext/standard/string.c:1.348
--- php4/ext/standard/string.c:1.347Sat Jan 18 15:01:46 2003
+++ php4/ext/standard/string.c  Sun Jan 19 06:32:54 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.347 2003/01/18 20:01:46 iliaa Exp $ */
+/* $Id: string.c,v 1.348 2003/01/19 11:32:54 moriyoshi Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -3630,8 +3630,16 @@
state = 3;
lc = c;
} else {
-   *(rp++) = c;
-   }   
+   if (state == 0) {
+   *(rp++) = c;
+   } else if (allow && state == 1) {
+   *(tp++) = c;
+   if ( (tp-tbuf) >= PHP_TAG_BUF_SIZE ) {
+   /* prevent buffer overflows */
+   tp = tbuf;
+   }
+   }
+   }
break;
 
case '?':

Index: php4/ext/standard/tests/strings/bug21744.phpt
+++ php4/ext/standard/tests/strings/bug21744.phpt
--TEST--
Bug #21744 (strip_tags misses exclamation marks in alt text)
--FILE--
test

HERE;

print strip_tags($test, '');
print strip_tags($test, '');
?>
--EXPECT--
test
test



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




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

2003-01-19 Thread Harald Radi
phanto  Sun Jan 19 07:17:38 2003 EDT

  Modified files:  
/php4/main  php_ini.c 
  Log:
  ini patch to allow 'entry[] = value' entries
  
Index: php4/main/php_ini.c
diff -u php4/main/php_ini.c:1.108 php4/main/php_ini.c:1.109
--- php4/main/php_ini.c:1.108   Tue Dec 31 10:58:53 2002
+++ php4/main/php_ini.c Sun Jan 19 07:17:38 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_ini.c,v 1.108 2002/12/31 15:58:53 sebastian Exp $ */
+/* $Id: php_ini.c,v 1.109 2003/01/19 12:17:38 phanto Exp $ */
 
 /* Check CWD for php.ini */
 #define INI_CHECK_CWD
@@ -195,6 +195,34 @@
}
}
break;
+
+   case ZEND_INI_PARSER_POP_ENTRY: {
+   zval *hash;
+   zval **find_hash;
+   zval *element;
+
+   if (!arg2) {
+   /* bare string - nothing to do */
+   break;
+   }
+
+   if (zend_hash_find(&configuration_hash, 
+Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, (void **) &find_hash) == FAILURE) {
+   ALLOC_ZVAL(hash);
+   array_init(hash);
+
+   zend_hash_update(&configuration_hash, 
+Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, &hash, sizeof(zval *), NULL);
+   } else {
+   hash = *find_hash;
+   }
+
+   ALLOC_ZVAL(element);
+   *element = *arg2;
+   zval_copy_ctor(element);
+   INIT_PZVAL(element);
+   add_next_index_zval(hash, element);
+ 
+   }
+   break;
+
case ZEND_INI_PARSER_SECTION:
break;
}



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

2003-01-19 Thread Harald Radi
phanto  Sun Jan 19 07:18:46 2003 EDT

  Modified files:  
/php4/ext/standard  basic_functions.c 
  Log:
  ini patch to allow 'entry[] = value' entries
  
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.563 
php4/ext/standard/basic_functions.c:1.564
--- php4/ext/standard/basic_functions.c:1.563   Sat Jan 18 10:03:00 2003
+++ php4/ext/standard/basic_functions.c Sun Jan 19 07:18:46 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.563 2003/01/18 15:03:00 andrey Exp $ */
+/* $Id: basic_functions.c,v 1.564 2003/01/19 12:18:46 phanto Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -2824,51 +2824,60 @@
zend_hash_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), 
Z_STRLEN_P(arg1)+1, &element, sizeof(zval *), NULL);
break;
 
-   case ZEND_INI_PARSER_SECTION:
-   break;
-   }
-}
-
-static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, int 
callback_type, zval *arr)
-{
-   zval *element;
-   TSRMLS_FETCH();
-
-   switch (callback_type) {
-
-   case ZEND_INI_PARSER_ENTRY:
+   case ZEND_INI_PARSER_POP_ENTRY:
{
-   zval *active_arr;
+   zval *hash, **find_hash;
 
if (!arg2) {
/* bare string - nothing to do */
break;
}
 
-   if (BG(active_ini_file_section)) {
-   active_arr = BG(active_ini_file_section);
+   if (zend_hash_find(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), 
+Z_STRLEN_P(arg1)+1, (void **) &find_hash) == FAILURE) {
+   ALLOC_ZVAL(hash);
+   INIT_PZVAL(hash);
+   array_init(hash);
+
+   zend_hash_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), 
+Z_STRLEN_P(arg1)+1, &hash, sizeof(zval *), NULL);
} else {
-   active_arr = arr;
+   hash = *find_hash;
}
+
ALLOC_ZVAL(element);
*element = *arg2;
zval_copy_ctor(element);
INIT_PZVAL(element);
-   zend_hash_update(Z_ARRVAL_P(active_arr), Z_STRVAL_P(arg1),
-Z_STRLEN_P(arg1)+1, &element,
-sizeof(zval *), NULL);
+   add_next_index_zval(hash, element); 
}
break;
 
case ZEND_INI_PARSER_SECTION:
-   MAKE_STD_ZVAL(BG(active_ini_file_section));
-   array_init(BG(active_ini_file_section));
-   zend_hash_update(   Z_ARRVAL_P(arr),
-   Z_STRVAL_P(arg1),
-   Z_STRLEN_P(arg1)+1,
-   
&BG(active_ini_file_section),
-   sizeof(zval *), NULL);
break;
+   }
+}
+
+static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, int 
+callback_type, zval *arr)
+{
+   TSRMLS_FETCH();
+
+   if (callback_type == ZEND_INI_PARSER_SECTION) {
+   MAKE_STD_ZVAL(BG(active_ini_file_section));
+   array_init(BG(active_ini_file_section));
+   zend_hash_update(   Z_ARRVAL_P(arr),
+   Z_STRVAL_P(arg1),
+   Z_STRLEN_P(arg1)+1,
+   &BG(active_ini_file_section),
+   sizeof(zval *), NULL);
+   } else if (arg2) {
+   zval *active_arr;
+
+   if (BG(active_ini_file_section)) {
+   active_arr = BG(active_ini_file_section);
+   } else {
+   active_arr = arr;
+   }
+
+   php_simple_ini_parser_cb(arg1, arg2, callback_type, active_arr);
}
 }
 



-- 
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 string.c /ext/standard/tests/strings bug21744.phpt

2003-01-19 Thread Moriyoshi Koizumi
moriyoshi   Sun Jan 19 07:56:26 2003 EDT

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

  Modified files:  
/php4/ext/standard  string.c 
  Log:
  MFH: fixed bug #21744
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.333.2.9 php4/ext/standard/string.c:1.333.2.10
--- php4/ext/standard/string.c:1.333.2.9Mon Jan  6 17:16:29 2003
+++ php4/ext/standard/string.c  Sun Jan 19 07:56:25 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.333.2.9 2003/01/06 22:16:29 iliaa Exp $ */
+/* $Id: string.c,v 1.333.2.10 2003/01/19 12:56:25 moriyoshi Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -3515,8 +3515,16 @@
state = 3;
lc = c;
} else {
-   *(rp++) = c;
-   }   
+   if (state == 0) {
+   *(rp++) = c;
+   } else if (allow && state == 1) {
+   *(tp++) = c;
+   if ( (tp-tbuf) >= PHP_TAG_BUF_SIZE ) {
+   /* prevent buffer overflows */
+   tp = tbuf;
+   }
+   }
+   }
break;
 
case '?':

Index: php4/ext/standard/tests/strings/bug21744.phpt
+++ php4/ext/standard/tests/strings/bug21744.phpt
--TEST--
Bug #21744 (strip_tags misses exclamation marks in alt text)
--FILE--
test

HERE;

print strip_tags($test, '');
print strip_tags($test, '');
?>
--EXPECT--
test
test



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




[PHP-CVS] cvs: php4 / README.TESTING

2003-01-19 Thread Derick Rethans
derick  Sun Jan 19 09:22:19 2003 EDT

  Modified files:  
/php4   README.TESTING 
  Log:
  - Moved to http://qa.php.net/write-test.php
  
  
Index: php4/README.TESTING
diff -u php4/README.TESTING:1.18 php4/README.TESTING:1.19
--- php4/README.TESTING:1.18Wed Oct 30 07:18:48 2002
+++ php4/README.TESTING Sun Jan 19 09:22:19 2003
@@ -141,145 +141,8 @@
 [Creating new test files]
 -
  Writing test file is very easy if you are used to PHP. 
+See the HOWTO at http://qa.php.net/write-test.php
 
-Here is an actual test file from standard module.
-
-= ext/standard/tests/strings/strtr.phpt ===
---TEST--
-strtr() function
---FILE--
-"hi", "hi"=>"hello", "a"=>"A", "world"=>"planet");
-var_dump(strtr("# hi all, I said hello world! #", $trans));
-?>
---EXPECT--
-string(32) "# hello All, I sAid hi planet! #"
-= ext/standard/tests/strings/strtr.phpt ===
-
-As you can see the file is devided into several sections. Below is a
-list of all possible sections:
-
-"--TEST--"is title of the test (required).
-"--SKIPIF--"  is condition when to skip this test (optional).
-"--POST--"is POST variable passed to test script (optional).
-"--GET--" is GET variable passed to test script (optional).
-"--INI--" each line contains an ini setting e.g. foo=bar (optional).
-"--FILE--"is the test script (required).
-"--EXPECT--"  is the expected output from the test script (required).
-"--EXPECTF--" is an alternative of --EXPECT--. The difference is that
-  this form uses sscanf for output validation (alternative).
-"--EXPECTREGEX--" is an alternative of --EXPECT--. This form allows the tester
-  to specify the result in a regular expression (alternative).
-
-A test must at least contain the sections TEST, FILE and either EXPECT
-or EXPECTF. When a test is called run-test.php takes the name from the
-TEST section and writes the FILE section into a ".php" file with the 
-same name as the ".phpt" file. This ".php" file will then be executed
-and its output compared to the contents of the EXPECT section. It is a
-good idea to generate output with var_dump() calls.
-
-/ext/standard/tests/strings/str_shuffle.phpt is a good example for using 
-EXPECTF instead of EXPECT. From time to time the algorithm used for shuffle 
-changed and sometimes the machine used to execute the code has influence 
-on the result of shuffle. But it always returns a three character string 
-detectable by %s. Other scan-able forms are %i for integers, %d for numbers
-only, %f for floating point values, %c for single characters and %x for 
-hexadecimal values.
-
- /ext/standard/tests/strings/str_shuffle.phpt ===
---TEST--
-Testing str_shuffle.
---FILE--
-
---EXPECTF--
-string(3) %s
-string(3) "123"
- end of /ext/standard/tests/strings/str_shuffle.phpt ===
-
-/ext/standard/tests/strings/strings001.phpt is a good example for using 
-EXPECTREGEX instead of EXPECT. This test also shows that in EXPECTREGEX 
-some characters need to be escaped since otherwise they would be 
-interpreted as a regular expression.
-
- /ext/standard/tests/strings/strings001.phpt ===
---TEST--
-Test whether strstr() and strrchr() are binary safe.
---FILE--
-
---EXPECTREGEX--
-string\(18\) \"nica\x00turska panica\"
-string\(19\) \" nica\x00turska panica\"
- end of /ext/standard/tests/strings/strings001.phpt ===
-
-Some tests depend on modules or functions available only in certain versions 
-or they even require minimum version of php or zend. These tests should be 
-skipped when the requirement cannot be fullfilled. To achieve this you can
-use the SKIPIF section. To tell run-test.php that your test should be skipped
-the SKIPIF section must print out the word "skip" followed by a reason why
-the test should skip.
-
- /ext/exif/tests/exif005.phpt ===
---TEST--
-Check for exif_read_data, unusual IFD start
---SKIPIF--
-
---FILE--
-
---EXPECT--
-array(2) {
-  ["ImageDescription"]=>
-  string(11) "Ifd0009"
-  ["DateTime"]=>
-  string(19) "2002:10:18 20:06:00"
-}
- end of /ext/exif/tests/exif005.phpt ===
-
-Test script and SKIPIF code should be directly written into *.phpt. However, 
-it is recommended to use include files when more test scripts depend on the 
-same SKIPIF code or when certain test files need the same values for some 
-input. But no file used by any test should have one of the following 
-extensions: ".php", ".log", ".exp", ".out" or ".diff".
-
-Tests should be named according to the following list:
-
-Class:   Name:  Example:
-Tests for bugs   bug.phptbug17123.phpt
-Tests for functions  .phptdba_open.phpt
-General tests for extensions .phpt dba3.phpt
-
-When you use an include file for the SKIPIF section it should be named
-"skipif.inc" and an include file used in the FILE section of many tests
-should be named "test.inc".
-
-NOTE: All tests

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

2003-01-19 Thread Ilia Alshanetsky
iliaa   Sun Jan 19 10:01:34 2003 EDT

  Modified files:  
/php4/ext/oracleoracle.c 
  Log:
  fixed typos
  
  
Index: php4/ext/oracle/oracle.c
diff -u php4/ext/oracle/oracle.c:1.85 php4/ext/oracle/oracle.c:1.86
--- php4/ext/oracle/oracle.c:1.85   Sun Jan 19 03:32:22 2003
+++ php4/ext/oracle/oracle.cSun Jan 19 10:01:33 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: oracle.c,v 1.85 2003/01/19 08:32:22 iliaa Exp $ */
+/* $Id: oracle.c,v 1.86 2003/01/19 15:01:33 iliaa Exp $ */
 
 /* comment out the next line if you're on Oracle 7.x and don't have the olog 
call. */
@@ -837,7 +837,7 @@
RETURN_FALSE;
}
}
-   newparam = (oraParam *)emalloc(sizeof(oraParam);
+   newparam = (oraParam *)emalloc(sizeof(oraParam));
 
if ((paramname = estrndup(Z_STRVAL_PP(pvar), Z_STRLEN_PP(pvar))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory for 
parametername");
@@ -988,7 +988,7 @@
 
convert_to_string_ex(sql);
 
-   cursor = (oraCursor *)emalloc(sizeof(oraCursor);
+   cursor = (oraCursor *)emalloc(sizeof(oraCursor));
 
memset(cursor, 0, sizeof(oraCursor));
 



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




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

2003-01-19 Thread Moriyoshi Koizumi
moriyoshi   Sun Jan 19 12:23:49 2003 EDT

  Modified files:  
/php4/ext/standard  scanf.c 
  Log:
  Improved the patched part to prevent further potential bugs
  
  
Index: php4/ext/standard/scanf.c
diff -u php4/ext/standard/scanf.c:1.22 php4/ext/standard/scanf.c:1.23
--- php4/ext/standard/scanf.c:1.22  Sat Jan 18 14:26:01 2003
+++ php4/ext/standard/scanf.c   Sun Jan 19 12:23:48 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: scanf.c,v 1.22 2003/01/18 19:26:01 moriyoshi Exp $ */
+/* $Id: scanf.c,v 1.23 2003/01/19 17:23:48 moriyoshi Exp $ */
 
 /*
scanf.c --
@@ -762,9 +762,14 @@
case 'n':
if (!(flags & SCAN_SUPPRESS)) {
if (numVars) {
+   zend_uint refcount;
+
current = args[objIndex++];
+   refcount = (*current)->refcount;
zval_dtor( *current );
ZVAL_LONG( *current, (long)(string - 
baseString) );
+   (*current)->refcount = refcount;
+   (*current)->is_ref = 1;
} else {
add_index_long(*return_value, 
objIndex++, string - baseString);
}
@@ -882,9 +887,14 @@
}
if (!(flags & SCAN_SUPPRESS)) {
if (numVars) {
+   zend_uint refcount;
+
current = args[objIndex++];
+   refcount = (*current)->refcount;
zval_dtor( *current );
ZVAL_STRINGL( *current, string, 
end-string, 1);
+   (*current)->refcount = refcount;
+   (*current)->is_ref = 1;
} else {
add_index_stringl( *return_value, 
objIndex++, string, end-string, 1);
}



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

2003-01-19 Thread Zeev Suraski
zeevSun Jan 19 16:37:41 2003 EDT

  Modified files:  
/php4   acinclude.m4 configure.in 
  Log:
  relabel
  
  
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.224 php4/acinclude.m4:1.225
--- php4/acinclude.m4:1.224 Fri Jan  3 17:05:12 2003
+++ php4/acinclude.m4   Sun Jan 19 16:37:40 2003
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.224 2003/01/03 22:05:12 alexwaugh Exp $
+dnl $Id: acinclude.m4,v 1.225 2003/01/19 21:37:40 zeev Exp $
 dnl
 dnl This file contains local autoconf functions.
 
@@ -777,7 +777,7 @@
 dnl PHP_BUILD_THREAD_SAFE
 dnl
 AC_DEFUN([PHP_BUILD_THREAD_SAFE],[
-  enable_experimental_zts=yes
+  enable_maintainer_zts=yes
   if test "$pthreads_working" != "yes"; then
 AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to 
verify that your system supports Pthreads.])
   fi
Index: php4/configure.in
diff -u php4/configure.in:1.413 php4/configure.in:1.414
--- php4/configure.in:1.413 Thu Jan  9 11:37:45 2003
+++ php4/configure.in   Sun Jan 19 16:37:40 2003
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.413 2003/01/09 16:37:45 sniper Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.414 2003/01/19 21:37:40 zeev Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -237,7 +237,7 @@
 AC_MSG_CHECKING([for chosen SAPI module])
 AC_MSG_RESULT([$PHP_SAPI])
 
-if test "$enable_experimental_zts" = "yes"; then
+if test "$enable_maintainer_zts" = "yes"; then
   PTHREADS_ASSIGN_VARS
   PTHREADS_FLAGS
 fi
@@ -836,7 +836,7 @@
 TSRM_DIR=TSRM
 CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/TSRM"
 
-if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
+if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
   AC_DEFINE(ZTS,1,[ ])
   PHP_THREAD_SAFETY=yes
 else
@@ -898,7 +898,7 @@
 else
   part1=no-debug
 fi
-if test "$enable_experimental_zts" = "yes"; then
+if test "$enable_maintainer_zts" = "yes"; then
   part2=zts
 else
   part2=non-zts
@@ -906,7 +906,7 @@
 extbasedir=$part1-$part2-$extbasedir
 EXTENSION_DIR=$libdir/extensions/$extbasedir
   else
-if test "$enable_experimental_zts" = "yes"; then
+if test "$enable_maintainer_zts" = "yes"; then
   extbasedir=$extbasedir-zts
 fi
 



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




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

2003-01-19 Thread Ilia Alshanetsky
iliaa   Sun Jan 19 18:32:20 2003 EDT

  Modified files:  
/php4/ext/oracleoracle.c 
  Log:
  ZTS fix.
  
  
Index: php4/ext/oracle/oracle.c
diff -u php4/ext/oracle/oracle.c:1.86 php4/ext/oracle/oracle.c:1.87
--- php4/ext/oracle/oracle.c:1.86   Sun Jan 19 10:01:33 2003
+++ php4/ext/oracle/oracle.cSun Jan 19 18:32:20 2003
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: oracle.c,v 1.86 2003/01/19 15:01:33 iliaa Exp $ */
+/* $Id: oracle.c,v 1.87 2003/01/19 23:32:20 iliaa Exp $ */
 
 /* comment out the next line if you're on Oracle 7.x and don't have the olog 
call. */
@@ -1621,6 +1621,7 @@
int i;
sb2 type;
sb4 dbsize;
+   TSRMLS_FETCH();
 
if (cursor == NULL) {
return -1;



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




[PHP-CVS] cvs: php4 /ext/msession README msession.c php_msession.h reqclient.h

2003-01-19 Thread Mark L. Woodward
mlwmohawk   Sun Jan 19 22:16:23 2003 EDT

  Modified files:  
/php4/ext/msession  README msession.c php_msession.h reqclient.h 
  Log:
  Updated for Msession 1.2.
  Includes new APIs
  
  
Index: php4/ext/msession/README
diff -u php4/ext/msession/README:1.5 php4/ext/msession/README:1.6
--- php4/ext/msession/README:1.5Sun Dec 23 14:57:32 2001
+++ php4/ext/msession/READMESun Jan 19 22:16:22 2003
@@ -1,8 +1,8 @@
 This is msession, it is an interface to a stand-alone session
 management system. The msession daemon can be found at 
-Mohawk Software's web site, under Project Phoenix
+Mohawk Software's web site.
 
-http://www.mohawksoft.com/phoenix.html
+http://www.mohawksoft.com
 
 Requirements:
 Mohawk Software's Phoenix library.
Index: php4/ext/msession/msession.c
diff -u php4/ext/msession/msession.c:1.39 php4/ext/msession/msession.c:1.40
--- php4/ext/msession/msession.c:1.39   Sat Jan 18 16:31:06 2003
+++ php4/ext/msession/msession.cSun Jan 19 22:16:22 2003
@@ -2,7 +2,7 @@
+--+
| msession 1.0 |
+--+
-   | Copyright (c) 1997-2003 The PHP Group|
+   | 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|
@@ -16,6 +16,7 @@
|Portions copyright the PHP group. |
+--+
  */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -39,17 +40,10 @@
 #define SID_LEN 32
 #endif
 
+
 /* Uncomment to get debugging messages */
 /* #define ERR_DEBUG */
 
-/* Uncomment for conections which are persistent for a process 
- * This will be faster but allocates a thread in the msession 
- * daemon. 
- * Pros: No reconnect overhead.
- * cons: Msession maintains a thread per connection.
- */
-/* #define PERSISTENT_CONN */
-
 #ifdef ERR_DEBUG
 #define ELOG( str )php_log_err( str )
 #else
@@ -59,8 +53,8 @@
 /* Test if system is OK fror use. */
 /* Macros may be ugly, but I can globaly add debuging when needed. */
 #defineIFCONNECT_BEGIN if(s_reqb && s_conn) {
-#define IFCONNECT_ENDVAL(V)} else { php_error_docref(NULL TSRMLS_CC, E_WARNING, 
s_szNoInit); return V; }
-#define IFCONNECT_END  } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, 
s_szNoInit); RETURN_FALSE; }
+#define IFCONNECT_ENDVAL(V)} else { php_error(E_WARNING, s_szNoInit, 
+get_active_function_name(TSRMLS_C)); return V; }
+#define IFCONNECT_END  } else { php_error(E_WARNING, s_szNoInit, 
+get_active_function_name(TSRMLS_C)); RETURN_FALSE; }
 
 #ifndef HAVE_PHP_SESSION
 #error HAVE_PHP_SESSION not defined
@@ -86,6 +80,9 @@
 #warning Backward compatible msession extension requires PHP sessions. If PHP 
compiles and links, you can ignore this warning.
 #elif (ZEND_MODULE_API_NO >= 20010901)
 #define PHP_4_1
+#else
+#warning ZEND_MODULE_API_NO not defined
+#define PHP_4_1
 #endif
 
 /*
@@ -117,8 +114,8 @@
 #endif
 
 /* Static strings */
-static char s_szNoInit[]="Msession not initialized";
-static char s_szErrFmt[]="%s";
+static char s_szNoInit[]="%s(): Msession not initialized";
+static char s_szErrFmt[]="%s(): %s";
 
 /* Per-process variables need by msession */
 static chars_szdefhost[]="localhost";
@@ -151,6 +148,8 @@
PHP_FE(msession_plugin,NULL)
PHP_FE(msession_call,NULL)
PHP_FE(msession_ctl,NULL)
+   PHP_FE(msession_exec,NULL)
+   PHP_FE(msession_ping,NULL)
{NULL, NULL, NULL}
 };
 
@@ -198,19 +197,6 @@
 
 PHP_RSHUTDOWN_FUNCTION(msession)
 {
-#ifndef PERSISTENT_CONN
-   if(s_conn)
-   {
-   CloseReqConn(s_conn);
-   s_conn = NULL;
-   }
-
-   if(s_reqb)
-   {
-   FreeRequestBuffer(s_reqb);
-   s_reqb=NULL;
-   }
-#endif
return SUCCESS;
 }
 
@@ -220,34 +206,76 @@
php_info_print_table_header(2, "msession support", "enabled");
php_info_print_table_end();
 }
+#define RPT_CONN_ERR
+#ifdef ERR_DEBUG
+#undef RPT_CONN_ERR
+#define RPT_CONN_ERR if(s_reqb->req.stat == REQ_ERR && (result == REQE_BADCONN || 
+result == REQE_NOSEND)) \
+   ELOG("Socket reports closed"); 
+ \
+   else if(s_reqb->req.stat == REQ_ERR)\
+   ELOG("MSession call failed");\
+#else
+#endif
 
-/* The PHP Version of DoRequest */
-/* Manages connections that have been disconnected */
-int PHPDoRequest(void **pconn, REQB **ppreq)
-{
-   void *conn = *pconn;
-   int stat = (*ppreq)->req.stat;
-   int param = (*pp

Re: [PHP-CVS] cvs: php4 /ext/bz2 bz2.c /ext/curl interface.c /ext/cyruscyrus.c /ext/ircg ircg.c /ext/ldap ldap.c /ext/mnogosearch php_mnogo.c /ext/msession msession.c /ext/msql php_msql.c /ext/mssql php_mssql.c /ext/odbc birdstep.c php_odbc.c /ext/sysvmsg sysvmsg.c /ext/xslt sablot.c

2003-01-19 Thread mlwmohawk
Doh! I think I just clobbered your patch. Could you send me the diffs 
for msession and I'll reapply them.


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