[PHP-CVS] cvs: php-src /ext/standard/tests/file bug27508.phpt

2005-05-10 Thread Wez Furlong
wez Tue May 10 22:01:45 2005 EDT

  Added files: 
/php-src/ext/standard/tests/filebug27508.phpt 
  Log:
  add test for bug 27508
  

http://cvs.php.net/co.php/php-src/ext/standard/tests/file/bug27508.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/file/bug27508.phpt
+++ php-src/ext/standard/tests/file/bug27508.phpt
--TEST--
Bug #27508 (userspace wrappers have bogus eof indicator)
--FILE--
fp = fopen($url, $mode);

return true;
}

function stream_read($count) 
{
return fread($this->fp, $count);
}

function stream_write($data) 
{
return fwrite($this->fp, $data);
}

function stream_tell() 
{
return ftell($this->fp);
}

function stream_eof() 
{
return feof($this->fp);
}

function stream_seek($offset, $whence) 
{
return fseek($this->fp, $offset, $whence) == 0 ? true : false;
}
}

stream_wrapper_register("myFile", "FileStream")
or die("Failed to register protocol");

$tn = tempnam('/tmp', 'foo');

$fp = fopen("myFile://" . urlencode($tn), "w+");

fwrite($fp, "line1\n");
fwrite($fp, "line2\n");
fwrite($fp, "line3\n");

debug_zval_dump(feof($fp));
rewind($fp);
echo ftell($fp) . "\n";
debug_zval_dump(feof($fp));
while (!feof($fp)) {
echo fgets($fp);
}
fclose($fp);

unlink($tn);
--EXPECT--
bool(false) refcount(1)
0
bool(false) refcount(1)
line1
line2
line3

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



[PHP-CVS] cvs: php-src /main/streams userspace.c

2005-05-10 Thread Wez Furlong
wez Tue May 10 22:02:27 2005 EDT

  Modified files:  
/php-src/main/streams   userspace.c 
  Log:
  fix inverted logic and thus Bug #27508
  
  
http://cvs.php.net/diff.php/php-src/main/streams/userspace.c?r1=1.29&r2=1.30&ty=u
Index: php-src/main/streams/userspace.c
diff -u php-src/main/streams/userspace.c:1.29 
php-src/main/streams/userspace.c:1.30
--- php-src/main/streams/userspace.c:1.29   Fri Oct  8 10:40:11 2004
+++ php-src/main/streams/userspace.cTue May 10 22:02:27 2005
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: userspace.c,v 1.29 2004/10/08 14:40:11 chregu Exp $ */
+/* $Id: userspace.c,v 1.30 2005/05/11 02:02:27 wez Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -835,7 +835,7 @@
ZVAL_STRINGL(&func_name, USERSTREAM_EOF, 
sizeof(USERSTREAM_EOF)-1, 0);
call_result = call_user_function_ex(NULL, &us->object, 
&func_name, &retval, 0, NULL, 0, NULL TSRMLS_CC);
if (call_result == SUCCESS && retval != NULL && 
Z_TYPE_P(retval) == IS_BOOL) {
-   ret = Z_LVAL_P(retval) ? PHP_STREAM_OPTION_RETURN_OK : 
PHP_STREAM_OPTION_RETURN_ERR;
+   ret = zval_is_true(retval) ? 
PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK;
} else {
ret = PHP_STREAM_OPTION_RETURN_ERR;
php_error_docref(NULL TSRMLS_CC, E_WARNING,

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



[PHP-CVS] cvs: php-src /ext/pgsql pgsql.c

2005-05-10 Thread Antony Dovgal
tony2001Tue May 10 19:12:33 2005 EDT

  Modified files:  
/php-src/ext/pgsql  pgsql.c 
  Log:
  use & and check for the right value of result_type
  
  
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.326&r2=1.327&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.326 php-src/ext/pgsql/pgsql.c:1.327
--- php-src/ext/pgsql/pgsql.c:1.326 Tue May 10 16:13:24 2005
+++ php-src/ext/pgsql/pgsql.c   Tue May 10 19:12:31 2005
@@ -20,7 +20,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.326 2005/05/10 20:13:24 tony2001 Exp $ */
+/* $Id: pgsql.c,v 1.327 2005/05/10 23:12:31 tony2001 Exp $ */
 
 #include 
 
@@ -4137,6 +4137,11 @@
 
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL 
link", le_link, le_plink);
 
+   if (!(result_type & PGSQL_BOTH)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result 
type");
+   RETURN_FALSE;
+   }
+
PQconsumeInput(pgsql);
pgsql_notify = PQnotifies(pgsql);
if (!pgsql_notify) {
@@ -4144,11 +4149,11 @@
RETURN_FALSE;
}
array_init(return_value);
-   if (result_type == PGSQL_NUM || result_type == PGSQL_BOTH) {
+   if (result_type & PGSQL_NUM) {
add_index_string(return_value, 0, pgsql_notify->relname, 1);
add_index_long(return_value, 1, pgsql_notify->be_pid);
}
-   if (result_type == PGSQL_ASSOC || result_type == PGSQL_BOTH) {
+   if (result_type & PGSQL_ASSOC) {
add_assoc_string(return_value, "message", 
pgsql_notify->relname, 1);
add_assoc_long(return_value, "pid", pgsql_notify->be_pid);
}

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



[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/pgsql pgsql.c

2005-05-10 Thread Antony Dovgal
tony2001Tue May 10 19:15:07 2005 EDT

  Modified files:  (Branch: PHP_4_3)
/php-srcNEWS 
/php-src/ext/pgsql  pgsql.c 
  Log:
  use & and check for the right value of result_type
  btw, nobody noticed that result_type wasn't ever working in 4.3, because it 
was absent in parse_params()..
  also, I prefer "Tony" just for uniformity =)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.900&r2=1.1247.2.901&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.900 php-src/NEWS:1.1247.2.901
--- php-src/NEWS:1.1247.2.900   Tue May 10 17:47:11 2005
+++ php-src/NEWSTue May 10 19:15:05 2005
@@ -10,7 +10,7 @@
 - Fixed bug #32974 (pcntl calls malloc() from a signal handler). (Wez)
 - Fixed bug #32936 (http redirects URLs are not checked for control chars). 
(Ilia)
 - Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer). (Jani)
-- Fixed bug #32904 (pg_get_notify() ignores result_type parameter). (Antony)
+- Fixed bug #32904 (pg_get_notify() ignores result_type parameter). (Tony)
 - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)
 - Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia)
 - Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems). (Jani)
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.244.2.39&r2=1.244.2.40&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.244.2.39 
php-src/ext/pgsql/pgsql.c:1.244.2.40
--- php-src/ext/pgsql/pgsql.c:1.244.2.39Tue May 10 16:14:11 2005
+++ php-src/ext/pgsql/pgsql.c   Tue May 10 19:15:06 2005
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.39 2005/05/10 20:14:11 tony2001 Exp $ */
+/* $Id: pgsql.c,v 1.244.2.40 2005/05/10 23:15:06 tony2001 Exp $ */
 
 #include 
 
@@ -3125,12 +3125,17 @@
PGnotify *pgsql_notify;
 
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() 
TSRMLS_CC, "r|l",
-&pgsql_link) 
== FAILURE) {
+&pgsql_link, 
&result_type) == FAILURE) {
RETURN_FALSE;
}
 
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL 
link", le_link, le_plink);
 
+   if (!(result_type & PGSQL_BOTH)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result 
type");
+   RETURN_FALSE;
+   }
+
PQconsumeInput(pgsql);
pgsql_notify = PQnotifies(pgsql);
if (!pgsql_notify) {
@@ -3138,11 +3143,11 @@
RETURN_FALSE;
}
array_init(return_value);
-   if (result_type == PGSQL_NUM || result_type == PGSQL_BOTH) {
+   if (result_type & PGSQL_NUM) {
add_index_string(return_value, 0, pgsql_notify->relname, 1);
add_index_long(return_value, 1, pgsql_notify->be_pid);
}
-   if (result_type == PGSQL_ASSOC || result_type == PGSQL_BOTH) {
+   if (result_type & PGSQL_ASSOC) {
add_assoc_string(return_value, "message", 
pgsql_notify->relname, 1);
add_assoc_long(return_value, "pid", pgsql_notify->be_pid);
}

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/pgsql pgsql.c

2005-05-10 Thread Antony Dovgal
tony2001Tue May 10 19:15:24 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/pgsql  pgsql.c 
  Log:
  use & and check for the right value of result_type
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.380&r2=1.1760.2.381&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.380 php-src/NEWS:1.1760.2.381
--- php-src/NEWS:1.1760.2.380   Tue May 10 17:45:25 2005
+++ php-src/NEWSTue May 10 19:15:23 2005
@@ -16,7 +16,7 @@
 - Fixed bug #32936 (http redirects URLs are not checked for control chars). 
(Ilia)
 - Fixed bug #32932 (Oracle LDAP: ldap_get_entries(), invalid pointer). (Jani)
 - Fixed bug #32930 (class extending DOMDocument doesn't clone properly). (Rob)
-- Fixed bug #32904 (pg_get_notify() ignores result_type parameter). (Antony)
+- Fixed bug #32904 (pg_get_notify() ignores result_type parameter). (Tony)
 - Fixed bug #32852 (Crash with singleton and __destruct when
   zend.ze1_compatibility_mode = On). (Dmitry)
 - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.311.2.3&r2=1.311.2.4&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.311.2.3 php-src/ext/pgsql/pgsql.c:1.311.2.4
--- php-src/ext/pgsql/pgsql.c:1.311.2.3 Tue May 10 16:13:57 2005
+++ php-src/ext/pgsql/pgsql.c   Tue May 10 19:15:24 2005
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.311.2.3 2005/05/10 20:13:57 tony2001 Exp $ */
+/* $Id: pgsql.c,v 1.311.2.4 2005/05/10 23:15:24 tony2001 Exp $ */
 
 #include 
 
@@ -3274,6 +3274,11 @@
}
 
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL 
link", le_link, le_plink);
+   
+   if (!(result_type & PGSQL_BOTH)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result 
type");
+   RETURN_FALSE;
+   }
 
PQconsumeInput(pgsql);
pgsql_notify = PQnotifies(pgsql);
@@ -3282,11 +3287,11 @@
RETURN_FALSE;
}
array_init(return_value);
-   if (result_type == PGSQL_NUM || result_type == PGSQL_BOTH) {
+   if (result_type & PGSQL_NUM) {
add_index_string(return_value, 0, pgsql_notify->relname, 1);
add_index_long(return_value, 1, pgsql_notify->be_pid);
}
-   if (result_type == PGSQL_ASSOC || result_type == PGSQL_BOTH) {
+   if (result_type & PGSQL_ASSOC) {
add_assoc_string(return_value, "message", 
pgsql_notify->relname, 1);
add_assoc_long(return_value, "pid", pgsql_notify->be_pid);
}

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



Re: [PHP-CVS] cvs: php-src /ext/pgsql pgsql.c

2005-05-10 Thread Antony Dovgal
On Tue, 10 May 2005 15:34:10 -0700
Andi Gutmans <[EMAIL PROTECTED]> wrote:

> So why not just do:
> +   if (result_type & PGSQL_NUM) {
> +   if (result_type& PGSQL_ASSOC) {
> 
> Why do you need to reference PGSQL_BOTH? I might be missing something 
> (didn't look at the .c file) but it seems strange.

Then I'll probably need to a check for result_type to be only PGSQL_NUM, 
PGSQL_ASSOC, PGSQL_BOTH.
No ?

-- 
Wbr, 
Antony Dovgal aka tony2001
[EMAIL PROTECTED]

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



Re: [PHP-CVS] cvs: php-src /ext/pgsql pgsql.c

2005-05-10 Thread Andi Gutmans
So why not just do:
+   if (result_type & PGSQL_NUM) {
+   if (result_type& PGSQL_ASSOC) {
Why do you need to reference PGSQL_BOTH? I might be missing something 
(didn't look at the .c file) but it seems strange.

Andi
At 08:13 PM 5/10/2005 +, Antony Dovgal wrote:
tony2001Tue May 10 16:13:26 2005 EDT
  Modified files:
/php-src/ext/pgsql  pgsql.c
  Log:
  fix #32904 (pg_get_notify() ignores result_type parameter)
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.325&r2=1.326&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.325 php-src/ext/pgsql/pgsql.c:1.326
--- php-src/ext/pgsql/pgsql.c:1.325 Tue May  3 18:50:00 2005
+++ php-src/ext/pgsql/pgsql.c   Tue May 10 16:13:24 2005
@@ -20,7 +20,7 @@
+--+
  */
-/* $Id: pgsql.c,v 1.325 2005/05/03 22:50:00 iliaa Exp $ */
+/* $Id: pgsql.c,v 1.326 2005/05/10 20:13:24 tony2001 Exp $ */
 #include 
@@ -4144,11 +4144,11 @@
RETURN_FALSE;
}
array_init(return_value);
-   if (result_type & (PGSQL_NUM|PGSQL_BOTH)) {
+   if (result_type == PGSQL_NUM || result_type == PGSQL_BOTH) {
add_index_string(return_value, 0, pgsql_notify->relname, 1);
add_index_long(return_value, 1, pgsql_notify->be_pid);
}
-   if (result_type & (PGSQL_ASSOC|PGSQL_BOTH)) {
+   if (result_type == PGSQL_ASSOC || result_type == PGSQL_BOTH) {
add_assoc_string(return_value, "message", 
pgsql_notify->relname, 1);
add_assoc_long(return_value, "pid", pgsql_notify->be_pid);
}

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


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

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 17:47:12 2005 EDT

  Modified files:  (Branch: PHP_4_3)
/php-srcNEWS 
  Log:
  Tony or Antony? :)
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.899&r2=1.1247.2.900&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.899 php-src/NEWS:1.1247.2.900
--- php-src/NEWS:1.1247.2.899   Tue May 10 16:14:11 2005
+++ php-src/NEWSTue May 10 17:47:11 2005
@@ -10,7 +10,7 @@
 - Fixed bug #32974 (pcntl calls malloc() from a signal handler). (Wez)
 - Fixed bug #32936 (http redirects URLs are not checked for control chars). 
(Ilia)
 - Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer). (Jani)
-- Fixed bug #32904 (pg_get_notify() ignores result_type parameter)
+- Fixed bug #32904 (pg_get_notify() ignores result_type parameter). (Antony)
 - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)
 - Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia)
 - Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems). (Jani)

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 17:45:28 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
  Log:
  missing blame tag :)
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.379&r2=1.1760.2.380&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.379 php-src/NEWS:1.1760.2.380
--- php-src/NEWS:1.1760.2.379   Tue May 10 16:13:58 2005
+++ php-src/NEWSTue May 10 17:45:25 2005
@@ -11,12 +11,12 @@
 - Fixed ext/mysqli to allocate less memory when fetching bound params
   of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey)
 - Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
-- Fixed bug #32956 (mysql_bind_result doesn't support MYSQL_TYPE_NULL). (Georg)
+- Fixed bug #32956 (mysql_bind_result() doesn't support MYSQL_TYPE_NULL). 
(Georg)
 - Fixed bug #32947 (Incorrect option for mysqli default password). (Georg)
 - Fixed bug #32936 (http redirects URLs are not checked for control chars). 
(Ilia)
-- Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer). (Jani)
+- Fixed bug #32932 (Oracle LDAP: ldap_get_entries(), invalid pointer). (Jani)
 - Fixed bug #32930 (class extending DOMDocument doesn't clone properly). (Rob)
-- Fixed bug #32904 (pg_get_notify() ignores result_type parameter)
+- Fixed bug #32904 (pg_get_notify() ignores result_type parameter). (Antony)
 - Fixed bug #32852 (Crash with singleton and __destruct when
   zend.ze1_compatibility_mode = On). (Dmitry)
 - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)

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



[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/pgsql pgsql.c

2005-05-10 Thread Antony Dovgal
tony2001Tue May 10 16:14:13 2005 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/pgsql  pgsql.c 
/php-srcNEWS 
  Log:
  MFH: fix #32904 (pg_get_notify() ignores result_type parameter)
  
  
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.244.2.38&r2=1.244.2.39&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.244.2.38 
php-src/ext/pgsql/pgsql.c:1.244.2.39
--- php-src/ext/pgsql/pgsql.c:1.244.2.38Wed Apr 13 18:12:06 2005
+++ php-src/ext/pgsql/pgsql.c   Tue May 10 16:14:11 2005
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.244.2.38 2005/04/13 22:12:06 tony2001 Exp $ */
+/* $Id: pgsql.c,v 1.244.2.39 2005/05/10 20:14:11 tony2001 Exp $ */
 
 #include 
 
@@ -3138,11 +3138,11 @@
RETURN_FALSE;
}
array_init(return_value);
-   if (result_type & (PGSQL_NUM|PGSQL_BOTH)) {
+   if (result_type == PGSQL_NUM || result_type == PGSQL_BOTH) {
add_index_string(return_value, 0, pgsql_notify->relname, 1);
add_index_long(return_value, 1, pgsql_notify->be_pid);
}
-   if (result_type & (PGSQL_ASSOC|PGSQL_BOTH)) {
+   if (result_type == PGSQL_ASSOC || result_type == PGSQL_BOTH) {
add_assoc_string(return_value, "message", 
pgsql_notify->relname, 1);
add_assoc_long(return_value, "pid", pgsql_notify->be_pid);
}
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.898&r2=1.1247.2.899&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.898 php-src/NEWS:1.1247.2.899
--- php-src/NEWS:1.1247.2.898   Tue May 10 09:21:35 2005
+++ php-src/NEWSTue May 10 16:14:11 2005
@@ -10,6 +10,7 @@
 - Fixed bug #32974 (pcntl calls malloc() from a signal handler). (Wez)
 - Fixed bug #32936 (http redirects URLs are not checked for control chars). 
(Ilia)
 - Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer). (Jani)
+- Fixed bug #32904 (pg_get_notify() ignores result_type parameter)
 - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)
 - Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia)
 - Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems). (Jani)

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/pgsql pgsql.c

2005-05-10 Thread Antony Dovgal
tony2001Tue May 10 16:13:59 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/pgsql  pgsql.c 
/php-srcNEWS 
  Log:
  MFH: fix #32904 (pg_get_notify() ignores result_type parameter)
  
  
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.311.2.2&r2=1.311.2.3&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.311.2.2 php-src/ext/pgsql/pgsql.c:1.311.2.3
--- php-src/ext/pgsql/pgsql.c:1.311.2.2 Wed Apr 13 18:11:55 2005
+++ php-src/ext/pgsql/pgsql.c   Tue May 10 16:13:57 2005
@@ -19,7 +19,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.311.2.2 2005/04/13 22:11:55 tony2001 Exp $ */
+/* $Id: pgsql.c,v 1.311.2.3 2005/05/10 20:13:57 tony2001 Exp $ */
 
 #include 
 
@@ -3282,11 +3282,11 @@
RETURN_FALSE;
}
array_init(return_value);
-   if (result_type & (PGSQL_NUM|PGSQL_BOTH)) {
+   if (result_type == PGSQL_NUM || result_type == PGSQL_BOTH) {
add_index_string(return_value, 0, pgsql_notify->relname, 1);
add_index_long(return_value, 1, pgsql_notify->be_pid);
}
-   if (result_type & (PGSQL_ASSOC|PGSQL_BOTH)) {
+   if (result_type == PGSQL_ASSOC || result_type == PGSQL_BOTH) {
add_assoc_string(return_value, "message", 
pgsql_notify->relname, 1);
add_assoc_long(return_value, "pid", pgsql_notify->be_pid);
}
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.378&r2=1.1760.2.379&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.378 php-src/NEWS:1.1760.2.379
--- php-src/NEWS:1.1760.2.378   Tue May 10 09:22:12 2005
+++ php-src/NEWSTue May 10 16:13:58 2005
@@ -16,6 +16,7 @@
 - Fixed bug #32936 (http redirects URLs are not checked for control chars). 
(Ilia)
 - Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer). (Jani)
 - Fixed bug #32930 (class extending DOMDocument doesn't clone properly). (Rob)
+- Fixed bug #32904 (pg_get_notify() ignores result_type parameter)
 - Fixed bug #32852 (Crash with singleton and __destruct when
   zend.ze1_compatibility_mode = On). (Dmitry)
 - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)

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



[PHP-CVS] cvs: php-src /ext/pgsql pgsql.c

2005-05-10 Thread Antony Dovgal
tony2001Tue May 10 16:13:26 2005 EDT

  Modified files:  
/php-src/ext/pgsql  pgsql.c 
  Log:
  fix #32904 (pg_get_notify() ignores result_type parameter)
  
  
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.325&r2=1.326&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.325 php-src/ext/pgsql/pgsql.c:1.326
--- php-src/ext/pgsql/pgsql.c:1.325 Tue May  3 18:50:00 2005
+++ php-src/ext/pgsql/pgsql.c   Tue May 10 16:13:24 2005
@@ -20,7 +20,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.325 2005/05/03 22:50:00 iliaa Exp $ */
+/* $Id: pgsql.c,v 1.326 2005/05/10 20:13:24 tony2001 Exp $ */
 
 #include 
 
@@ -4144,11 +4144,11 @@
RETURN_FALSE;
}
array_init(return_value);
-   if (result_type & (PGSQL_NUM|PGSQL_BOTH)) {
+   if (result_type == PGSQL_NUM || result_type == PGSQL_BOTH) {
add_index_string(return_value, 0, pgsql_notify->relname, 1);
add_index_long(return_value, 1, pgsql_notify->be_pid);
}
-   if (result_type & (PGSQL_ASSOC|PGSQL_BOTH)) {
+   if (result_type == PGSQL_ASSOC || result_type == PGSQL_BOTH) {
add_assoc_string(return_value, "message", 
pgsql_notify->relname, 1);
add_assoc_long(return_value, "pid", pgsql_notify->be_pid);
}

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



Re: [PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/mysql/libmysql config-win.h

2005-05-10 Thread Georg Richter
Am Mo, den 09.05.2005 schrieb Jani Taskinen um 23:17:
>  Just curious..why was it disabled..? :)
> 
>  --Jani
> 

Afaik someone disabled it when PHP4 Windows didn't support zlib by
default.

/Georg

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



[PHP-CVS] cvs: php-src /ext/standard/tests/math math_std_dev.phpt

2005-05-10 Thread Andrey Hristov
andrey  Tue May 10 11:27:50 2005 EDT

  Modified files:  
/php-src/ext/standard/tests/mathmath_std_dev.phpt 
  Log:
  fix the test too
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/tests/math/math_std_dev.phpt?r1=1.4&r2=1.5&ty=u
Index: php-src/ext/standard/tests/math/math_std_dev.phpt
diff -u php-src/ext/standard/tests/math/math_std_dev.phpt:1.4 
php-src/ext/standard/tests/math/math_std_dev.phpt:1.5
--- php-src/ext/standard/tests/math/math_std_dev.phpt:1.4   Mon May  2 
08:29:38 2005
+++ php-src/ext/standard/tests/math/math_std_dev.phpt   Tue May 10 11:27:49 2005
@@ -1,13 +1,13 @@
 --TEST--
-math_std_dev()/math_variance tests
+math_standard_deviation()/math_variance tests
 --FILE--
 http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src / NEWS

2005-05-10 Thread Andrey Hristov
andrey  Tue May 10 10:36:30 2005 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  fix NEWS
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1896&r2=1.1897&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1896 php-src/NEWS:1.1897
--- php-src/NEWS:1.1896 Sat May  7 12:14:27 2005
+++ php-src/NEWSTue May 10 10:36:29 2005
@@ -83,7 +83,7 @@
   . htmlspecialchars_decode() (Ilia)
   . inet_pton() (Sara)
   . inet_ntop() (Sara)
-  . math_std_dev() - calculate standard deviation.(Andrey)
+  . math_standard_deviation() - calculate standard deviation. (Andrey)
   . math_variance() - calculate population variance. (Andrey)
   . mysqli::client_info property (Georg)
   . posix_access() (Magnus)

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/soap soap.c

2005-05-10 Thread Dmitry Stogov
dmitry  Tue May 10 09:57:49 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/soap   soap.c 
  Log:
  Fixed transparent SoapFault passing
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.110.2.33&r2=1.110.2.34&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.110.2.33 php-src/ext/soap/soap.c:1.110.2.34
--- php-src/ext/soap/soap.c:1.110.2.33  Tue May 10 06:20:38 2005
+++ php-src/ext/soap/soap.c Tue May 10 09:57:47 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.110.2.33 2005/05/10 10:20:38 dmitry Exp $ */
+/* $Id: soap.c,v 1.110.2.34 2005/05/10 13:57:47 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -3498,6 +3498,15 @@
zend_hash_internal_pointer_reset(fault->details);
zend_hash_get_current_data(fault->details, 
(void**)&sparam);
sparam = *(sdlParamPtr*)sparam;
+
+   if (detail &&
+   Z_TYPE_P(detail) == IS_OBJECT &&
+   sparam->element &&
+   zend_hash_num_elements(Z_OBJPROP_P(detail)) == 1 &&
+   zend_hash_find(Z_OBJPROP_P(detail), 
sparam->element->name, strlen(sparam->element->name)+1, (void**)&tmp) == 
SUCCESS) {
+   detail = *tmp;
+   }
+
x = serialize_parameter(sparam, detail, 1, NULL, use, 
node TSRMLS_CC);
 
if (function &&

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



[PHP-CVS] cvs: php-src /ext/soap soap.c

2005-05-10 Thread Dmitry Stogov
dmitry  Tue May 10 09:58:11 2005 EDT

  Modified files:  
/php-src/ext/soap   soap.c 
  Log:
  Fixed transparent SoapFault passing
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.145&r2=1.146&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.145 php-src/ext/soap/soap.c:1.146
--- php-src/ext/soap/soap.c:1.145   Tue May 10 06:20:58 2005
+++ php-src/ext/soap/soap.c Tue May 10 09:58:11 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.145 2005/05/10 10:20:58 dmitry Exp $ */
+/* $Id: soap.c,v 1.146 2005/05/10 13:58:11 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -3498,6 +3498,15 @@
zend_hash_internal_pointer_reset(fault->details);
zend_hash_get_current_data(fault->details, 
(void**)&sparam);
sparam = *(sdlParamPtr*)sparam;
+
+   if (detail &&
+   Z_TYPE_P(detail) == IS_OBJECT &&
+   sparam->element &&
+   zend_hash_num_elements(Z_OBJPROP_P(detail)) == 1 &&
+   zend_hash_find(Z_OBJPROP_P(detail), 
sparam->element->name, strlen(sparam->element->name)+1, (void**)&tmp) == 
SUCCESS) {
+   detail = *tmp;
+   }
+
x = serialize_parameter(sparam, detail, 1, NULL, use, 
node TSRMLS_CC);
 
if (function &&

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



[PHP-CVS] cvs: php-src /ext/odbc php_odbc_includes.h

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 09:22:23 2005 EDT

  Modified files:  
/php-src/ext/odbc   php_odbc_includes.h 
  Log:
  MFB: - Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems)
  
http://cvs.php.net/diff.php/php-src/ext/odbc/php_odbc_includes.h?r1=1.10&r2=1.11&ty=u
Index: php-src/ext/odbc/php_odbc_includes.h
diff -u php-src/ext/odbc/php_odbc_includes.h:1.10 
php-src/ext/odbc/php_odbc_includes.h:1.11
--- php-src/ext/odbc/php_odbc_includes.h:1.10   Wed Jan 12 21:06:39 2005
+++ php-src/ext/odbc/php_odbc_includes.hTue May 10 09:22:22 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_odbc_includes.h,v 1.10 2005/01/13 02:06:39 wez Exp $ */
+/* $Id: php_odbc_includes.h,v 1.11 2005/05/10 13:22:22 sniper Exp $ */
 
 #ifndef PHP_ODBC_INCLUDES_H
 #define PHP_ODBC_INCLUDES_H
@@ -230,7 +230,7 @@
 typedef struct odbc_result_value {
char name[32];
char *value;
-   long int vallen;
+   SDWORD vallen;
SDWORD coltype;
 } odbc_result_value;
 

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



[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/odbc php_odbc_includes.h

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 09:21:36 2005 EDT

  Modified files:  (Branch: PHP_4_3)
/php-srcNEWS 
/php-src/ext/odbc   php_odbc_includes.h 
  Log:
  - Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems)
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.897&r2=1.1247.2.898&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.897 php-src/NEWS:1.1247.2.898
--- php-src/NEWS:1.1247.2.897   Mon May  9 13:45:49 2005
+++ php-src/NEWSTue May 10 09:21:35 2005
@@ -12,6 +12,7 @@
 - Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer). (Jani)
 - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)
 - Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia)
+- Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems). (Jani)
 - Fixed bug #32730 (ext/crack.c fails to compile with cracklib-2.8.3). (Jani)
 - Fixed bug #32670 (foreach() does not issue warning on unset array arg). 
(Ilia)
 - Fixed bug #32699 (pg_affected_rows() was defined when it was not available).
http://cvs.php.net/diff.php/php-src/ext/odbc/php_odbc_includes.h?r1=1.2.4.2&r2=1.2.4.3&ty=u
Index: php-src/ext/odbc/php_odbc_includes.h
diff -u php-src/ext/odbc/php_odbc_includes.h:1.2.4.2 
php-src/ext/odbc/php_odbc_includes.h:1.2.4.3
--- php-src/ext/odbc/php_odbc_includes.h:1.2.4.2Mon Jul 14 12:13:30 2003
+++ php-src/ext/odbc/php_odbc_includes.hTue May 10 09:21:36 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_odbc_includes.h,v 1.2.4.2 2003/07/14 16:13:30 sniper Exp $ */
+/* $Id: php_odbc_includes.h,v 1.2.4.3 2005/05/10 13:21:36 sniper Exp $ */
 
 #ifndef PHP_ODBC_INCLUDES_H
 #define PHP_ODBC_INCLUDES_H
@@ -216,7 +216,7 @@
 typedef struct odbc_result_value {
char name[32];
char *value;
-   long int vallen;
+   SDWORD vallen;
SDWORD coltype;
 } odbc_result_value;
 

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/odbc php_odbc_includes.h

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 09:22:13 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/odbc   php_odbc_includes.h 
  Log:
  MFB: - Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems)
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.377&r2=1.1760.2.378&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.377 php-src/NEWS:1.1760.2.378
--- php-src/NEWS:1.1760.2.377   Tue May 10 08:16:41 2005
+++ php-src/NEWSTue May 10 09:22:12 2005
@@ -21,6 +21,7 @@
 - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)
 - Fixed bug #32809 (Missing T1LIB support on Windows). (Edin)
 - Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia)
+- Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems). (Jani)
 - Fixed bug #32776 (SOAP doesn't support one-way operations). (Dmitry)
 - Fixed bug #32773 (GMP functions break when second parameter is 0). (Stas)
 - Fixed bug #32759 (incorrect determination of default value (COM)). (Wez)
http://cvs.php.net/diff.php/php-src/ext/odbc/php_odbc_includes.h?r1=1.9&r2=1.9.2.1&ty=u
Index: php-src/ext/odbc/php_odbc_includes.h
diff -u php-src/ext/odbc/php_odbc_includes.h:1.9 
php-src/ext/odbc/php_odbc_includes.h:1.9.2.1
--- php-src/ext/odbc/php_odbc_includes.h:1.9Thu Jan  8 12:32:34 2004
+++ php-src/ext/odbc/php_odbc_includes.hTue May 10 09:22:12 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_odbc_includes.h,v 1.9 2004/01/08 17:32:34 sniper Exp $ */
+/* $Id: php_odbc_includes.h,v 1.9.2.1 2005/05/10 13:22:12 sniper Exp $ */
 
 #ifndef PHP_ODBC_INCLUDES_H
 #define PHP_ODBC_INCLUDES_H
@@ -216,7 +216,7 @@
 typedef struct odbc_result_value {
char name[32];
char *value;
-   long int vallen;
+   SDWORD vallen;
SDWORD coltype;
 } odbc_result_value;
 

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



[PHP-CVS] cvs: php-src /ext/standard basic_functions.c math.c php_math.h

2005-05-10 Thread Andrey Hristov
andrey  Tue May 10 08:50:53 2005 EDT

  Modified files:  
/php-src/ext/standard   basic_functions.c math.c php_math.h 
  Log:
  rename math_std_dev to math_standard_deviation (the API wasn't published
  yet)
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.713&r2=1.714&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.713 
php-src/ext/standard/basic_functions.c:1.714
--- php-src/ext/standard/basic_functions.c:1.713Mon May  2 08:12:04 2005
+++ php-src/ext/standard/basic_functions.c  Tue May 10 08:50:53 2005
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.713 2005/05/02 12:12:04 andrey Exp $ */
+/* $Id: basic_functions.c,v 1.714 2005/05/10 12:50:53 andrey Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -415,7 +415,7 @@
PHP_FE(base_convert,
NULL)
PHP_FE(number_format,   
NULL)
PHP_FE(fmod,
NULL)
-   PHP_FE(math_std_dev,
NULL)
+   PHP_FE(math_standard_deviation, 
NULL)
PHP_FE(math_variance,   
NULL)
 #ifdef HAVE_INET_NTOP
PHP_NAMED_FE(inet_ntop, php_inet_ntop,  
NULL)
http://cvs.php.net/diff.php/php-src/ext/standard/math.c?r1=1.127&r2=1.128&ty=u
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.127 php-src/ext/standard/math.c:1.128
--- php-src/ext/standard/math.c:1.127   Sat May  7 12:08:03 2005
+++ php-src/ext/standard/math.c Tue May 10 08:50:53 2005
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: math.c,v 1.127 2005/05/07 16:08:03 sniper Exp $ */
+/* $Id: math.c,v 1.128 2005/05/10 12:50:53 andrey Exp $ */
 
 #include "php.h"
 #include "php_math.h"
@@ -1193,9 +1193,9 @@
 }
 /* }}} */
 
-/* {{{ proto float math_std_dev(array a [, bool sample])
+/* {{{ proto float math_standard_deviation(array a[, bool sample = false])
Returns the standard deviation */
-PHP_FUNCTION(math_std_dev)
+PHP_FUNCTION(math_standard_deviation)
 {
zval *arr;
zend_bool sample = 0;
http://cvs.php.net/diff.php/php-src/ext/standard/php_math.h?r1=1.25&r2=1.26&ty=u
Index: php-src/ext/standard/php_math.h
diff -u php-src/ext/standard/php_math.h:1.25 
php-src/ext/standard/php_math.h:1.26
--- php-src/ext/standard/php_math.h:1.25Mon May  2 08:12:04 2005
+++ php-src/ext/standard/php_math.h Tue May 10 08:50:53 2005
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: php_math.h,v 1.25 2005/05/02 12:12:04 andrey Exp $ */
+/* $Id: php_math.h,v 1.26 2005/05/10 12:50:53 andrey Exp $ */
 
 #ifndef PHP_MATH_H
 #define PHP_MATH_H
@@ -59,7 +59,7 @@
 PHP_FUNCTION(base_convert);
 PHP_FUNCTION(number_format);
 PHP_FUNCTION(fmod);
-PHP_FUNCTION(math_std_dev);
+PHP_FUNCTION(math_standard_deviation);
 PHP_FUNCTION(math_variance);
 PHP_FUNCTION(deg2rad);
 PHP_FUNCTION(rad2deg);

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/snmp snmp.c

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 08:20:03 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/snmp   snmp.c 
  Log:
  MFH: ws fix
  
http://cvs.php.net/diff.php/php-src/ext/snmp/snmp.c?r1=1.92.2.9&r2=1.92.2.10&ty=u
Index: php-src/ext/snmp/snmp.c
diff -u php-src/ext/snmp/snmp.c:1.92.2.9 php-src/ext/snmp/snmp.c:1.92.2.10
--- php-src/ext/snmp/snmp.c:1.92.2.9Tue May 10 08:16:42 2005
+++ php-src/ext/snmp/snmp.c Tue May 10 08:20:03 2005
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: snmp.c,v 1.92.2.9 2005/05/10 12:16:42 sniper Exp $ */
+/* $Id: snmp.c,v 1.92.2.10 2005/05/10 12:20:03 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -190,7 +190,7 @@
 
 #ifdef NETSNMP_DS_LIB_DONT_PERSIST_STATE
/* Prevent update of the snmpapp.conf file */
-netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1);
+   netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1);
 #endif
 
ZEND_INIT_MODULE_GLOBALS(snmp, php_snmp_init_globals, NULL);

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



Re: [PHP-CVS] cvs: php-src /ext/standard basic_functions.c math.c php_math.h /ext/standard/tests/math math_std_dev.phpt

2005-05-10 Thread Andi Gutmans
Yeah I know I'm lagging. Currently on vacation :)
We don't usually use a rule of commonly used names in PH, but names that 
follow our coding standards. Personally, I also don't think std_dev is that 
common that everyone knows what it stands for (although they can guess). I 
don't bump into std_dev on a yearly basis even.
I agree with Jani that making this math_standard_deviation() would be 
better, especially as it's not likely to be widely used so typing a few 
extra chars shouldn't be a hassle (at least it isn't for me, but I type 
quickly).

Andi
At 02:34 PM 5/10/2005 +0300, [EMAIL PROTECTED] wrote:
 Hi Andi,
you are lagging 10 days :)
What problem do you find with math_std_dev() ?
As far as I know std_dev is the commonly used name for standard deviation.
andrey
Quoting Andi Gutmans <[EMAIL PROTECTED]>:
Damn right! :)
At 01:37 PM 5/2/2005 +0300, Jani Taskinen wrote:
Why the cryptic name? Why not math_standard_deviation() ?
And I'm pretty sure Andi will ask the same soon.. :)
--Jani
On Mon, 2 May 2005, Andrey Hristov wrote:
andrey  Mon May  2 05:17:50 2005 EDT
 Added files:
   /php-src/ext/standard/tests/math math_std_dev.phpt
 Modified files:
   /php-src/ext/standardbasic_functions.c math.c php_math.h
 Log:
 add math_std_dev()
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.711&r2=1.712&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.711 
php-src/ext/standard/basic_functions.c:1.712
--- php-src/ext/standard/basic_functions.c:1.711Wed Apr 27 
11:45:36 2005
+++ php-src/ext/standard/basic_functions.c  Mon May  2 05:17:49 2005
@@ -17,7 +17,7 @@

+--+
 */
-/* $Id: basic_functions.c,v 1.711 2005/04/27 15:45:36 dmitry Exp $ */
+/* $Id: basic_functions.c,v 1.712 2005/05/02 09:17:49 andrey Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -415,6 +415,7 @@
PHP_FE(base_convert,
 NULL)
PHP_FE(number_format,
  NULL)
PHP_FE(fmod,
 NULL)
+   PHP_FE(math_std_dev,
   NULL)
#ifdef HAVE_INET_NTOP
PHP_NAMED_FE(inet_ntop, php_inet_ntop,
   NULL)
#endif
http://cvs.php.net/diff.php/php-src/ext/standard/math.c?r1=1.119&r2=1.120&ty=u
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.119 php-src/ext/standard/math.c:1.120
--- php-src/ext/standard/math.c:1.119   Mon Dec 13 19:37:19 2004
+++ php-src/ext/standard/math.c Mon May  2 05:17:49 2005
@@ -19,7 +19,7 @@
+--+
*/
-/* $Id: math.c,v 1.119 2004/12/14 00:37:19 iliaa Exp $ */
+/* $Id: math.c,v 1.120 2005/05/02 09:17:49 andrey Exp $ */
#include "php.h"
#include "php_math.h"
@@ -1182,6 +1182,40 @@
}
/* }}} */
+
+
+/* {{{ proto float math_std_dev(array a)
+   Returns the standard deviation */
+PHP_FUNCTION(math_std_dev)
+{
+   double mean, sum = 0.0, vr = 0.0;
+   zval *arr, **entry;
+   HashPosition pos;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a",
&arr) == FAILURE) {
+   return;
+   }
+   zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos);
+   while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void 
**)&entry, &pos) == SUCCESS) {
+   convert_to_double_ex(entry);
+   sum += Z_DVAL_PP(entry);
+   zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos);
+   }
+   mean = sum / zend_hash_num_elements(Z_ARRVAL_P(arr));
+
+   zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos);
+   while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void 
**)&entry, &pos) == SUCCESS) {
+   double d;
+   convert_to_double_ex(entry);
+   d = Z_DVAL_PP(entry) - mean;
+   vr += d*d;
+   zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos);
+   }
+
+   RETURN_DOUBLE(sqrt(vr / zend_hash_num_elements(Z_ARRVAL_P(arr;
+}
+/* }}} */
+
/*
 * Local variables:
 * tab-width: 4
http://cvs.php.net/diff.php/php-src/ext/standard/php_math.h?r1=1.23&r2=1.24&ty=u
Index: php-src/ext/standard/php_math.h
diff -u php-src/ext/standard/php_math.h:1.23 
php-src/ext/standard/php_math.h:1.24
--- php-src/ext/standard/php_math.h:1.23Tue Sep 21 14:09:29 2004
+++ php-src/ext/standard/php_math.h Mon May  2 05:17:49 2005
@@ -17,7 +17,7 @@

+--+
*/
-/* $Id: php_math.h,v 1.23 2004/09/21 18:09:29 fmk Exp $ */
+/* $Id: php_math.h,v 1.24 2005/05/02 09:17:49 andrey Exp $ */
#ifndef PHP_MATH_H
#define PHP_MATH_H
@@ -59,6 +59,7 @@
PHP_FUNCTION(base_convert);
PHP_FUNCTION(number_format);
PHP_FUNCTION(fmod);
+PHP_FUNCTION(math_std_dev);
PHP_FUNCTION(deg2rad);
PHP_FUNCTION(rad2deg);
http://cvs.php.net/co.php/php-src/ext/standard/tests/math/math_std_dev.p

[PHP-CVS] cvs: php-src /ext/snmp snmp.c

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 08:19:33 2005 EDT

  Modified files:  
/php-src/ext/snmp   snmp.c 
  Log:
  ws
  
http://cvs.php.net/diff.php/php-src/ext/snmp/snmp.c?r1=1.104&r2=1.105&ty=u
Index: php-src/ext/snmp/snmp.c
diff -u php-src/ext/snmp/snmp.c:1.104 php-src/ext/snmp/snmp.c:1.105
--- php-src/ext/snmp/snmp.c:1.104   Tue May 10 08:17:01 2005
+++ php-src/ext/snmp/snmp.c Tue May 10 08:19:33 2005
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: snmp.c,v 1.104 2005/05/10 12:17:01 sniper Exp $ */
+/* $Id: snmp.c,v 1.105 2005/05/10 12:19:33 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -190,7 +190,7 @@
 
 #ifdef NETSNMP_DS_LIB_DONT_PERSIST_STATE
/* Prevent update of the snmpapp.conf file */
-netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1);
+   netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1);
 #endif
 
ZEND_INIT_MODULE_GLOBALS(snmp, php_snmp_init_globals, NULL);

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS /ext/snmp snmp.c

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 08:16:42 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
/php-src/ext/snmp   snmp.c 
  Log:
  - Fixed bug #32613 (ext/snmp: use of snmp_shutdown() causes snmpapp.conf 
access errors). (Jani, ric at arizona dot edu)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.376&r2=1.1760.2.377&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.376 php-src/NEWS:1.1760.2.377
--- php-src/NEWS:1.1760.2.376   Sun May  8 11:44:15 2005
+++ php-src/NEWSTue May 10 08:16:41 2005
@@ -39,6 +39,8 @@
   can crash PHP). (Jani)
 - Fixed bug #32615 (Segfault in replaceChild() using fragment when 
   previousSibling is NULL). (Rob)
+- Fixed bug #32613 (ext/snmp: use of snmp_shutdown() causes snmpapp.conf 
+  access errors). (Jani, ric at arizona dot edu)
 - Fixed bug #32608 (html_entity_decode() converts single quotes even if
   ENT_NOQUOTES is given). (Ilia)
 - Fixed bug #32591 (ext/mysql: Unsatisfied symbol: ntohs with HP-UX). (Jani)
http://cvs.php.net/diff.php/php-src/ext/snmp/snmp.c?r1=1.92.2.8&r2=1.92.2.9&ty=u
Index: php-src/ext/snmp/snmp.c
diff -u php-src/ext/snmp/snmp.c:1.92.2.8 php-src/ext/snmp/snmp.c:1.92.2.9
--- php-src/ext/snmp/snmp.c:1.92.2.8Wed Apr 27 19:27:44 2005
+++ php-src/ext/snmp/snmp.c Tue May 10 08:16:42 2005
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: snmp.c,v 1.92.2.8 2005/04/27 23:27:44 sniper Exp $ */
+/* $Id: snmp.c,v 1.92.2.9 2005/05/10 12:16:42 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -188,6 +188,11 @@
 {
init_snmp("snmpapp");
 
+#ifdef NETSNMP_DS_LIB_DONT_PERSIST_STATE
+   /* Prevent update of the snmpapp.conf file */
+netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1);
+#endif
+
ZEND_INIT_MODULE_GLOBALS(snmp, php_snmp_init_globals, NULL);
 
REGISTER_LONG_CONSTANT("SNMP_VALUE_LIBRARY", SNMP_VALUE_LIBRARY, 
CONST_CS | CONST_PERSISTENT);

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



[PHP-CVS] cvs: php-src /ext/snmp snmp.c

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 08:17:01 2005 EDT

  Modified files:  
/php-src/ext/snmp   snmp.c 
  Log:
  MFB: - Fixed bug #32613 (ext/snmp: use of snmp_shutdown() causes snmpapp.conf 
access errors). (Jani, ric at arizona dot edu)
  
  
http://cvs.php.net/diff.php/php-src/ext/snmp/snmp.c?r1=1.103&r2=1.104&ty=u
Index: php-src/ext/snmp/snmp.c
diff -u php-src/ext/snmp/snmp.c:1.103 php-src/ext/snmp/snmp.c:1.104
--- php-src/ext/snmp/snmp.c:1.103   Wed Apr 27 19:27:37 2005
+++ php-src/ext/snmp/snmp.c Tue May 10 08:17:01 2005
@@ -20,7 +20,7 @@
+--+
  */
 
-/* $Id: snmp.c,v 1.103 2005/04/27 23:27:37 sniper Exp $ */
+/* $Id: snmp.c,v 1.104 2005/05/10 12:17:01 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -188,6 +188,11 @@
 {
init_snmp("snmpapp");
 
+#ifdef NETSNMP_DS_LIB_DONT_PERSIST_STATE
+   /* Prevent update of the snmpapp.conf file */
+netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, 
NETSNMP_DS_LIB_DONT_PERSIST_STATE, 1);
+#endif
+
ZEND_INIT_MODULE_GLOBALS(snmp, php_snmp_init_globals, NULL);
 
REGISTER_LONG_CONSTANT("SNMP_VALUE_LIBRARY", SNMP_VALUE_LIBRARY, 
CONST_CS | CONST_PERSISTENT);

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



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/snmp php_snmp.h snmp.c

2005-05-10 Thread Jani Taskinen
sniper  Tue May 10 07:21:20 2005 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/snmp   php_snmp.h snmp.c 
  Log:
  Revert the memleak fix due to net-snmp oddity (see also bug #32613)
  
http://cvs.php.net/diff.php/php-src/ext/snmp/php_snmp.h?r1=1.14.2.6&r2=1.14.2.7&ty=u
Index: php-src/ext/snmp/php_snmp.h
diff -u php-src/ext/snmp/php_snmp.h:1.14.2.6 
php-src/ext/snmp/php_snmp.h:1.14.2.7
--- php-src/ext/snmp/php_snmp.h:1.14.2.6Wed Mar 16 11:19:59 2005
+++ php-src/ext/snmp/php_snmp.h Tue May 10 07:21:19 2005
@@ -20,7 +20,7 @@
   +--+
 */
 
-/* $Id: php_snmp.h,v 1.14.2.6 2005/03/16 16:19:59 harrie Exp $ */
+/* $Id: php_snmp.h,v 1.14.2.7 2005/05/10 11:21:19 sniper Exp $ */
 
 #ifndef PHP_SNMP_H
 #define PHP_SNMP_H
@@ -39,7 +39,6 @@
 #endif
 
 PHP_MINIT_FUNCTION(snmp);
-PHP_MSHUTDOWN_FUNCTION(snmp);
 PHP_MINFO_FUNCTION(snmp);
 
 PHP_FUNCTION(snmpget);
http://cvs.php.net/diff.php/php-src/ext/snmp/snmp.c?r1=1.70.2.21&r2=1.70.2.22&ty=u
Index: php-src/ext/snmp/snmp.c
diff -u php-src/ext/snmp/snmp.c:1.70.2.21 php-src/ext/snmp/snmp.c:1.70.2.22
--- php-src/ext/snmp/snmp.c:1.70.2.21   Wed Apr 27 19:27:53 2005
+++ php-src/ext/snmp/snmp.c Tue May 10 07:21:19 2005
@@ -20,7 +20,7 @@
   +--+
 */
 
-/* $Id: snmp.c,v 1.70.2.21 2005/04/27 23:27:53 sniper Exp $ */
+/* $Id: snmp.c,v 1.70.2.22 2005/05/10 11:21:19 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -156,7 +156,7 @@
"snmp",
snmp_functions,
PHP_MINIT(snmp),
-   PHP_MSHUTDOWN(snmp),
+   NULL,
NULL,
NULL,
PHP_MINFO(snmp),
@@ -208,16 +208,6 @@
 }
 /* }}} */
 
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(snmp)
-{
-   snmp_shutdown("snmpapp");
-
-   return SUCCESS;
-}
-/* }}} */
-
 /* {{{ PHP_MINFO_FUNCTION
  */
 PHP_MINFO_FUNCTION(snmp)

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



[PHP-CVS] cvs: php-src /ext/soap php_http.c soap.c

2005-05-10 Thread Dmitry Stogov
dmitry  Tue May 10 06:20:59 2005 EDT

  Modified files:  
/php-src/ext/soap   php_http.c soap.c 
  Log:
  Fixed SIGSEGV
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_http.c?r1=1.69&r2=1.70&ty=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.69 php-src/ext/soap/php_http.c:1.70
--- php-src/ext/soap/php_http.c:1.69Tue May 10 04:16:14 2005
+++ php-src/ext/soap/php_http.c Tue May 10 06:20:58 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_http.c,v 1.69 2005/05/10 08:16:14 dmitry Exp $ */
+/* $Id: php_http.c,v 1.70 2005/05/10 10:20:58 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -665,7 +665,7 @@
 
do {
if (!get_http_headers(stream, &http_headers, &http_header_size 
TSRMLS_CC)) {
-   efree(http_headers);
+   if (http_headers) {efree(http_headers);}
if (request != buf) {efree(request);}
php_stream_close(stream);
zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", 
sizeof("httpsocket"));
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.144&r2=1.145&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.144 php-src/ext/soap/soap.c:1.145
--- php-src/ext/soap/soap.c:1.144   Thu Apr 21 07:16:48 2005
+++ php-src/ext/soap/soap.c Tue May 10 06:20:58 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.144 2005/04/21 11:16:48 dmitry Exp $ */
+/* $Id: soap.c,v 1.145 2005/05/10 10:20:58 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -92,6 +92,9 @@
char* _old_error_code = SOAP_GLOBAL(error_code);\
zval* _old_error_object = SOAP_GLOBAL(error_object);\
int _old_soap_version = SOAP_GLOBAL(soap_version);\
+   zend_bool _old_in_compilation = CG(in_compilation); \
+   zend_bool _old_in_execution = EG(in_execution); \
+   zend_execute_data *_old_current_execute_data = 
EG(current_execute_data); \
int _bailout = 0;\
SOAP_GLOBAL(use_soap_error_handler) = 1;\
SOAP_GLOBAL(error_code) = "Client";\
@@ -100,6 +103,9 @@
 
 #define SOAP_CLIENT_END_CODE() \
} zend_catch {\
+   CG(in_compilation) = _old_in_compilation; \
+   EG(in_execution) = _old_in_execution; \
+   EG(current_execute_data) = _old_current_execute_data; \
if (EG(exception) == NULL || \
Z_TYPE_P(EG(exception)) != IS_OBJECT || \
Z_OBJCE_P(EG(exception)) != soap_fault_class_entry) {\
@@ -1837,6 +1843,9 @@
 static void soap_error_handler(int error_num, const char *error_filename, 
const uint error_lineno, const char *format, va_list args)
 {
TSRMLS_FETCH();
+   zend_bool _old_in_compilation = CG(in_compilation);
+   zend_bool _old_in_execution = EG(in_execution);
+   zend_execute_data *_old_current_execute_data = EG(current_execute_data);
 
if (!SOAP_GLOBAL(use_soap_error_handler)) {
old_error_handler(error_num, error_filename, error_lineno, 
format, args);
@@ -1886,6 +1895,9 @@
zend_try {
old_error_handler(error_num, error_filename, 
error_lineno, format, args);
} zend_catch {
+   CG(in_compilation) = _old_in_compilation;
+   EG(in_execution) = _old_in_execution;
+   EG(current_execute_data) = 
_old_current_execute_data;
} zend_end_try();
PG(display_errors) = old;
zend_bailout();
@@ -1939,6 +1951,9 @@
zend_try {
old_error_handler(error_num, error_filename, 
error_lineno, format, args);
} zend_catch {
+   CG(in_compilation) = _old_in_compilation;
+   EG(in_execution) = _old_in_execution;
+   EG(current_execute_data) = _old_current_execute_data;
} zend_end_try();
PG(display_errors) = old;
 

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/soap php_http.c soap.c

2005-05-10 Thread Dmitry Stogov
dmitry  Tue May 10 06:20:39 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/soap   php_http.c soap.c 
  Log:
  Fixed SIGSEGV
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_http.c?r1=1.55.2.15&r2=1.55.2.16&ty=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.55.2.15 
php-src/ext/soap/php_http.c:1.55.2.16
--- php-src/ext/soap/php_http.c:1.55.2.15   Tue May 10 04:15:58 2005
+++ php-src/ext/soap/php_http.c Tue May 10 06:20:38 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_http.c,v 1.55.2.15 2005/05/10 08:15:58 dmitry Exp $ */
+/* $Id: php_http.c,v 1.55.2.16 2005/05/10 10:20:38 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -665,7 +665,7 @@
 
do {
if (!get_http_headers(stream, &http_headers, &http_header_size 
TSRMLS_CC)) {
-   efree(http_headers);
+   if (http_headers) {efree(http_headers);}
if (request != buf) {efree(request);}
php_stream_close(stream);
zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", 
sizeof("httpsocket"));
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.110.2.32&r2=1.110.2.33&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.110.2.32 php-src/ext/soap/soap.c:1.110.2.33
--- php-src/ext/soap/soap.c:1.110.2.32  Thu Apr 21 08:27:54 2005
+++ php-src/ext/soap/soap.c Tue May 10 06:20:38 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.110.2.32 2005/04/21 12:27:54 dmitry Exp $ */
+/* $Id: soap.c,v 1.110.2.33 2005/05/10 10:20:38 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -92,6 +92,9 @@
char* _old_error_code = SOAP_GLOBAL(error_code);\
zval* _old_error_object = SOAP_GLOBAL(error_object);\
int _old_soap_version = SOAP_GLOBAL(soap_version);\
+   zend_bool _old_in_compilation = CG(in_compilation); \
+   zend_bool _old_in_execution = EG(in_execution); \
+   zend_execute_data *_old_current_execute_data = 
EG(current_execute_data); \
int _bailout = 0;\
SOAP_GLOBAL(use_soap_error_handler) = 1;\
SOAP_GLOBAL(error_code) = "Client";\
@@ -100,6 +103,9 @@
 
 #define SOAP_CLIENT_END_CODE() \
} zend_catch {\
+   CG(in_compilation) = _old_in_compilation; \
+   EG(in_execution) = _old_in_execution; \
+   EG(current_execute_data) = _old_current_execute_data; \
if (EG(exception) == NULL || \
Z_TYPE_P(EG(exception)) != IS_OBJECT || \
Z_OBJCE_P(EG(exception)) != soap_fault_class_entry) {\
@@ -1837,6 +1843,9 @@
 static void soap_error_handler(int error_num, const char *error_filename, 
const uint error_lineno, const char *format, va_list args)
 {
TSRMLS_FETCH();
+   zend_bool _old_in_compilation = CG(in_compilation);
+   zend_bool _old_in_execution = EG(in_execution);
+   zend_execute_data *_old_current_execute_data = EG(current_execute_data);
 
if (!SOAP_GLOBAL(use_soap_error_handler)) {
old_error_handler(error_num, error_filename, error_lineno, 
format, args);
@@ -1886,6 +1895,9 @@
zend_try {
old_error_handler(error_num, error_filename, 
error_lineno, format, args);
} zend_catch {
+   CG(in_compilation) = _old_in_compilation;
+   EG(in_execution) = _old_in_execution;
+   EG(current_execute_data) = 
_old_current_execute_data;
} zend_end_try();
PG(display_errors) = old;
zend_bailout();
@@ -1939,6 +1951,9 @@
zend_try {
old_error_handler(error_num, error_filename, 
error_lineno, format, args);
} zend_catch {
+   CG(in_compilation) = _old_in_compilation;
+   EG(in_execution) = _old_in_execution;
+   EG(current_execute_data) = _old_current_execute_data;
} zend_end_try();
PG(display_errors) = old;
 

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



Re: [PHP-CVS] cvs: php-src /ext/standard basic_functions.c math.c php_math.h /ext/standard/tests/math math_std_dev.phpt

2005-05-10 Thread Andi Gutmans
Damn right! :)
At 01:37 PM 5/2/2005 +0300, Jani Taskinen wrote:
Why the cryptic name? Why not math_standard_deviation() ?
And I'm pretty sure Andi will ask the same soon.. :)
--Jani
On Mon, 2 May 2005, Andrey Hristov wrote:
andrey  Mon May  2 05:17:50 2005 EDT
 Added files:
   /php-src/ext/standard/tests/math math_std_dev.phpt
 Modified files:
   /php-src/ext/standardbasic_functions.c math.c php_math.h
 Log:
 add math_std_dev()
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.711&r2=1.712&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.711 
php-src/ext/standard/basic_functions.c:1.712
--- php-src/ext/standard/basic_functions.c:1.711Wed Apr 27 
11:45:36 2005
+++ php-src/ext/standard/basic_functions.c  Mon May  2 05:17:49 2005
@@ -17,7 +17,7 @@
   +--+
 */

-/* $Id: basic_functions.c,v 1.711 2005/04/27 15:45:36 dmitry Exp $ */
+/* $Id: basic_functions.c,v 1.712 2005/05/02 09:17:49 andrey Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -415,6 +415,7 @@
PHP_FE(base_convert, 
NULL)
PHP_FE(number_format, 
NULL)
PHP_FE(fmod, 
NULL)
+   PHP_FE(math_std_dev, 
  NULL)
#ifdef HAVE_INET_NTOP
PHP_NAMED_FE(inet_ntop, php_inet_ntop, 
NULL)
#endif
http://cvs.php.net/diff.php/php-src/ext/standard/math.c?r1=1.119&r2=1.120&ty=u
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.119 php-src/ext/standard/math.c:1.120
--- php-src/ext/standard/math.c:1.119   Mon Dec 13 19:37:19 2004
+++ php-src/ext/standard/math.c Mon May  2 05:17:49 2005
@@ -19,7 +19,7 @@
   +--+
*/

-/* $Id: math.c,v 1.119 2004/12/14 00:37:19 iliaa Exp $ */
+/* $Id: math.c,v 1.120 2005/05/02 09:17:49 andrey Exp $ */
#include "php.h"
#include "php_math.h"
@@ -1182,6 +1182,40 @@
}
/* }}} */
+
+
+/* {{{ proto float math_std_dev(array a)
+   Returns the standard deviation */
+PHP_FUNCTION(math_std_dev)
+{
+   double mean, sum = 0.0, vr = 0.0;
+   zval *arr, **entry;
+   HashPosition pos;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a",  &arr) 
== FAILURE) {
+   return;
+   }
+   zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos);
+   while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void 
**)&entry, &pos) == SUCCESS) {
+   convert_to_double_ex(entry);
+   sum += Z_DVAL_PP(entry);
+   zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos);
+   }
+   mean = sum / zend_hash_num_elements(Z_ARRVAL_P(arr));
+
+   zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos);
+   while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void 
**)&entry, &pos) == SUCCESS) {
+   double d;
+   convert_to_double_ex(entry);
+   d = Z_DVAL_PP(entry) - mean;
+   vr += d*d;
+   zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos);
+   }
+
+   RETURN_DOUBLE(sqrt(vr / zend_hash_num_elements(Z_ARRVAL_P(arr;
+}
+/* }}} */
+
/*
 * Local variables:
 * tab-width: 4
http://cvs.php.net/diff.php/php-src/ext/standard/php_math.h?r1=1.23&r2=1.24&ty=u
Index: php-src/ext/standard/php_math.h
diff -u php-src/ext/standard/php_math.h:1.23 
php-src/ext/standard/php_math.h:1.24
--- php-src/ext/standard/php_math.h:1.23Tue Sep 21 14:09:29 2004
+++ php-src/ext/standard/php_math.h Mon May  2 05:17:49 2005
@@ -17,7 +17,7 @@
   +--+
*/

-/* $Id: php_math.h,v 1.23 2004/09/21 18:09:29 fmk Exp $ */
+/* $Id: php_math.h,v 1.24 2005/05/02 09:17:49 andrey Exp $ */
#ifndef PHP_MATH_H
#define PHP_MATH_H
@@ -59,6 +59,7 @@
PHP_FUNCTION(base_convert);
PHP_FUNCTION(number_format);
PHP_FUNCTION(fmod);
+PHP_FUNCTION(math_std_dev);
PHP_FUNCTION(deg2rad);
PHP_FUNCTION(rad2deg);
http://cvs.php.net/co.php/php-src/ext/standard/tests/math/math_std_dev.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/math/math_std_dev.phpt
+++ php-src/ext/standard/tests/math/math_std_dev.phpt
--TEST--
math_std_dev() tests
--FILE--

--EXPECT--
string(11) "2.449489743"
--
Donate @ http://pecl.php.net/wishlist.php/sniper
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-CVS] cvs: php-src /ext/soap php_http.c

2005-05-10 Thread Dmitry Stogov
dmitry  Tue May 10 04:16:14 2005 EDT

  Modified files:  
/php-src/ext/soap   php_http.c 
  Log:
  "http://cvs.php.net/diff.php/php-src/ext/soap/php_http.c?r1=1.68&r2=1.69&ty=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.68 php-src/ext/soap/php_http.c:1.69
--- php-src/ext/soap/php_http.c:1.68Wed Mar 23 03:08:54 2005
+++ php-src/ext/soap/php_http.c Tue May 10 04:16:14 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_http.c,v 1.68 2005/03/23 08:08:54 dmitry Exp $ */
+/* $Id: php_http.c,v 1.69 2005/05/10 08:16:14 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -230,6 +230,7 @@
char *connection;
int http_1_1;
int http_status;
+   int content_type_xml = 0;
char *content_encoding;
 
if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
@@ -962,6 +963,7 @@
}
if (strncmp(content_type, "text/xml", cmplen) == 0 ||
strncmp(content_type, "application/soap+xml", cmplen) == 0) 
{
+   content_type_xml = 1;
 /*
if (strncmp(http_body, " 0) {
-   char *s = *buffer;
+   if (!content_type_xml) {
+   char *s = *buffer;
 
-   while (*s != '\0' && *s < ' ') {
- s++;
-   }
-   if (strncmp(s, "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/soap php_http.c

2005-05-10 Thread Dmitry Stogov
dmitry  Tue May 10 04:15:58 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/soap   php_http.c 
  Log:
  "http://cvs.php.net/diff.php/php-src/ext/soap/php_http.c?r1=1.55.2.14&r2=1.55.2.15&ty=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.55.2.14 
php-src/ext/soap/php_http.c:1.55.2.15
--- php-src/ext/soap/php_http.c:1.55.2.14   Wed Mar 23 03:08:34 2005
+++ php-src/ext/soap/php_http.c Tue May 10 04:15:58 2005
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_http.c,v 1.55.2.14 2005/03/23 08:08:34 dmitry Exp $ */
+/* $Id: php_http.c,v 1.55.2.15 2005/05/10 08:15:58 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -230,6 +230,7 @@
char *connection;
int http_1_1;
int http_status;
+   int content_type_xml = 0;
char *content_encoding;
 
if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
@@ -962,6 +963,7 @@
}
if (strncmp(content_type, "text/xml", cmplen) == 0 ||
strncmp(content_type, "application/soap+xml", cmplen) == 0) 
{
+   content_type_xml = 1;
 /*
if (strncmp(http_body, " 0) {
-   char *s = *buffer;
+   if (!content_type_xml) {
+   char *s = *buffer;
 
-   while (*s != '\0' && *s < ' ') {
- s++;
-   }
-   if (strncmp(s, "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src(PHP_5_0) /ext/mysqli mysqli_api.c

2005-05-10 Thread Georg Richter
Am Mo, den 09.05.2005 schrieb Andrey Hristov um 23:47:

>   warn the user if he wants to prepare before fetching all previous data
>   (in case mysqli_stmt_store_result() wasn't called or not enough calls
>   to mysqli_stmt_fetch()).

Did you check this behaviour with server side cursors (MySQL 5.0) too?

/Georg
-- 
Georg Richter, Senior Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification

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