[PHP-CVS-DAILY] cvs: Zend / ChangeLog

2003-03-08 Thread changelog
changelog   Sat Mar  8 20:33:19 2003 EDT

  Modified files:  
/Zend   ChangeLog 
  Log:
  ChangeLog update
  
Index: Zend/ChangeLog
diff -u Zend/ChangeLog:1.117 Zend/ChangeLog:1.118
--- Zend/ChangeLog:1.117Fri Mar  7 20:31:34 2003
+++ Zend/ChangeLog  Sat Mar  8 20:33:19 2003
@@ -1,3 +1,9 @@
+2003-03-08  Ilia Alshanetsky  [EMAIL PROTECTED]
+
+* (PHP_4_3)
+  zend_highlight.c:
+  Added the removed multibyte bit.
+
 2003-03-07  Jani Taskinen  [EMAIL PROTECTED]
 
 * (PHP_4_3)
@@ -988,7 +994,7 @@
 
 2002-05-13  Sterling Hughes  [EMAIL PROTECTED]
 
-* zend_qsort.c: add $Id: ChangeLog,v 1.117 2003/03/08 01:31:34 changelog Exp $ tag
+* zend_qsort.c: add $Id: ChangeLog,v 1.118 2003/03/09 01:33:19 changelog Exp $ tag
 
 2002-05-13  Derick Rethans  [EMAIL PROTECTED]
 




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

2003-03-08 Thread Stefan Esser
sesser  Sat Mar  8 09:37:01 2003 EDT

  Modified files:  
/php4/ext/standard  html.c 
  Log:
  fixing memory leak
  
  
  
Index: php4/ext/standard/html.c
diff -u php4/ext/standard/html.c:1.73 php4/ext/standard/html.c:1.74
--- php4/ext/standard/html.c:1.73   Thu Mar  6 18:07:27 2003
+++ php4/ext/standard/html.cSat Mar  8 09:37:01 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.73 2003/03/06 23:07:27 ddhill Exp $ */
+/* $Id: html.c,v 1.74 2003/03/08 14:37:01 sesser Exp $ */
 
 #include php.h
 #if PHP_WIN32
@@ -840,6 +840,7 @@
}
 
replaced = php_escape_html_entities(str, str_len, len, all, quote_style, 
hint_charset TSRMLS_CC);
+   efree(str);
RETVAL_STRINGL(replaced, len, 0);
 }
 /* }}} */



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



[PHP-CVS] cvs: php4(PHP_4) /ext/standard php_smart_str.h

2003-03-08 Thread Sascha Schumann
sas Sat Mar  8 09:37:26 2003 EDT

  Modified files:  (Branch: PHP_4)
/php4/ext/standard  php_smart_str.h 
  Log:
  macro-ize smart string implementation to improve optimization
  across single calls
  
  Index: php4/ext/standard/php_smart_str.h
diff -u php4/ext/standard/php_smart_str.h:1.22.4.1 
php4/ext/standard/php_smart_str.h:1.22.4.1.2.1
--- php4/ext/standard/php_smart_str.h:1.22.4.1  Tue Dec 31 11:35:33 2002
+++ php4/ext/standard/php_smart_str.h   Sat Mar  8 09:37:25 2003
@@ -24,120 +24,144 @@
 #include stdlib.h
 #include zend.h
 
-#define smart_str_0(x) do { if ((x)-c) { (x)-c[(x)-len] = '\0'; } } while (0)
+#define smart_str_0(x) do {   
 \
+   if ((x)-c) {  
 \
+   (x)-c[(x)-len] = '\0';   
 \
+   }  
 \
+} while (0)
 
 #ifndef SMART_STR_PREALLOC
 #define SMART_STR_PREALLOC 128
 #endif
 
-#define smart_str_alloc(d, n, what) {\
-   if (!d-c) d-len = d-a = 0; \
-   newlen = d-len + n; \
-   if (newlen = d-a) {\
-   d-c = perealloc(d-c, newlen + SMART_STR_PREALLOC + 1, what); \
-   d-a = newlen + SMART_STR_PREALLOC; \
-   }\
-}
-
-#define smart_str_appends_ex(dest, src, what) smart_str_appendl_ex(dest, src, 
strlen(src), what)
-#define smart_str_appends(dest, src) smart_str_appendl(dest, src, strlen(src))
-
-#define smart_str_appendc(dest, c) smart_str_appendc_ex(dest, c, 0)
-#define smart_str_free(s) smart_str_free_ex(s, 0)
-#define smart_str_appendl(dest, src, len) smart_str_appendl_ex(dest, src, len, 0)
-#define smart_str_append(dest, src) smart_str_append_ex(dest, src, 0)
-#define smart_str_append_long(dest, val) smart_str_append_long_ex(dest, val, 0)
-#define smart_str_append_unsigned(dest, val) smart_str_append_unsigned_ex(dest, val, 
0)
-
-static inline void smart_str_appendc_ex(smart_str *dest, unsigned char c, int what)
-{
-   size_t newlen;
-
-   smart_str_alloc(dest, 1, what);
-   dest-len = newlen;
-   ((unsigned char *) dest-c)[dest-len - 1] = c;
-}
-
-
-static inline void smart_str_free_ex(smart_str *s, int what)
-{
-   if (s-c) {
-   pefree(s-c, what);
-   s-c = NULL;
-   }
-   s-a = s-len = 0;
-}
-
-static inline void smart_str_appendl_ex(smart_str *dest, const char *src, size_t len, 
int what)
-{
-   size_t newlen;
-
-   smart_str_alloc(dest, len, what);
-   memcpy(dest-c + dest-len, src, len);
-   dest-len = newlen;
-}
-
-/* buf points to the END of the buffer */
-static inline char *smart_str_print_unsigned(char *buf, unsigned long num)
-{
-   char *p = buf;
-   
-   *p = '\0';
-   do {
-   *--p = (char)(num % 10) + '0';
-   num /= 10;
-   } while (num  0);
-
-   return p;
-}
+#define smart_str_alloc4(d, n, what, newlen) do { 
 \
+   if (!(d)-c) (d)-len = (d)-a = 0;
 \
+   newlen = (d)-len + (n);   
 \
+   if (newlen = (d)-a) {
 \
+   (d)-a = newlen + SMART_STR_PREALLOC;  
 \
+   (d)-c = perealloc((d)-c, (d)-a + 1, (what));
 \
+   }  
 \
+} while (0)
+
+#define smart_str_alloc(d, n, what) \
+   smart_str_alloc4((d), (n), (what), newlen)
+
+/* wrapper */
+
+#define smart_str_appends_ex(dest, src, what) \
+   smart_str_appendl_ex((dest), (src), strlen(src), (what))
+#define smart_str_appends(dest, src) \
+   smart_str_appendl((dest), (src), strlen(src))
+
+#define smart_str_appendc(dest, c) \
+   smart_str_appendc_ex((dest), (c), 0)
+#define smart_str_free(s) \
+   smart_str_free_ex((s), 0)
+#define smart_str_appendl(dest, src, len) \
+   smart_str_appendl_ex((dest), (src), (len), 0)
+#define smart_str_append(dest, src) \
+   smart_str_append_ex((dest), (src), 0)
+#define smart_str_append_long(dest, val) \
+   smart_str_append_long_ex((dest), (val), 0)
+#define smart_str_append_off_t(dest, val) \
+   smart_str_append_off_t_ex((dest), (val), 0)
+#define smart_str_append_unsigned(dest, val) \
+   smart_str_append_unsigned_ex((dest), (val), 0)
+
+#define smart_str_appendc_ex(dest, ch, what) do { 
 \
+   register size_t __nl;  

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

2003-03-08 Thread Stefan Esser
sesser  Sat Mar  8 09:51:16 2003 EDT

  Modified files:  
/php4/ext/standard  html.c 
  Log:
  wrong place.
  
  
Index: php4/ext/standard/html.c
diff -u php4/ext/standard/html.c:1.74 php4/ext/standard/html.c:1.75
--- php4/ext/standard/html.c:1.74   Sat Mar  8 09:37:01 2003
+++ php4/ext/standard/html.cSat Mar  8 09:51:16 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: html.c,v 1.74 2003/03/08 14:37:01 sesser Exp $ */
+/* $Id: html.c,v 1.75 2003/03/08 14:51:16 sesser Exp $ */
 
 #include php.h
 #if PHP_WIN32
@@ -840,7 +840,6 @@
}
 
replaced = php_escape_html_entities(str, str_len, len, all, quote_style, 
hint_charset TSRMLS_CC);
-   efree(str);
RETVAL_STRINGL(replaced, len, 0);
 }
 /* }}} */



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



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

2003-03-08 Thread Stefan Esser
sesser  Sat Mar  8 10:20:12 2003 EDT

  Modified files:  
/php4/main  main.c 
  Log:
  fix possible XSS in error messages
  
  
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.536 php4/main/main.c:1.537
--- php4/main/main.c:1.536  Fri Mar  7 00:15:26 2003
+++ php4/main/main.cSat Mar  8 10:20:12 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.536 2003/03/07 05:15:26 sniper Exp $ */
+/* $Id: main.c,v 1.537 2003/03/08 15:20:12 sesser Exp $ */
 
 /* {{{ includes
  */
@@ -439,6 +439,14 @@

buffer_len = vspprintf(buffer, 0, format, args);
if (buffer) {
+   if (PG(html_errors)) {
+   int len;
+   char *replace = php_escape_html_entities(buffer, buffer_len, 
len, 0, ENT_COMPAT, NULL TSRMLS_CC);
+   efree(buffer);
+   buffer = replace;
+   buffer_len = len;
+   }
+
if (docref  docref[0] == '#') {
docref_target = strchr(docref, '#');
docref = NULL;
@@ -571,6 +579,14 @@
TSRMLS_FETCH();
 
buffer_len = vspprintf(buffer, PG(log_errors_max_len), format, args);
+   if (PG(html_errors)) {
+   int len;
+   char *replace = php_escape_html_entities(buffer, buffer_len, len, 0, 
ENT_COMPAT, NULL TSRMLS_CC);
+   efree(buffer);
+   buffer = replace;
+   buffer_len = len;
+   }
+
if (PG(ignore_repeated_errors)) {
if (strncmp(last_error.buf, buffer, sizeof(last_error.buf))
|| (!PG(ignore_repeated_source)



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



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

2003-03-08 Thread Stefan Esser
sesser  Sat Mar  8 10:24:47 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/main  main.c 
  Log:
  MFH
  
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.512.2.14 php4/main/main.c:1.512.2.15
--- php4/main/main.c:1.512.2.14 Thu Mar  6 15:58:18 2003
+++ php4/main/main.cSat Mar  8 10:24:47 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.512.2.14 2003/03/06 20:58:18 sesser Exp $ */
+/* $Id: main.c,v 1.512.2.15 2003/03/08 15:24:47 sesser Exp $ */
 
 /* {{{ includes
  */
@@ -458,6 +458,14 @@

buffer_len = vspprintf(buffer, 0, format, args);
if (buffer) {
+   if (PG(html_errors)) {
+   int len;
+   char *replace = php_escape_html_entities(buffer, buffer_len, 
len, 0, ENT_COMPAT, NULL TSRMLS_CC);
+   efree(buffer);
+   buffer = replace;
+   buffer_len = len;
+   }
+
if (docref  docref[0] == '#') {
docref_target = strchr(docref, '#');
docref = NULL;
@@ -590,6 +598,14 @@
TSRMLS_FETCH();
 
buffer_len = vspprintf(buffer, PG(log_errors_max_len), format, args);
+   if (PG(html_errors)) {
+   int len;
+   char *replace = php_escape_html_entities(buffer, buffer_len, len, 0, 
ENT_COMPAT, NULL TSRMLS_CC);
+   efree(buffer);
+   buffer = replace;
+   buffer_len = len;
+   }
+
if (PG(ignore_repeated_errors)) {
if (strncmp(last_error.buf, buffer, sizeof(last_error.buf))
|| (!PG(ignore_repeated_source)



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



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

2003-03-08 Thread Marcus Boerger
helly   Sat Mar  8 11:28:35 2003 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
  summary for selective tests if more than one
  
  # maybe i'll change to present summary only when at least one dir selected
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.147 php4/run-tests.php:1.148
--- php4/run-tests.php:1.147Tue Mar  4 14:32:06 2003
+++ php4/run-tests.php  Sat Mar  8 11:28:35 2003
@@ -219,9 +219,17 @@
if (count($test_files)) {
usort($test_files, test_sort);
echo Running selected tests.\n;
+   $start_time = time();
foreach($test_files AS $name) {
$test_results[$name] = run_test($php,$name);
}
+   $end_time = time();
+   if (count($test_files)  1) {
+   echo 
+=;
+   compute_summary();
+   echo get_summary(false);
+   }
if(getenv('REPORT_EXIT_STATUS') == 1 and ereg('FAILED( |$)', implode(' 
', $test_results))) {
exit(1);
}
@@ -312,57 +320,15 @@
return;
 }
 
-$n_total = count($test_results);
-$n_total += $ignored_by_ext;
-
-$sum_results = array('PASSED'=0, 'SKIPPED'=0, 'FAILED'=0);
-foreach ($test_results as $v) {
-   $sum_results[$v]++;
-}
-$sum_results['SKIPPED'] += $ignored_by_ext;
-$percent_results = array();
-while (list($v,$n) = each($sum_results)) {
-   $percent_results[$v] = (100.0 * $n) / $n_total;
-}
+compute_summary();
 
 echo 
 =
 TIME END  . date('Y-m-d H:i:s', $end_time);
 
-$summary = 
-=
-TEST RESULT SUMMARY
--
-Exts skipped:  . sprintf(%4d,$exts_skipped) . 
-Exts tested :  . sprintf(%4d,$exts_tested) . 
--
-Number of tests :  . sprintf(%4d,$n_total) . 
-Tests skipped   :  . sprintf(%4d 
(%2.1f%%),$sum_results['SKIPPED'],$percent_results['SKIPPED']) . 
-Tests failed:  . sprintf(%4d 
(%2.1f%%),$sum_results['FAILED'],$percent_results['FAILED']) . 
-Tests passed:  . sprintf(%4d 
(%2.1f%%),$sum_results['PASSED'],$percent_results['PASSED']) . 
--
-Time taken  :  . sprintf(%4d seconds, $end_time - $start_time) . 
-=
-;
+$summary = get_summary(true);
 echo $summary;
 
-$failed_test_summary = '';
-if (count($PHP_FAILED_TESTS)) {
-   $failed_test_summary .= 
-=
-FAILED TEST SUMMARY
--
-;
-   foreach ($PHP_FAILED_TESTS as $failed_test_data) {
-   $failed_test_summary .=  $failed_test_data['test_name'] . \n;
-   }
-   $failed_test_summary .=  
=\n;
-}
-
-if ($failed_test_summary  !getenv('NO_PHPTEST_SUMMARY')) {
-   echo $failed_test_summary;
-}
-
 define('PHP_QA_EMAIL', '[EMAIL PROTECTED]');
 define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php');
 
@@ -872,6 +838,68 @@
} else {
$ini_settings = '';
}
+}
+
+function compute_summary()
+{
+   global $n_total, $test_results, $ignored_by_ext, $sum_results, 
$percent_results;
+
+   $n_total = count($test_results);
+   $n_total += $ignored_by_ext;
+   
+   $sum_results = array('PASSED'=0, 'SKIPPED'=0, 'FAILED'=0);
+   foreach ($test_results as $v) {
+   $sum_results[$v]++;
+   }
+   $sum_results['SKIPPED'] += $ignored_by_ext;
+   $percent_results = array();
+   while (list($v,$n) = each($sum_results)) {
+   $percent_results[$v] = (100.0 * $n) / $n_total;
+   }
+}
+
+function get_summary($show_ext_summary)
+{
+   global $exts_skipped, $exts_tested, $n_total, $sum_results, $percent_results, 
$end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS;
+
+   $summary = ;
+   if ($show_ext_summary) {
+   $summary .= 
+=
+TEST RESULT SUMMARY
+-
+Exts skipped:  . sprintf(%4d,$exts_skipped) . 
+Exts tested :  . sprintf(%4d,$exts_tested) . 
+-
+;
+   }
+   $summary .= 
+Number of tests :  . sprintf(%4d,$n_total) . 
+Tests skipped   :  . sprintf(%4d 
(%2.1f%%),$sum_results['SKIPPED'],$percent_results['SKIPPED']) . 
+Tests failed:  . sprintf(%4d 

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

2003-03-08 Thread Marcus Boerger
helly   Sat Mar  8 11:53:54 2003 EDT

  Modified files:  
/php4/main  network.c 
  Log:
  fix warnings - one left
  
Index: php4/main/network.c
diff -u php4/main/network.c:1.97 php4/main/network.c:1.98
--- php4/main/network.c:1.97Sat Mar  1 13:47:18 2003
+++ php4/main/network.c Sat Mar  8 11:53:54 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: network.c,v 1.97 2003/03/01 18:47:18 moriyoshi Exp $ */
+/* $Id: network.c,v 1.98 2003/03/08 16:53:54 helly Exp $ */
 
 /*#define DEBUG_MAIN_NETWORK 1*/
 
@@ -434,6 +434,7 @@
break;
default:
/* Unknown family */
+   socklen = 0;
sa = NULL;
}
 
@@ -509,7 +510,7 @@
 
break;
 
-#if HAVE_IPV6
+#if HAVE_IPV6  HAVE_INET_NTOP
case AF_INET6:
buf = (char*)inet_ntop(sa-sa_family, ((struct 
sockaddr_in6*)sa)-sin6_addr, (char *)abuf, sizeof(abuf));
if (buf) {
@@ -711,6 +712,7 @@
break;
default:
/* Unknown family */
+   socklen = 0;
sa = NULL;
}
 



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



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

2003-03-08 Thread Derick Rethans
derick  Sat Mar  8 13:27:12 2003 EDT

  Modified files:  
/php4/ext/gdgdttf.c 
  Log:
  - Fixed a bug in GD's truecolor TTF handling
  
  
Index: php4/ext/gd/gdttf.c
diff -u php4/ext/gd/gdttf.c:1.17 php4/ext/gd/gdttf.c:1.18
--- php4/ext/gd/gdttf.c:1.17Tue Nov 19 14:55:54 2002
+++ php4/ext/gd/gdttf.c Sat Mar  8 13:27:12 2003
@@ -2,7 +2,7 @@
 /*  */
 /* John Ellson   [EMAIL PROTECTED]  */
 
-/* $Id: gdttf.c,v 1.17 2002/11/19 19:55:54 iliaa Exp $ */
+/* $Id: gdttf.c,v 1.18 2003/03/08 18:27:12 derick Exp $ */
 
 #include php.h
 
@@ -744,11 +744,15 @@
if (tweencolorkey.pixel  0) {
x3 = x2 + col;
if (x3 = im-sx || x3  0) continue;
+   if (im-trueColor) {
+   pixel = im-tpixels[y3][x3];
+   } else {
 #if HAVE_LIBGD13
-   pixel = im-pixels[y3][x3];
+   pixel = im-pixels[y3][x3];
 #else
-   pixel = im-pixels[x3][y3];
+   pixel = im-pixels[x3][y3];
 #endif
+   }
tweencolorkey.bgcolor = *pixel;
tweencolor = (tweencolor_t *)gdCacheGet(
tweenColorCache, tweencolorkey);



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



[PHP-CVS] cvs: php4(PHP_4_3) / NEWS /ext/gd gdttf.c

2003-03-08 Thread Derick Rethans
derick  Sat Mar  8 13:28:08 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php4/ext/gdgdttf.c 
/php4   NEWS 
  Log:
  - MFH: Fixed a bug in GD's truecolor TTF handling.
  
  
Index: php4/ext/gd/gdttf.c
diff -u php4/ext/gd/gdttf.c:1.16.10.1 php4/ext/gd/gdttf.c:1.16.10.2
--- php4/ext/gd/gdttf.c:1.16.10.1   Wed Mar  5 11:04:20 2003
+++ php4/ext/gd/gdttf.c Sat Mar  8 13:28:07 2003
@@ -2,7 +2,7 @@
 /*  */
 /* John Ellson   [EMAIL PROTECTED]  */
 
-/* $Id: gdttf.c,v 1.16.10.1 2003/03/05 16:04:20 iliaa Exp $ */
+/* $Id: gdttf.c,v 1.16.10.2 2003/03/08 18:28:07 derick Exp $ */
 
 #include php.h
 
@@ -744,11 +744,15 @@
if (tweencolorkey.pixel  0) {
x3 = x2 + col;
if (x3 = im-sx || x3  0) continue;
+   if (im-trueColor) {
+   pixel = im-tpixels[y3][x3];
+   } else {
 #if HAVE_LIBGD13
-   pixel = im-pixels[y3][x3];
+   pixel = im-pixels[y3][x3];
 #else
-   pixel = im-pixels[x3][y3];
+   pixel = im-pixels[x3][y3];
 #endif
+   }
tweencolorkey.bgcolor = *pixel;
tweencolor = (tweencolor_t *)gdCacheGet(
tweenColorCache, tweencolorkey);
Index: php4/NEWS
diff -u php4/NEWS:1.1247.2.128 php4/NEWS:1.1247.2.129
--- php4/NEWS:1.1247.2.128  Fri Mar  7 13:58:34 2003
+++ php4/NEWS   Sat Mar  8 13:28:08 2003
@@ -24,6 +24,7 @@
   --enable-memory-limit. (Andrey)
 - Added improved JPEG 2000 support for getimagesize(). (Marcus, Adam Wright)
 - Added XBM and WBMP support for getimagesize(). (Marcus)
+- Fixed a bug in GD's truecolor TTF handling. (Derick)
 - Fixed several 64-bit problems. (Dave)
 - Fixed several errors in hwapi extension. Objects weren't handled properly. (Uwe)
 - Fixed bug #22585 (Do not terminate the script on minor errors). (Ilia)



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



[PHP-CVS] cvs: php4 /ext/mysqli mysqli.c mysqli_api.c mysqli_fe.c mysqli_nonapi.c mysqli_profiler.c php_mysqli.h

2003-03-08 Thread Georg Richter
georg   Sat Mar  8 18:33:13 2003 EDT

  Modified files:  
/php4/ext/mysqlimysqli_fe.c mysqli_nonapi.c mysqli_profiler.c 
mysqli_api.c php_mysqli.h mysqli.c 
  Log:
  various changes for profiler
  
  Index: php4/ext/mysqli/mysqli_fe.c
diff -u php4/ext/mysqli/mysqli_fe.c:1.8 php4/ext/mysqli/mysqli_fe.c:1.9
--- php4/ext/mysqli/mysqli_fe.c:1.8 Mon Mar  3 17:36:47 2003
+++ php4/ext/mysqli/mysqli_fe.c Sat Mar  8 18:33:12 2003
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_fe.c,v 1.8 2003/03/03 22:36:47 georg Exp $ 
+  $Id: mysqli_fe.c,v 1.9 2003/03/08 23:33:12 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -86,6 +86,7 @@
PHP_FE(mysqli_ping,
 NULL)
PHP_FE(mysqli_prepare, 
 NULL)
PHP_FE(mysqli_prepare_result,   NULL)
+   PHP_FE(mysqli_profiler,
 NULL)
PHP_FE(mysqli_query,   
 NULL)
PHP_FE(mysqli_read_query_result,NULL)
PHP_FE(mysqli_real_connect,
 NULL)
@@ -102,7 +103,6 @@
PHP_FE(mysqli_send_long_data,   NULL)
PHP_FE(mysqli_send_query,  
 NULL)
PHP_FALIAS(mysqli_set_opt,  mysqli_options, NULL)
-   PHP_FE(mysqli_set_profiler_opt, NULL)
PHP_FE(mysqli_slave_query, 
 NULL)
PHP_FE(mysqli_ssl_set, 
 NULL)
PHP_FE(mysqli_stat,
 NULL)
Index: php4/ext/mysqli/mysqli_nonapi.c
diff -u php4/ext/mysqli/mysqli_nonapi.c:1.6 php4/ext/mysqli/mysqli_nonapi.c:1.7
--- php4/ext/mysqli/mysqli_nonapi.c:1.6 Mon Mar  3 17:36:47 2003
+++ php4/ext/mysqli/mysqli_nonapi.c Sat Mar  8 18:33:12 2003
@@ -15,7 +15,7 @@
   | Author: Georg Richter [EMAIL PROTECTED]|
   +--+
 
-  $Id: mysqli_nonapi.c,v 1.6 2003/03/03 22:36:47 georg Exp $ 
+  $Id: mysqli_nonapi.c,v 1.7 2003/03/08 23:33:12 georg Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -33,11 +33,14 @@
open a connection to a mysql server */ 
 PHP_FUNCTION(mysqli_connect)
 {
-   MYSQL *mysql;
-   zval  *object = getThis();
-   char *hostname = NULL, *username=NULL, *passwd=NULL, *dbname=NULL, 
*socket=NULL;
-   unsigned int hostname_len, username_len, passwd_len, dbname_len, socket_len;
-   unsigned int port=0;
+   MYSQL   *mysql;
+   MYSQLI_RESOURCE *mysqli_resource;
+   PR_MYSQL*prmysql = NULL;
+   zval*object = getThis();
+   char*hostname = NULL, *username=NULL, 
*passwd=NULL, *dbname=NULL, *socket=NULL;
+   unsigned inthostname_len, username_len, passwd_len, dbname_len, 
socket_len;
+   unsigned intport=0;
+   struct timeval  starttime;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |ls, hostname, 
hostname_len, username, username_len, 
passwd, passwd_len, dbname, dbname_len, port, socket, 
socket_len) == FAILURE) {
@@ -59,6 +62,10 @@
}   
mysql = mysql_init(NULL);
 
+   if (MyG(profiler)){
+   gettimeofday(starttime, NULL);
+   }
+
if (mysql_real_connect(mysql,hostname,username,passwd,dbname,port,socket,0) == 
NULL) {
/* Save error messages */
 
@@ -70,10 +77,24 @@
RETURN_FALSE;
}
 
+   if (MyG(profiler)) {
+   prmysql = (PR_MYSQL *)MYSQLI_PROFILER_NEW(NULL, MYSQLI_PR_MYSQL, 0);
+   php_mysqli_profiler_timediff(starttime, prmysql-header.elapsedtime);
+   MYSQLI_PROFILER_STARTTIME(prmysql);
+   prmysql-hostname = estrdup(hostname);
+   prmysql-username = estrdup(username);
+   prmysql-thread_id = mysql-thread_id;
+   }
+
+   mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
+   mysqli_resource-ptr = (void *)mysql;
+   mysqli_resource-prinfo = prmysql;
+
+
if (!object) {
-   MYSQLI_RETURN_RESOURCE(mysql, mysqli_link_class_entry); 
+   MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);  
 
} else {
-   ((mysqli_object *) 

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

2003-03-08 Thread Derick Rethans
derick  Sat Mar  8 19:05:49 2003 EDT

  Modified files:  
/php4/ext/standard  string.c 
  Log:
  - Fix proto
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.362 php4/ext/standard/string.c:1.363
--- php4/ext/standard/string.c:1.362Thu Mar  6 18:07:27 2003
+++ php4/ext/standard/string.c  Sat Mar  8 19:05:48 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.362 2003/03/06 23:07:27 ddhill Exp $ */
+/* $Id: string.c,v 1.363 2003/03/09 00:05:48 derick Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -623,7 +623,7 @@
 }
 /* }}} */
 
-/* {{{ proto string wordwrap(string str [, int width [, string break [, int cut]]])
+/* {{{ proto string wordwrap(string str [, int width [, string break [, boolean 
cut]]])
Wraps buffer to selected number of characters using string break char */
 PHP_FUNCTION(wordwrap)
 {



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