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

2003-12-18 Thread Rasmus Lerdorf
rasmus  Thu Dec 18 03:17:46 2003 EDT

  Modified files:  
/php-src/ext/gd gd.c 
  Log:
  Fix remaining gd build issue
  
  
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.280 php-src/ext/gd/gd.c:1.281
--- php-src/ext/gd/gd.c:1.280   Wed Nov 19 10:49:55 2003
+++ php-src/ext/gd/gd.c Thu Dec 18 03:17:45 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.280 2003/11/19 15:49:55 iliaa Exp $ */
+/* $Id: gd.c,v 1.281 2003/12/18 08:17:45 rasmus Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -68,7 +68,8 @@
 #endif
 #ifdef ENABLE_GD_TTF
 # ifdef HAVE_LIBFREETYPE
-#  include 
+#  include 
+#  include FT_FREETYPE_H
 # else
 #  ifdef HAVE_LIBTTF
 #   include 

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



Re: [PHP-CVS] cvs: php-src / php.ini-dist php.ini-recommended

2003-12-18 Thread Jani Taskinen

Why do you add ini options for extension that doesn't exist
in php-src ?? And there's no need to add those anyway,
document them in the manual..

--Jani


On Thu, 18 Dec 2003, John Coggeshall wrote:

>john   Wed Dec 17 21:06:01 2003 EDT
>
>  Modified files:  
>/php-src   php.ini-dist php.ini-recommended 
>  Log:
>  Adding the tidy.default_config and tidy.clean_output options to the .ini
>  files
>  
>  
>  
>Index: php-src/php.ini-dist
>diff -u php-src/php.ini-dist:1.202 php-src/php.ini-dist:1.203
>--- php-src/php.ini-dist:1.202 Thu Dec  4 07:05:54 2003
>+++ php-src/php.ini-dist   Wed Dec 17 21:06:00 2003
>@@ -578,6 +578,15 @@
> ; Module Settings ;
> ;;;
> 
>+[Tidy]
>+; The path to a default tidy configuration file to use when using tidy
>+;tidy.default_config = /usr/local/lib/php/default.tcfg
>+
>+; Should tidy clean and repair output automatically?
>+; WARNING: Do not use this option if you are generating non-html content
>+; such as dynamic images
>+tidy.clean_output = Off
>+
> [Syslog]
> ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
> ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
>Index: php-src/php.ini-recommended
>diff -u php-src/php.ini-recommended:1.147 php-src/php.ini-recommended:1.148
>--- php-src/php.ini-recommended:1.147  Thu Dec  4 07:05:54 2003
>+++ php-src/php.ini-recommendedWed Dec 17 21:06:00 2003
>@@ -598,6 +598,15 @@
> ; Module Settings ;
> ;;;
> 
>+[Tidy]
>+; The path to a default tidy configuration file to use when using tidy
>+;tidy.default_config = /usr/local/lib/php/default.tcfg
>+
>+; Should tidy clean and repair output automatically?
>+; WARNING: Do not use this option if you are generating non-html content
>+; such as dynamic images
>+tidy.clean_output = Off
>+
> [Syslog]
> ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
> ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
>
>

 

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



Re: [PHP-CVS] cvs: php-src / php.ini-dist php.ini-recommended

2003-12-18 Thread Rasmus Lerdorf
We probably should move towards the config-file-path mechanism I added a
while back.  Instead of simply specifying a php.ini file (or in addition
to if we so choose) byt default we should do a
--with-config-file-path=/etc/php (exact default path to be argued over in
numerous threads for years to come, I am sure) and have each extension
have their own .ini file with their extension-specific ini directives.

This is how we are doing it at Yahoo with what is now 100+ custom
extensions and it is actually working very nicely.

-Rasmus

On Thu, 18 Dec 2003, Jani Taskinen wrote:

>
> Why do you add ini options for extension that doesn't exist
> in php-src ?? And there's no need to add those anyway,
> document them in the manual..
>
> --Jani
>
>
> On Thu, 18 Dec 2003, John Coggeshall wrote:
>
> >john Wed Dec 17 21:06:01 2003 EDT
> >
> >  Modified files:
> >/php-src php.ini-dist php.ini-recommended
> >  Log:
> >  Adding the tidy.default_config and tidy.clean_output options to the .ini
> >  files
> >
> >
> >
> >Index: php-src/php.ini-dist
> >diff -u php-src/php.ini-dist:1.202 php-src/php.ini-dist:1.203
> >--- php-src/php.ini-dist:1.202   Thu Dec  4 07:05:54 2003
> >+++ php-src/php.ini-dist Wed Dec 17 21:06:00 2003
> >@@ -578,6 +578,15 @@
> > ; Module Settings ;
> > ;;;
> >
> >+[Tidy]
> >+; The path to a default tidy configuration file to use when using tidy
> >+;tidy.default_config = /usr/local/lib/php/default.tcfg
> >+
> >+; Should tidy clean and repair output automatically?
> >+; WARNING: Do not use this option if you are generating non-html content
> >+; such as dynamic images
> >+tidy.clean_output = Off
> >+
> > [Syslog]
> > ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
> > ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
> >Index: php-src/php.ini-recommended
> >diff -u php-src/php.ini-recommended:1.147 php-src/php.ini-recommended:1.148
> >--- php-src/php.ini-recommended:1.147Thu Dec  4 07:05:54 2003
> >+++ php-src/php.ini-recommended  Wed Dec 17 21:06:00 2003
> >@@ -598,6 +598,15 @@
> > ; Module Settings ;
> > ;;;
> >
> >+[Tidy]
> >+; The path to a default tidy configuration file to use when using tidy
> >+;tidy.default_config = /usr/local/lib/php/default.tcfg
> >+
> >+; Should tidy clean and repair output automatically?
> >+; WARNING: Do not use this option if you are generating non-html content
> >+; such as dynamic images
> >+tidy.clean_output = Off
> >+
> > [Syslog]
> > ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
> > ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
> >
> >
>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



Re: [PHP-CVS] cvs: php-src / php.ini-dist php.ini-recommended

2003-12-18 Thread John Coggeshall
Actually, it does exist in php-src. Wez added the symlink to it and it
is in the B3 tarball.

John

On Thu, 2003-12-18 at 03:27, Jani Taskinen wrote:
> Why do you add ini options for extension that doesn't exist
> in php-src ?? And there's no need to add those anyway,
> document them in the manual..
> 
> --Jani
> 
> 
> On Thu, 18 Dec 2003, John Coggeshall wrote:
> 
> >john Wed Dec 17 21:06:01 2003 EDT
> >
> >  Modified files:  
> >/php-src php.ini-dist php.ini-recommended 
> >  Log:
> >  Adding the tidy.default_config and tidy.clean_output options to the .ini
> >  files
> >  
> >  
> >  
> >Index: php-src/php.ini-dist
> >diff -u php-src/php.ini-dist:1.202 php-src/php.ini-dist:1.203
> >--- php-src/php.ini-dist:1.202   Thu Dec  4 07:05:54 2003
> >+++ php-src/php.ini-dist Wed Dec 17 21:06:00 2003
> >@@ -578,6 +578,15 @@
> > ; Module Settings ;
> > ;;;
> > 
> >+[Tidy]
> >+; The path to a default tidy configuration file to use when using tidy
> >+;tidy.default_config = /usr/local/lib/php/default.tcfg
> >+
> >+; Should tidy clean and repair output automatically?
> >+; WARNING: Do not use this option if you are generating non-html content
> >+; such as dynamic images
> >+tidy.clean_output = Off
> >+
> > [Syslog]
> > ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
> > ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
> >Index: php-src/php.ini-recommended
> >diff -u php-src/php.ini-recommended:1.147 php-src/php.ini-recommended:1.148
> >--- php-src/php.ini-recommended:1.147Thu Dec  4 07:05:54 2003
> >+++ php-src/php.ini-recommended  Wed Dec 17 21:06:00 2003
> >@@ -598,6 +598,15 @@
> > ; Module Settings ;
> > ;;;
> > 
> >+[Tidy]
> >+; The path to a default tidy configuration file to use when using tidy
> >+;tidy.default_config = /usr/local/lib/php/default.tcfg
> >+
> >+; Should tidy clean and repair output automatically?
> >+; WARNING: Do not use this option if you are generating non-html content
> >+; such as dynamic images
> >+tidy.clean_output = Off
> >+
> > [Syslog]
> > ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
> > ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
> >
> >
> 
>  
-- 
-=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=-
John Coggeshall   http://www.coggeshall.org/
The PHP Developer's Handbookhttp://www.php-handbook.com/
-=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=-

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



[PHP-CVS] cvs: php-src /ext/mbstring mbstring.c /ext/mbstring/tests bug26639.phpt

2003-12-18 Thread Moriyoshi Koizumi
moriyoshi   Thu Dec 18 04:50:21 2003 EDT

  Added files: 
/php-src/ext/mbstring/tests bug26639.phpt 

  Modified files:  
/php-src/ext/mbstring   mbstring.c 
  Log:
  Fix bug #26639 (mb_convert_variables() clutters variables beyond the references)
  
  
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.205 php-src/ext/mbstring/mbstring.c:1.206
--- php-src/ext/mbstring/mbstring.c:1.205   Wed Dec 10 12:38:45 2003
+++ php-src/ext/mbstring/mbstring.c Thu Dec 18 04:50:19 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.205 2003/12/10 17:38:45 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.206 2003/12/18 09:50:19 moriyoshi Exp $ */
 
 /*
  * PHP4 Multibyte String module "mbstring"
@@ -2605,9 +2605,13 @@
string.len = 
Z_STRLEN_PP(hash_entry);
ret = 
mbfl_buffer_converter_feed_result(convd, &string, &result);
if (ret != NULL) {
-   
STR_FREE(Z_STRVAL_PP(hash_entry));
-   
Z_STRVAL_PP(hash_entry) = (char *)ret->val;
-   
Z_STRLEN_PP(hash_entry) = ret->len;
+   if 
((*hash_entry)->refcount > 1) {
+   
ZVAL_DELREF(*hash_entry);
+   
MAKE_STD_ZVAL(*hash_entry);
+   } else {
+   
zval_dtor(*hash_entry);
+   }
+   
ZVAL_STRINGL(*hash_entry, ret->val, ret->len, 0);
}
}
}
@@ -2617,9 +2621,8 @@
string.len = Z_STRLEN_PP(var);
ret = mbfl_buffer_converter_feed_result(convd, 
&string, &result);
if (ret != NULL) {
-   STR_FREE(Z_STRVAL_PP(var));
-   Z_STRVAL_PP(var) = (char *)ret->val;
-   Z_STRLEN_PP(var) = ret->len;
+   zval_dtor(*var);
+   ZVAL_STRINGL(*var, ret->val, ret->len, 0);
}
}
}

Index: php-src/ext/mbstring/tests/bug26639.phpt
+++ php-src/ext/mbstring/tests/bug26639.phpt
--TEST--
Bug #26639 (mb_convert_variables() clutters variables beyond the references)
--SKIPIF--

--FILE--

--EXPECT--
string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(2)
string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
array(1) refcount(2){
  [0]=>
  string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(2)
}
array(1) refcount(2){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
}
array(1) refcount(2){
  [0]=>
  &string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(2)
}
array(1) refcount(2){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}

-- 
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/mbstring mbstring.c /ext/mbstring/tests bug26639.phpt

2003-12-18 Thread Moriyoshi Koizumi
moriyoshi   Thu Dec 18 04:52:52 2003 EDT

  Added files: (Branch: PHP_4_3)
/php-src/ext/mbstring/tests bug26639.phpt 

  Modified files:  
/php-src/ext/mbstring   mbstring.c 
/php-srcNEWS 
  Log:
  MFH(r-1.206): Fixed bug #26639 (mb_convert_variables() clutters variables beyond the 
references)
  
  
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.142.2.41 
php-src/ext/mbstring/mbstring.c:1.142.2.42
--- php-src/ext/mbstring/mbstring.c:1.142.2.41  Wed Dec 10 12:44:12 2003
+++ php-src/ext/mbstring/mbstring.c Thu Dec 18 04:52:49 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.142.2.41 2003/12/10 17:44:12 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.142.2.42 2003/12/18 09:52:49 moriyoshi Exp $ */
 
 /*
  * PHP4 Multibyte String module "mbstring"
@@ -3283,9 +3283,13 @@
string.len = 
Z_STRLEN_PP(hash_entry);
ret = 
mbfl_buffer_converter_feed_result(convd, &string, &result);
if (ret != NULL) {
-   
STR_FREE(Z_STRVAL_PP(hash_entry));
-   
Z_STRVAL_PP(hash_entry) = (char *)ret->val;
-   
Z_STRLEN_PP(hash_entry) = ret->len;
+   if 
((*hash_entry)->refcount > 1) {
+   
ZVAL_DELREF(*hash_entry);
+   
MAKE_STD_ZVAL(*hash_entry);
+   } else {
+   
zval_dtor(*hash_entry);
+   }
+   
ZVAL_STRINGL(*hash_entry, ret->val, ret->len, 0);
}
}
}
@@ -3295,9 +3299,8 @@
string.len = Z_STRLEN_PP(var);
ret = mbfl_buffer_converter_feed_result(convd, 
&string, &result);
if (ret != NULL) {
-   STR_FREE(Z_STRVAL_PP(var));
-   Z_STRVAL_PP(var) = (char *)ret->val;
-   Z_STRLEN_PP(var) = ret->len;
+   zval_dtor(*var);
+   ZVAL_STRINGL(*var, ret->val, ret->len, 
0);
}
}
}
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.508 php-src/NEWS:1.1247.2.509
--- php-src/NEWS:1.1247.2.508   Wed Dec 17 16:10:23 2003
+++ php-src/NEWSThu Dec 18 04:52:51 2003
@@ -9,6 +9,8 @@
 - Added a warning when creating temp stream fails with ftp_(n)list(). (Sara)
 - Fixed header handler in NSAPI SAPI module (header->replace was ignored,
   send_default_content_type now sends value from php.ini). (Uwe Schindler)
+- Fixed bug #26639 (mb_convert_variables() clutters variables beyond the
+  references). (Moriyoshi)
 - Fixed bug #26635 (fixed look up for fonts in the current directory w/ZTS).
   (Ilia)
 - Fixed Bug #26625 (pg_convert sets NULL incorrectly for character data 

Index: php-src/ext/mbstring/tests/bug26639.phpt
+++ php-src/ext/mbstring/tests/bug26639.phpt
--TEST--
Bug #26639 (mb_convert_variables() clutters variables beyond the references)
--SKIPIF--

--FILE--

--EXPECT--
string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(2)
string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
array(1) refcount(2){
  [0]=>
  string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(2)
}
array(1) refcount(2){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
}
array(1) refcount(2){
  [0]=>
  &string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(2)
}
array(1) refcount(2){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}

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



Re: [PHP-CVS] cvs: php-src / php.ini-dist php.ini-recommended

2003-12-18 Thread Jani Taskinen

Wouldn't it be a good idea to add a NEWS entry about this new 
extension?

--Jani


On Thu, 18 Dec 2003, John Coggeshall wrote:

>Actually, it does exist in php-src. Wez added the symlink to it and it
>is in the B3 tarball.
>
>John
>
>On Thu, 2003-12-18 at 03:27, Jani Taskinen wrote:
>> Why do you add ini options for extension that doesn't exist
>> in php-src ?? And there's no need to add those anyway,
>> document them in the manual..
>> 
>> --Jani
>> 
>> 
>> On Thu, 18 Dec 2003, John Coggeshall wrote:
>> 
>> >johnWed Dec 17 21:06:01 2003 EDT
>> >
>> >  Modified files:  
>> >/php-srcphp.ini-dist php.ini-recommended 
>> >  Log:
>> >  Adding the tidy.default_config and tidy.clean_output options to the .ini
>> >  files
>> >  
>> >  
>> >  
>> >Index: php-src/php.ini-dist
>> >diff -u php-src/php.ini-dist:1.202 php-src/php.ini-dist:1.203
>> >--- php-src/php.ini-dist:1.202  Thu Dec  4 07:05:54 2003
>> >+++ php-src/php.ini-distWed Dec 17 21:06:00 2003
>> >@@ -578,6 +578,15 @@
>> > ; Module Settings ;
>> > ;;;
>> > 
>> >+[Tidy]
>> >+; The path to a default tidy configuration file to use when using tidy
>> >+;tidy.default_config = /usr/local/lib/php/default.tcfg
>> >+
>> >+; Should tidy clean and repair output automatically?
>> >+; WARNING: Do not use this option if you are generating non-html content
>> >+; such as dynamic images
>> >+tidy.clean_output = Off
>> >+
>> > [Syslog]
>> > ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
>> > ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
>> >Index: php-src/php.ini-recommended
>> >diff -u php-src/php.ini-recommended:1.147 php-src/php.ini-recommended:1.148
>> >--- php-src/php.ini-recommended:1.147   Thu Dec  4 07:05:54 2003
>> >+++ php-src/php.ini-recommended Wed Dec 17 21:06:00 2003
>> >@@ -598,6 +598,15 @@
>> > ; Module Settings ;
>> > ;;;
>> > 
>> >+[Tidy]
>> >+; The path to a default tidy configuration file to use when using tidy
>> >+;tidy.default_config = /usr/local/lib/php/default.tcfg
>> >+
>> >+; Should tidy clean and repair output automatically?
>> >+; WARNING: Do not use this option if you are generating non-html content
>> >+; such as dynamic images
>> >+tidy.clean_output = Off
>> >+
>> > [Syslog]
>> > ; Whether or not to define the various syslog variables (e.g. $LOG_PID,
>> > ; $LOG_CRON, etc.).  Turning it off is a good idea performance-wise.  In
>> >
>> >
>> 
>>  
>

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



[PHP-CVS] cvs: php-src /win32 winutil.c

2003-12-18 Thread Marcus Boerger
helly   Thu Dec 18 06:05:22 2003 EDT

  Modified files:  
/php-src/win32  winutil.c 
  Log:
  Leak for b3 and find a better solution until RC1
  
Index: php-src/win32/winutil.c
diff -u php-src/win32/winutil.c:1.11 php-src/win32/winutil.c:1.12
--- php-src/win32/winutil.c:1.11Wed Dec 17 06:20:35 2003
+++ php-src/win32/winutil.c Thu Dec 18 06:05:20 2003
@@ -22,10 +22,13 @@
 {
static char *buf = NULL;
 
+#if MBO_0
+   /* leak for now */
if (buf) {
free(buf);
buf = NULL;
}
+#endif
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |   
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, 
0, NULL

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



[PHP-CVS] cvs: php-src /win32 winutil.c

2003-12-18 Thread Wez Furlong
wez Thu Dec 18 06:16:17 2003 EDT

  Modified files:  
/php-src/win32  winutil.c 
  Log:
  make sure this is initialized to NULL as we don't check the return
  value of the FormatMessage function; we could end up using a stale
  pointer.
  
  
Index: php-src/win32/winutil.c
diff -u php-src/win32/winutil.c:1.12 php-src/win32/winutil.c:1.13
--- php-src/win32/winutil.c:1.12Thu Dec 18 06:05:20 2003
+++ php-src/win32/winutil.c Thu Dec 18 06:16:16 2003
@@ -26,9 +26,11 @@
/* leak for now */
if (buf) {
free(buf);
-   buf = NULL;
}
 #endif
+
+   buf = NULL;
+
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |   
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, 
0, NULL

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



Re: [PHP-CVS] cvs: php-src /win32 winutil.c

2003-12-18 Thread Marcus Boerger
Hello,

Thursday, December 18, 2003, 12:05:22 PM, you wrote:

> helly Thu Dec 18 06:05:22 2003 EDT

>   Modified files:  
> /php-src/win32winutil.c 
>   Log:
>   Leak for b3 and find a better solution until RC1
  
The win guru's liked this behavior more for b3.
But we found out that this should be a 'non issue' since dl_error is
cannot be used in threaded environments. Hence i'd say simply remove the
ifdeffing after b3 and be done with it.

marcus

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



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

2003-12-18 Thread Wez Furlong
wez Thu Dec 18 06:18:51 2003 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  add news about tidy
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1542 php-src/NEWS:1.1543
--- php-src/NEWS:1.1542 Wed Dec 17 17:17:15 2003
+++ php-src/NEWSThu Dec 18 06:18:51 2003
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 18 Dec 2003, PHP 5 Beta 3
+- Bundled new tidy extension (John, Wez)
 - Upgraded PCRE library to version 4.5. (Andrei)
 - Dropped Windows 95 support. (Andi)
 - Moved extensions to PECL:

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



[PHP-CVS] cvs: php-src /ext/tidy php_tidy.h tidy.c

2003-12-18 Thread Wez Furlong
wez Thu Dec 18 06:20:19 2003 EDT

  Modified files:  
/php-src/ext/tidy   php_tidy.h tidy.c 
  Log:
  ZTS build and speling fix
  
Index: php-src/ext/tidy/php_tidy.h
diff -u php-src/ext/tidy/php_tidy.h:1.11 php-src/ext/tidy/php_tidy.h:1.12
--- php-src/ext/tidy/php_tidy.h:1.11Sun Dec 14 20:43:45 2003
+++ php-src/ext/tidy/php_tidy.h Thu Dec 18 06:20:19 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_tidy.h,v 1.11 2003/12/15 01:43:45 john Exp $ */
+/* $Id: php_tidy.h,v 1.12 2003/12/18 11:20:19 wez Exp $ */
 
 #ifndef PHP_TIDY_H
 #define PHP_TIDY_H
@@ -111,7 +111,7 @@
 #define FALSE 0
 #endif
 
-#define ADD_PROPERITY_STRING(_table, _key, _string) \
+#define ADD_PROPERTY_STRING(_table, _key, _string) \
{ \
zval *tmp; \
MAKE_STD_ZVAL(tmp); \
@@ -123,7 +123,7 @@
zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, 
sizeof(zval *), NULL); \
}
 
-#define ADD_PROPERITY_LONG(_table, _key, _long) \
+#define ADD_PROPERTY_LONG(_table, _key, _long) \
{ \
zval *tmp; \
MAKE_STD_ZVAL(tmp); \
@@ -131,7 +131,7 @@
zend_hash_update(_table, #_key, sizeof(#_key), (void *)&tmp, 
sizeof(zval *), NULL); \
}
 
-#define ADD_PROPERITY_NULL(_table, _key) \
+#define ADD_PROPERTY_NULL(_table, _key) \
{ \
zval *tmp; \
MAKE_STD_ZVAL(tmp); \
@@ -211,7 +211,7 @@
 static int tidy_doc_cast_handler(zval *, zval *, int, int TSRMLS_DC);
 static int tidy_node_cast_handler(zval *, zval *, int, int TSRMLS_DC);
 static void tidy_doc_update_properties(PHPTidyObj * TSRMLS_DC);
-static void tidy_add_default_properities(PHPTidyObj *, tidy_obj_type TSRMLS_DC);
+static void tidy_add_default_properties(PHPTidyObj *, tidy_obj_type TSRMLS_DC);
 static void *php_tidy_get_opt_val(PHPTidyDoc *, TidyOption, TidyOptionType * 
TSRMLS_DC);
 static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetypes);
 
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.23 php-src/ext/tidy/tidy.c:1.24
--- php-src/ext/tidy/tidy.c:1.23Wed Dec 17 11:34:10 2003
+++ php-src/ext/tidy/tidy.c Thu Dec 18 06:20:19 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: tidy.c,v 1.23 2003/12/17 16:34:10 iliaa Exp $ */
+/* $Id: tidy.c,v 1.24 2003/12/18 11:20:19 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -318,7 +318,7 @@
 
TIDY_SET_DEFAULT_CONFIG(intern->ptdoc->doc);
 
-   tidy_add_default_properities(intern, is_doc TSRMLS_CC);
+   tidy_add_default_properties(intern, is_doc TSRMLS_CC);
break;
 
default:
@@ -476,13 +476,11 @@
 {
 }
 
-/*
 static void tidy_globals_dtor(zend_tidy_globals *g TSRMLS_DC)
 {
 }
-*/
 
-static void tidy_add_default_properities(PHPTidyObj *obj, tidy_obj_type type 
TSRMLS_DC)
+static void tidy_add_default_properties(PHPTidyObj *obj, tidy_obj_type type TSRMLS_DC)
 {
 
TidyBuffer buf;
@@ -498,11 +496,11 @@
memset(&buf, 0, sizeof(buf));
tidyNodeGetText(obj->ptdoc->doc, obj->node, &buf);
buf.bp[buf.size-1] = '\0';
-   ADD_PROPERITY_STRING(obj->std.properties, value, buf.bp);
+   ADD_PROPERTY_STRING(obj->std.properties, value, buf.bp);
tidyBufFree(&buf);
 
-   ADD_PROPERITY_STRING(obj->std.properties, name, 
tidyNodeGetName(obj->node));
-   ADD_PROPERITY_LONG(obj->std.properties, type, 
tidyNodeGetType(obj->node));
+   ADD_PROPERTY_STRING(obj->std.properties, name, 
tidyNodeGetName(obj->node));
+   ADD_PROPERTY_LONG(obj->std.properties, type, 
tidyNodeGetType(obj->node));
 
switch(tidyNodeGetType(obj->node)) {
case TidyNode_Root:
@@ -512,7 +510,7 @@
break;

default:
-   ADD_PROPERITY_LONG(obj->std.properties, id, 
tidyNodeGetId(obj->node));
+   ADD_PROPERTY_LONG(obj->std.properties, id, 
tidyNodeGetId(obj->node));
}
 
tempattr = tidyAttrFirst(obj->node);
@@ -549,7 +547,7 @@
newobj->ptdoc = obj->ptdoc;
newobj->ptdoc->ref_count++;
 
-   tidy_add_default_properities(newobj, is_node 
TSRMLS_DC);
+   tidy_add_default_properties(newobj, is_node 
TSRMLS_CC);
add_next_index_zval(children, temp);
 
}

[PHP-CVS] cvs: php-src /ext/com_dotnet com_dotnet.c com_extension.c php_com_dotnet_internal.h

2003-12-18 Thread Wez Furlong
wez Thu Dec 18 06:23:22 2003 EDT

  Modified files:  
/php-src/ext/com_dotnet com_dotnet.c com_extension.c 
php_com_dotnet_internal.h 
  Log:
  Fix use of the CorRuntimeHost; once it has been stopped for a process, it cannot be 
restarted, so we keep it alive for the duration of the process, and instead close down 
the application domain in
  request shutdown.
  
Index: php-src/ext/com_dotnet/com_dotnet.c
diff -u php-src/ext/com_dotnet/com_dotnet.c:1.2 php-src/ext/com_dotnet/com_dotnet.c:1.3
--- php-src/ext/com_dotnet/com_dotnet.c:1.2 Thu Aug 14 16:31:38 2003
+++ php-src/ext/com_dotnet/com_dotnet.c Thu Dec 18 06:23:21 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: com_dotnet.c,v 1.2 2003/08/14 20:31:38 wez Exp $ */
+/* $Id: com_dotnet.c,v 1.3 2003/12/18 11:23:21 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -49,7 +49,7 @@
IUnknown *unk = NULL;
OLECHAR *olename;
 
-   stuff = emalloc(sizeof(*stuff));
+   stuff = malloc(sizeof(*stuff));
memset(stuff, 0, sizeof(*stuff));
 
if (SUCCEEDED(CoCreateInstance(&CLSID_CorRuntimeHost, NULL, CLSCTX_ALL,
@@ -84,7 +84,7 @@
ICorRuntimeHost_Stop(stuff->dotnet_host);
ICorRuntimeHost_Release(stuff->dotnet_host);
}
-   efree(stuff);
+   free(stuff);
 
return FAILURE;
}
@@ -178,18 +178,30 @@
 }
 /* }}} */
 
+void php_com_dotnet_mshutdown(TSRMLS_D)
+{
+   struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff);
+   
+   if (stuff->dotnet_domain) {
+   IDispatch_Release(stuff->dotnet_domain);
+   }
+   if (stuff->dotnet_host) {
+   ICorRuntimeHost_Stop(stuff->dotnet_host);
+   ICorRuntimeHost_Release(stuff->dotnet_host);
+   stuff->dotnet_host = NULL;
+   }
+   free(stuff);
+   COMG(dotnet_runtime_stuff) = NULL;
+}
 
 void php_com_dotnet_rshutdown(TSRMLS_D)
 {
struct dotnet_runtime_stuff *stuff = COMG(dotnet_runtime_stuff);

-   IDispatch_Release(stuff->dotnet_domain);
-   ICorRuntimeHost_Stop(stuff->dotnet_host);
-   ICorRuntimeHost_Release(stuff->dotnet_host);
-
-   efree(stuff);
-
-   COMG(dotnet_runtime_stuff) = NULL;
+   if (stuff->dotnet_domain) {
+   IDispatch_Release(stuff->dotnet_domain);
+   stuff->dotnet_domain = NULL;
+   }
 }
 
 #endif /* HAVE_MSCOREE_H */
Index: php-src/ext/com_dotnet/com_extension.c
diff -u php-src/ext/com_dotnet/com_extension.c:1.4 
php-src/ext/com_dotnet/com_extension.c:1.5
--- php-src/ext/com_dotnet/com_extension.c:1.4  Sat Dec  6 12:31:40 2003
+++ php-src/ext/com_dotnet/com_extension.c  Thu Dec 18 06:23:21 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: com_extension.c,v 1.4 2003/12/06 17:31:40 wez Exp $ */
+/* $Id: com_extension.c,v 1.5 2003/12/18 11:23:21 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -189,6 +189,12 @@
 PHP_MSHUTDOWN_FUNCTION(com_dotnet)
 {
UNREGISTER_INI_ENTRIES();
+#if HAVE_MSCOREE_H
+   if (COMG(dotnet_runtime_stuff)) {
+   php_com_dotnet_mshutdown(TSRMLS_C);
+   }
+#endif
+
zend_ts_hash_destroy(&php_com_typelibraries);
return SUCCESS;
 }
Index: php-src/ext/com_dotnet/php_com_dotnet_internal.h
diff -u php-src/ext/com_dotnet/php_com_dotnet_internal.h:1.3 
php-src/ext/com_dotnet/php_com_dotnet_internal.h:1.4
--- php-src/ext/com_dotnet/php_com_dotnet_internal.h:1.3Fri Oct 17 16:52:17 
2003
+++ php-src/ext/com_dotnet/php_com_dotnet_internal.hThu Dec 18 06:23:21 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_com_dotnet_internal.h,v 1.3 2003/10/17 20:52:17 wez Exp $ */
+/* $Id: php_com_dotnet_internal.h,v 1.4 2003/12/18 11:23:21 wez Exp $ */
 
 #ifndef PHP_COM_DOTNET_INTERNAL_H
 #define PHP_COM_DOTNET_INTERNAL_H
@@ -124,6 +124,7 @@
 /* com_dotnet.c */
 PHP_FUNCTION(com_dotnet_create_instance);
 void php_com_dotnet_rshutdown(TSRMLS_D);
+void php_com_dotnet_mshutdown(TSRMLS_D);
 
 /* com_misc.c */
 zval *php_com_throw_exception(char *message TSRMLS_DC);

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



Re: [PHP-CVS] cvs: php-src /win32 winutil.c

2003-12-18 Thread Wez Furlong
There is a deeper problem; this function is actually called
from many win32 extensions where the result is correctly free'd,
so we cannot use a static buffer here at all.

--Wez.

- Original Message - 
From: "Marcus Boerger" <[EMAIL PROTECTED]>
To: "Marcus Boerger" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, December 18, 2003 11:16 AM
Subject: Re: [PHP-CVS] cvs: php-src /win32 winutil.c


> Hello,
> 
> Thursday, December 18, 2003, 12:05:22 PM, you wrote:
> 
> > helly Thu Dec 18 06:05:22 2003 EDT
> 
> >   Modified files:  
> > /php-src/win32 winutil.c 
> >   Log:
> >   Leak for b3 and find a better solution until RC1
>   
> The win guru's liked this behavior more for b3.
> But we found out that this should be a 'non issue' since dl_error is
> cannot be used in threaded environments. Hence i'd say simply remove the
> ifdeffing after b3 and be done with it.
> 
> marcus
> 
> -- 
> 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 /main php_network.h

2003-12-18 Thread Wez Furlong
wez Thu Dec 18 06:26:01 2003 EDT

  Modified files:  
/php-src/main   php_network.h 
  Log:
  Counteract brain-death in Apache headers
  (they #define strtoul to something that will break compilation,
  and it successfully breaks the win32 IPv6 headers)
  
Index: php-src/main/php_network.h
diff -u php-src/main/php_network.h:1.49 php-src/main/php_network.h:1.50
--- php-src/main/php_network.h:1.49 Sat Dec  6 05:32:35 2003
+++ php-src/main/php_network.h  Thu Dec 18 06:26:00 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_network.h,v 1.49 2003/12/06 10:32:35 wez Exp $ */
+/* $Id: php_network.h,v 1.50 2003/12/18 11:26:00 wez Exp $ */
 
 #ifndef _PHP_NETWORK_H
 #define _PHP_NETWORK_H
@@ -27,6 +27,9 @@
 # endif
 # undef FD_SETSIZE
 # include "arpa/inet.h"
+  /* Apache folks decided that strtoul was evil and redefined
+   * it to something that breaks the windows headers */
+# undef strtoul
 /* defines socklen_t and some IPV6 stuff */
 # include 
 # if HAVE_WSPIAPI_H

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



[PHP-CVS] cvs: php-src /win32 winutil.c

2003-12-18 Thread Wez Furlong
wez Thu Dec 18 06:32:20 2003 EDT

  Modified files:  
/php-src/win32  winutil.c 
  Log:
  make it totally safe again
  
Index: php-src/win32/winutil.c
diff -u php-src/win32/winutil.c:1.13 php-src/win32/winutil.c:1.14
--- php-src/win32/winutil.c:1.13Thu Dec 18 06:16:16 2003
+++ php-src/win32/winutil.c Thu Dec 18 06:32:19 2003
@@ -1,6 +1,6 @@
 /*
+--+
-   | PHP Version 4|
+   | PHP Version 5|
+--+
| Copyright (c) 1997-2003 The PHP Group|
+--+
@@ -16,20 +16,13 @@
+--+
  */
 
+/* $Id: winutil.c,v 1.14 2003/12/18 11:32:19 wez Exp $ */
+
 #include "php.h"
 
 PHPAPI char *php_win_err(int error)
 {
-   static char *buf = NULL;
-
-#if MBO_0
-   /* leak for now */
-   if (buf) {
-   free(buf);
-   }
-#endif
-
-   buf = NULL;
+   char *buf = NULL;
 
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |   
FORMAT_MESSAGE_IGNORE_INSERTS,

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



Re: [PHP-CVS] cvs: php-src /win32 winutil.c

2003-12-18 Thread Marcus Boerger
Hello Wez,

Thursday, December 18, 2003, 12:23:27 PM, you wrote:

> There is a deeper problem; this function is actually called
> from many win32 extensions where the result is correctly free'd,
> so we cannot use a static buffer here at all.

That is wrong behavior. The behavior of dl_error() has to reflect that of
the *nix implementation where it came from and there the buffer is allocated
and freed on the next call. Since also dl_error is only called in non
threaded environments my patch seemd the correct solution. If you now tell
that windows extensions free that pointer that is an error - not the
dl_error() patch.

marcus

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



Re: [PHP-CVS] cvs: php-src /win32 winutil.c

2003-12-18 Thread Wez Furlong
This function is not used exclusively by dl_error; it is used
in many places (network, com and other win32 extensions) to
get a readable version of a win32 error code.

--Wez.

- Original Message - 
From: "Marcus Boerger" <[EMAIL PROTECTED]>
To: "Wez Furlong" <[EMAIL PROTECTED]>
Cc: "Marcus Boerger" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 18, 2003 11:47 AM
Subject: Re: [PHP-CVS] cvs: php-src /win32 winutil.c


> Hello Wez,
>
> Thursday, December 18, 2003, 12:23:27 PM, you wrote:
>
> > There is a deeper problem; this function is actually called
> > from many win32 extensions where the result is correctly free'd,
> > so we cannot use a static buffer here at all.
>
> That is wrong behavior. The behavior of dl_error() has to reflect that of
> the *nix implementation where it came from and there the buffer is
allocated
> and freed on the next call. Since also dl_error is only called in non
> threaded environments my patch seemd the correct solution. If you now tell
> that windows extensions free that pointer that is an error - not the
> dl_error() patch.
>
> marcus
>
>
>

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



Re: [PHP-CVS] cvs: php-src /win32 winutil.c

2003-12-18 Thread Wez Furlong
In addition, the memory allocated by FormatMessage() should
be free'd using LocalFree(), not free().

--Wez.

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



[PHP-CVS] cvs: php-src /ext/simplexml simplexml.c /ext/simplexml/tests 017.phpt 018.phpt

2003-12-18 Thread Dmitry Stogov
dmitry  Thu Dec 18 08:28:01 2003 EDT

  Added files: 
/php-src/ext/simplexml/tests017.phpt 018.phpt 

  Modified files:  
/php-src/ext/simplexml  simplexml.c 
  Log:
  two new methods were added
$node->count($subnode_name) - returns count of subnodes with specified name
$node->attributes() - returns array of attributes
  
  
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.96 php-src/ext/simplexml/simplexml.c:1.97
--- php-src/ext/simplexml/simplexml.c:1.96  Wed Dec 17 10:06:39 2003
+++ php-src/ext/simplexml/simplexml.c   Thu Dec 18 08:27:59 2003
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: simplexml.c,v 1.96 2003/12/17 15:06:39 dmitry Exp $ */
+/* $Id: simplexml.c,v 1.97 2003/12/18 13:27:59 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -930,6 +930,69 @@
 }
 /* }}} */
 
+/* {{{ simplexml_count()
+ */
+SXE_METHOD(count)
+{
+   char   *name;
+   int name_len;
+   HashTable  *subnodes;
+   zval  **data_ptr;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == 
FAILURE) {
+   return;
+   }
+   subnodes = sxe_properties_get(getThis() TSRMLS_CC);
+   if (zend_hash_find(subnodes, name, name_len+1, (void **) &data_ptr) == 
SUCCESS) {
+   if (Z_TYPE_PP(data_ptr) == IS_ARRAY) {
+ RETURN_LONG(zend_hash_num_elements(Z_ARRVAL_PP(data_ptr)));
+   } else {
+   RETURN_LONG(1);
+   }
+   } else {
+   RETURN_LONG(0);
+   }
+}
+/* }}} */
+
+/* {{{ simplexml_attributes()
+ */
+SXE_METHOD(attributes)
+{
+   php_sxe_object *sxe;
+   xmlNodePtr  node;
+   xmlAttrPtr  attr;
+   zval   *value = NULL;
+   char   *contents;
+
+   if (ZEND_NUM_ARGS() != 0) {
+   RETURN_FALSE;
+   }
+
+   sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
+   GET_NODE(sxe, node);
+
+   array_init(return_value);
+   if (node) {
+   attr = node->properties;
+   while (attr) {
+   if (attr->name) {
+   MAKE_STD_ZVAL(value);
+   contents = xmlNodeListGetString((xmlDocPtr) 
sxe->document->ptr, attr->children, 1);
+   ZVAL_STRING(value, contents, 1);
+   if (contents) {
+   xmlFree(contents);
+   }
+   add_assoc_zval_ex(return_value,
+   (char*)attr->name,
+   xmlStrlen(attr->name) + 1, value);
+   }
+   attr = attr->next;
+   }
+   }
+}
+/* }}} */
+
 /* {{{ cast_object()
  */
 static int
@@ -1536,6 +1599,8 @@
SXE_ME(next,   NULL, ZEND_ACC_PUBLIC)
SXE_ME(hasChildren,NULL, ZEND_ACC_PUBLIC)
SXE_ME(getChildren,NULL, ZEND_ACC_PUBLIC)
+   SXE_ME(count,  NULL, ZEND_ACC_PUBLIC)
+   SXE_ME(attributes, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
 };
 
@@ -1590,7 +1655,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, "Simplexml support", "enabled");
-   php_info_print_table_row(2, "Revision", "$Revision: 1.96 $");
+   php_info_print_table_row(2, "Revision", "$Revision: 1.97 $");
php_info_print_table_row(2, "Schema support", 
 #ifdef LIBXML_SCHEMAS_ENABLED
"enabled");

Index: php-src/ext/simplexml/tests/017.phpt
+++ php-src/ext/simplexml/tests/017.phpt
--TEST--
SimpleXML: iteration through subnodes
--SKIPIF--

--FILE--

   
 
 
   
   
 
 
   

EOF;
$xml1 =<<
   
 
   

EOF;

function print_xml($xml) {
  foreach($xml as $person) {
echo "person: ".$person['name']."\n";
foreach($person as $child) {
  echo "  child: ".$child['name']."\n";
}
  }
  echo "--\n";
}

function print_xml2($xml) {
  $persons = $xml->count("person");
  for ($i=0;$i<$persons;$i++) {
echo "person: ".$xml->person[$i]['name']."\n";
$children = $xml->person[$i]->count("child");
for ($j=0;$j<$children;$j++) {
  echo "  child: ".$xml->person[$i]->child[$j]['name']."\n";
}
  }
  echo "--\n";
}

print_xml(simplexml_load_string($xml));
print_xml(simplexml_load_string($xml1));
print_xml2(simplexml_load_string($xml));
print_xml2(simplexml_load_string($xml1));
echo "---Done---\n";
?>
--EXPECT--
person: Joe
  child: Ann
  child: Marray
person: Boe
  child: Joe
  child: Ann
--
person: Joe
  child: Ann
--
person: Joe
  child: Ann
  child: Marray
person: Boe
  child: Joe
  child: Ann
--
person: Joe
  child: Ann
--
---Done---

Index: 

[PHP-CVS] cvs: php-src /ext/simplexml/tests 014.phpt 016.phpt

2003-12-18 Thread Marcus Boerger
helly   Thu Dec 18 08:35:40 2003 EDT

  Modified files:  
/php-src/ext/simplexml/tests014.phpt 016.phpt 
  Log:
  Update tests to see where they fail now exactly
  
Index: php-src/ext/simplexml/tests/014.phpt
diff -u php-src/ext/simplexml/tests/014.phpt:1.1 
php-src/ext/simplexml/tests/014.phpt:1.2
--- php-src/ext/simplexml/tests/014.phpt:1.1Wed Dec 17 09:49:10 2003
+++ php-src/ext/simplexml/tests/014.phptThu Dec 18 08:35:39 2003
@@ -14,13 +14,16 @@
 $people = simplexml_load_string($xml);
 var_dump($people->person[0]['name']);
 var_dump($people->person[0]['age']);
-$people->person[0]['name'] = "XXX";
-$people->person[0]['age'] = 30;
+$person = $people->person[0];
+$person['name'] = "XXX";
 var_dump($people->person[0]['name']);
+$people->person[0]['age'] = 30;
 var_dump($people->person[0]['age']);
 $people->person[0]['age'] += 5;
 var_dump($people->person[0]['age']);
+echo "---Unset:---\n";
 unset($people->person[0]['age']);
+echo "---Unset?---\n";
 var_dump($people->person[0]['age']);
 var_dump(isset($people->person[0]['age']));
 echo "---Done---\n";
@@ -31,6 +34,8 @@
 string(3) "XXX"
 string(2) "30"
 string(2) "35"
+---Unset:---
+---Unset?---
 NULL
 bool(false)
 ---Done---
Index: php-src/ext/simplexml/tests/016.phpt
diff -u php-src/ext/simplexml/tests/016.phpt:1.1 
php-src/ext/simplexml/tests/016.phpt:1.2
--- php-src/ext/simplexml/tests/016.phpt:1.1Wed Dec 17 09:49:10 2003
+++ php-src/ext/simplexml/tests/016.phptThu Dec 18 08:35:39 2003
@@ -12,15 +12,28 @@
 
 $people = simplexml_load_string($xml);
 var_dump($people->person['name']);
-var_dump($people->person[0]['name']);
-$people->person[0]['name'] .= "ZZZ";
+$people->person['name'] = $people->person['name'] . 'Foo';
+var_dump($people->person['name']);
+$people->person['name'] .= 'Bar';
 var_dump($people->person['name']);
+
+echo "---[0]---\n";
+
+$people = simplexml_load_string($xml);
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] = $people->person[0]['name'] . 'Foo';
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] .= 'Bar';
 var_dump($people->person[0]['name']);
+
 echo "---Done---\n";
 ?>
 --EXPECT--
 string(3) "Joe"
+string(3) "JoeFoo"
+string(3) "JoeFooBar"
+---[0]---
 string(3) "Joe"
-string(3) "JoeZZZ"
-string(3) "JoeZZZ"
+string(3) "JoeFoo"
+string(3) "JoeFooBar"
 ---Done---

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



Re: [PHP-CVS] cvs: php-src /ext/mbstring mbstring.c /ext/mbstring/tests bug26639.phpt

2003-12-18 Thread Andi Gutmans
Shouldn't you be using some SEPARATE*() macro here? It seems as if you're 
doing something like that.

At 09:50 AM 12/18/2003 +, Moriyoshi Koizumi wrote:
moriyoshi   Thu Dec 18 04:50:21 2003 EDT

  Added files:
/php-src/ext/mbstring/tests bug26639.phpt
  Modified files:
/php-src/ext/mbstring   mbstring.c
  Log:
  Fix bug #26639 (mb_convert_variables() clutters variables beyond the 
references)

Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.205 
php-src/ext/mbstring/mbstring.c:1.206
--- php-src/ext/mbstring/mbstring.c:1.205   Wed Dec 10 12:38:45 2003
+++ php-src/ext/mbstring/mbstring.c Thu Dec 18 04:50:19 2003
@@ -17,7 +17,7 @@
+--+
  */

-/* $Id: mbstring.c,v 1.205 2003/12/10 17:38:45 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.206 2003/12/18 09:50:19 moriyoshi Exp $ */
 /*
  * PHP4 Multibyte String module "mbstring"
@@ -2605,9 +2605,13 @@
string.len = 
Z_STRLEN_PP(hash_entry);
ret = 
mbfl_buffer_converter_feed_result(convd, &string, &result);
if (ret != NULL) {
- 
STR_FREE(Z_STRVAL_PP(hash_entry));
- 
Z_STRVAL_PP(hash_entry) = (char *)ret->val;
- 
Z_STRLEN_PP(hash_entry) = ret->len;
+   if 
((*hash_entry)->refcount > 1) {
+ 
ZVAL_DELREF(*hash_entry);
+ 
MAKE_STD_ZVAL(*hash_entry);
+   } else {
+ 
zval_dtor(*hash_entry);
+   }
+ 
ZVAL_STRINGL(*hash_entry, ret->val, ret->len, 0);
}
}
}
@@ -2617,9 +2621,8 @@
string.len = Z_STRLEN_PP(var);
ret = 
mbfl_buffer_converter_feed_result(convd, &string, &result);
if (ret != NULL) {
-   STR_FREE(Z_STRVAL_PP(var));
-   Z_STRVAL_PP(var) = (char *)ret->val;
-   Z_STRLEN_PP(var) = ret->len;
+   zval_dtor(*var);
+   ZVAL_STRINGL(*var, ret->val, 
ret->len, 0);
}
}
}

Index: php-src/ext/mbstring/tests/bug26639.phpt
+++ php-src/ext/mbstring/tests/bug26639.phpt
--TEST--
Bug #26639 (mb_convert_variables() clutters variables beyond the references)
--SKIPIF--

--FILE--

$a = "‚ ‚¢‚¤‚¦‚¨";
$b = &$a;
mb_convert_variables("EUC-JP", "Shift_JIS", $b);
debug_zval_dump($a);
debug_zval_dump($b);
unset($a);
unset($b);
$a = "‚ ‚¢‚¤‚¦‚¨";
$b = array($a);
$c = $b;
mb_convert_variables("EUC-JP", "Shift_JIS", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
unset($b);
unset($c);
$a = "‚ ‚¢‚¤‚¦‚¨";
$b = array(&$a);
$c = $b;
mb_convert_variables("euc-jp", "shift_jis", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
unset($b);
unset($c);
$a = "‚ ‚¢‚¤‚¦‚¨";
$b = array($a);
$c = &$b;
mb_convert_variables("euc-jp", "shift_jis", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
unset($b);
unset($c);
$a = "‚ ‚¢‚¤‚¦‚¨";
$b = array(&$a);
$c = &$b;
mb_convert_variables("euc-jp", "shift_jis", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
unset($b);
unset($c);
?>
--EXPECT--
string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(2)
string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
array(1) refcount(2){
  [0]=>
  string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(2)
}
array(1) refcount(2){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
}
array(1) refcount(2){
  [0]=>
  &string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(2)
}
array(1) refcount(2){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
array(1) refcount(1){
  [0]=>
  string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2)
}
--
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: CVSROOT / avail

2003-12-18 Thread Andi Gutmans
andiThu Dec 18 14:24:01 2003 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  - Give Derick CVSROOT karma
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.800 CVSROOT/avail:1.801
--- CVSROOT/avail:1.800 Sun Dec 14 17:10:51 2003
+++ CVSROOT/avail   Thu Dec 18 14:24:00 2003
@@ -12,7 +12,7 @@
 # Some people also have access to the configuration files in the
 # CVSROOT.
 
-avail|sterling,goba,imajes,wez,iliaa|CVSROOT
+avail|sterling,goba,imajes,wez,iliaa,derick|CVSROOT
 
 # The PHP Developers have full access to the full source trees for
 # PHP and PEAR, as well as the documentation.

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



[PHP-CVS] cvs: CVSROOT / avail

2003-12-18 Thread Derick Rethans
derick  Thu Dec 18 14:29:50 2003 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  - Grant pearweb karma to Tobias Schlitt (toby)
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.801 CVSROOT/avail:1.802
--- CVSROOT/avail:1.801 Thu Dec 18 14:24:00 2003
+++ CVSROOT/avail   Thu Dec 18 14:29:49 2003
@@ -51,7 +51,7 @@
 avail|cox,mj,vblavet,dickmann,tal,pajoye,jmcastagnetto,alexmerz,cellog|php-src/pear
 
 # PEAR website and weekly news
-avail|alan_k,chagenbu,cmv,cox,derick,dickmann,jon,mj,pajoye,richard,tal,antonio,alexmerz,jan|pearweb
+avail|alan_k,chagenbu,cmv,cox,derick,dickmann,jon,mj,pajoye,richard,tal,antonio,alexmerz,jan,toby|pearweb
 
avail|arnaud,bjoern,chregu,dams,david,jmcastagnetto,rashid,tuupola,silvano|pearweb/weeklynews
 
 # Some people get access to the peardoc

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



Re: [PHP-CVS] cvs: php-src /ext/mbstring mbstring.c /ext/mbstring/tests bug26639.phpt

2003-12-18 Thread Moriyoshi Koizumi
On 2003/12/19, at 0:12, Andi Gutmans wrote:

Shouldn't you be using some SEPARATE*() macro here? It seems as if 
you're doing something like that.
I didn't try to use that macro because a zval_copy_ctor() call in it 
would
be redundant in this case. It seems REPLACE_ZVAL_VALUE() is a more 
suitable
macro for this purpose.

Moriyoshi

+if ((*hash_entry)->refcount > 1) {
+ZVAL_DELREF(*hash_entry);
+MAKE_STD_ZVAL(*hash_entry);
+} else {
+zval_dtor(*hash_entry);
+}
+ZVAL_STRINGL(*hash_entry, ret->val, ret->len, 0);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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

2003-12-18 Thread Moriyoshi Koizumi
moriyoshi   Thu Dec 18 14:54:28 2003 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  "a"
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1543 php-src/NEWS:1.1544
--- php-src/NEWS:1.1543 Thu Dec 18 06:18:51 2003
+++ php-src/NEWSThu Dec 18 14:54:28 2003
@@ -11,7 +11,7 @@
   . ext/qtdom (Jani, Derick)
 - Added 'c' modifier to date() which returns the date in the ISO 8601 format.
   (Derick, Manuzhai)
-- Added optional parameter to microtime() to get the time as float. (Andrey)
+- Added an optional parameter to microtime() to get the time as float. (Andrey)
 - Added MacRoman encoding support to htmlentities(). (Derick, Marcus Bointon)
 - Added possibility to call PHP functions as XSLT-functions. (Christian)
 - Added possibility to prevent PHP from registering variables when input filter

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



[PHP-CVS] cvs: php-src /ext/tidy config.m4 php_tidy.h tidy.c

2003-12-18 Thread Jani Taskinen
sniper  Thu Dec 18 14:59:59 2003 EDT

  Modified files:  
/php-src/ext/tidy   config.m4 php_tidy.h tidy.c 
  Log:
  ws & cs
  Index: php-src/ext/tidy/config.m4
diff -u php-src/ext/tidy/config.m4:1.2 php-src/ext/tidy/config.m4:1.3
--- php-src/ext/tidy/config.m4:1.2  Fri Aug  1 05:12:35 2003
+++ php-src/ext/tidy/config.m4  Thu Dec 18 14:59:58 2003
@@ -1,35 +1,38 @@
 dnl
-dnl $Id: config.m4,v 1.2 2003/08/01 09:12:35 john Exp $
+dnl $Id: config.m4,v 1.3 2003/12/18 19:59:58 sniper Exp $
 dnl
 
 PHP_ARG_WITH(tidy,for TIDY support,
 [  --with-tidy[=DIR]  Include TIDY support])
 
 if test "$PHP_TIDY" != "no"; then
-   PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared)
-   if test "$PHP_TIDY" != "yes"; then
-   TIDY_SEARCH_DIRS=$PHP_TIDY
-   else
-   TIDY_SEARCH_DIRS="/usr/local /usr"
-   fi
-   for i in $TIDY_SEARCH_DIRS; do
-   if test -f $i/include/tidy/tidy.h; then
-   TIDY_DIR=$i
-   TIDY_INCDIR=$i/include/tidy
-   elif test -f $i/include/tidy.h; then
-   TIDY_DIR=$i
-   TIDY_INCDIR=$i/include
-   fi
-   done
-
-   if test -z "$TIDY_DIR"; then
-   AC_MSG_ERROR(Cannot find libtidy)
-   fi
-
-   TIDY_LIBDIR=$TIDY_DIR/lib
-
-   AC_DEFINE(HAVE_TIDY,1,[ ])
-   PHP_SUBST(TIDY_SHARED_LIBADD)
-   PHP_ADD_LIBRARY_WITH_PATH(tidy, $TIDY_LIBDIR, TIDY_SHARED_LIBADD)
-   PHP_ADD_INCLUDE($TIDY_INCDIR)
+
+  if test "$PHP_TIDY" != "yes"; then
+TIDY_SEARCH_DIRS=$PHP_TIDY
+  else
+TIDY_SEARCH_DIRS="/usr/local /usr"
+  fi
+
+  for i in $TIDY_SEARCH_DIRS; do
+if test -f $i/include/tidy/tidy.h; then
+  TIDY_DIR=$i
+  TIDY_INCDIR=$i/include/tidy
+elif test -f $i/include/tidy.h; then
+  TIDY_DIR=$i
+  TIDY_INCDIR=$i/include
+fi
+  done
+
+  if test -z "$TIDY_DIR"; then
+AC_MSG_ERROR(Cannot find libtidy)
+  fi
+
+  TIDY_LIBDIR=$TIDY_DIR/lib
+
+  PHP_ADD_LIBRARY_WITH_PATH(tidy, $TIDY_LIBDIR, TIDY_SHARED_LIBADD)
+  PHP_ADD_INCLUDE($TIDY_INCDIR)
+
+  PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared)
+  PHP_SUBST(TIDY_SHARED_LIBADD)
+  AC_DEFINE(HAVE_TIDY,1,[ ])
 fi
Index: php-src/ext/tidy/php_tidy.h
diff -u php-src/ext/tidy/php_tidy.h:1.12 php-src/ext/tidy/php_tidy.h:1.13
--- php-src/ext/tidy/php_tidy.h:1.12Thu Dec 18 06:20:19 2003
+++ php-src/ext/tidy/php_tidy.h Thu Dec 18 14:59:58 2003
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_tidy.h,v 1.12 2003/12/18 11:20:19 wez Exp $ */
+/* $Id: php_tidy.h,v 1.13 2003/12/18 19:59:58 sniper Exp $ */
 
 #ifndef PHP_TIDY_H
 #define PHP_TIDY_H
@@ -98,9 +98,9 @@
ce.create_object = tidy_object_new_ ## name; \
tidy_ce_ ## name = zend_register_internal_class_ex(&ce, parent, NULL 
TSRMLS_CC); \
tidy_ce_ ## name->ce_flags |= ZEND_ACC_FINAL_CLASS; \
-memcpy(&tidy_object_handlers_ ## name, zend_get_std_object_handlers(), 
sizeof(zend_object_handlers)); \
+   memcpy(&tidy_object_handlers_ ## name, zend_get_std_object_handlers(), 
sizeof(zend_object_handlers)); \
tidy_object_handlers_ ## name.clone_obj = NULL; \
-}
+   }
 
 #define TIDY_TAG_CONST(tag) REGISTER_LONG_CONSTANT("TIDY_TAG_" #tag, TidyTag_##tag, 
CONST_CS | CONST_PERSISTENT)
 #define TIDY_ATTR_CONST(attr) REGISTER_LONG_CONSTANT("TIDY_ATTR_" #attr, 
TidyAttr_##attr, CONST_CS | CONST_PERSISTENT)
@@ -148,8 +148,8 @@
 #define TIDY_PARSED_REPAIR_CHECK(_obj) \
 TIDY_PARSED_CHECK(_obj); \
 if (!_obj->ptdoc->repaired) { \
-php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must clean and repair the 
document before executing this function."); \
-RETURN_FALSE; \
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must clean and repair the 
document before executing this function."); \
+   RETURN_FALSE; \
 }
 
 #define TIDY_SAFE_MODE_CHECK(filename) \
@@ -168,34 +168,33 @@
 typedef struct _PHPTidyObj PHPTidyObj;
 
 typedef enum {
-is_node,
-is_attr,
-is_doc,
-is_exception
+   is_node,
+   is_attr,
+   is_doc,
+   is_exception
 } tidy_obj_type;
 
 typedef enum {
-is_root_node,
-is_html_node,
-is_head_node,
-is_body_node
+   is_root_node,
+   is_html_node,
+   is_head_node,
+   is_body_node
 } tidy_base_nodetypes;
 
 struct _PHPTidyDoc {
-TidyDoc doc;
-TidyBuffer  *errbuf;
-zend_bool   parsed;
-zend_bool   repaired;
-unsigned int ref_count;
+   TidyDoc doc;
+   TidyBuffer  *errbuf;
+   zend_bool   parsed;
+   zend_bool   repaired;
+   unsigned int ref_count;
 };
 
 struct _PHPTidyObj {
-zend_object std;
-TidyNodenode;
-TidyAttrattr;
-tidy_obj_type   type;
-
-PHPTidyDoc  *ptdoc;
+   zend_object std;
+   TidyNodenode;
+   TidyAttr 

Re: [PHP-CVS] cvs: php-src /main php_network.h

2003-12-18 Thread Jani Taskinen

Should this have fixed the snapshot build too (of Apache2 module) ??
(just asking as it seems still be failing..)

--Jani


On Thu, 18 Dec 2003, Wez Furlong wrote:

>wezThu Dec 18 06:26:01 2003 EDT
>
>  Modified files:  
>/php-src/main  php_network.h 
>  Log:
>  Counteract brain-death in Apache headers
>  (they #define strtoul to something that will break compilation,
>  and it successfully breaks the win32 IPv6 headers)
>  
>Index: php-src/main/php_network.h
>diff -u php-src/main/php_network.h:1.49 php-src/main/php_network.h:1.50
>--- php-src/main/php_network.h:1.49Sat Dec  6 05:32:35 2003
>+++ php-src/main/php_network.h Thu Dec 18 06:26:00 2003
>@@ -16,7 +16,7 @@
>+--+
>  */
> 
>-/* $Id: php_network.h,v 1.49 2003/12/06 10:32:35 wez Exp $ */
>+/* $Id: php_network.h,v 1.50 2003/12/18 11:26:00 wez Exp $ */
> 
> #ifndef _PHP_NETWORK_H
> #define _PHP_NETWORK_H
>@@ -27,6 +27,9 @@
> # endif
> # undef FD_SETSIZE
> # include "arpa/inet.h"
>+  /* Apache folks decided that strtoul was evil and redefined
>+   * it to something that breaks the windows headers */
>+# undef strtoul
> /* defines socklen_t and some IPV6 stuff */
> # include 
> # if HAVE_WSPIAPI_H
>
>

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



[PHP-CVS] cvs: php-src /ext/dba/tests dba_cdb.phpt dba_db2.phpt dba_db3.phpt dba_db4.phpt dba_dbm.phpt dba_flatfile.phpt dba_gdbm.phpt dba_handler.inc dba_inifile.phpt dba_ndbm.phpt

2003-12-18 Thread Marcus Boerger
helly   Thu Dec 18 15:10:27 2003 EDT

  Modified files:  
/php-src/ext/dba/tests  dba_cdb.phpt dba_db2.phpt dba_db3.phpt 
dba_db4.phpt dba_dbm.phpt dba_flatfile.phpt 
dba_gdbm.phpt dba_handler.inc 
dba_inifile.phpt dba_ndbm.phpt 
  Log:
  Improve dba tests: check in both modes external and database locking.
  
  Index: php-src/ext/dba/tests/dba_cdb.phpt
diff -u php-src/ext/dba/tests/dba_cdb.phpt:1.7 php-src/ext/dba/tests/dba_cdb.phpt:1.8
--- php-src/ext/dba/tests/dba_cdb.phpt:1.7  Tue Mar  4 15:31:41 2003
+++ php-src/ext/dba/tests/dba_cdb.phpt  Thu Dec 18 15:10:24 2003
@@ -12,6 +12,7 @@
require_once('test.inc');
require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: cdb
 5Y
@@ -28,3 +29,19 @@
   ["key5"]=>
   string(23) "The last content string"
 }
+--NO-LOCK--
+5Y
+Content String 2
+array(5) {
+  ["key1"]=>
+  string(16) "Content String 1"
+  ["key2"]=>
+  string(16) "Content String 2"
+  ["key3"]=>
+  string(20) "Third Content String"
+  ["key4"]=>
+  string(22) "Another Content String"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_db2.phpt
diff -u php-src/ext/dba/tests/dba_db2.phpt:1.4 php-src/ext/dba/tests/dba_db2.phpt:1.5
--- php-src/ext/dba/tests/dba_db2.phpt:1.4  Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_db2.phpt  Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
require_once('test.inc');
require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: db2
 3NYNYY
@@ -26,4 +27,20 @@
   string(27) "Content 2 replaced 2nd time"
   ["key5"]=>
   string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_db3.phpt
diff -u php-src/ext/dba/tests/dba_db3.phpt:1.4 php-src/ext/dba/tests/dba_db3.phpt:1.5
--- php-src/ext/dba/tests/dba_db3.phpt:1.4  Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_db3.phpt  Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
require_once('test.inc');
require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: db3
 3NYNYY
@@ -26,4 +27,20 @@
   string(27) "Content 2 replaced 2nd time"
   ["key5"]=>
   string(23) "The last content string"
-}
\ No newline at end of file
+}
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_db4.phpt
diff -u php-src/ext/dba/tests/dba_db4.phpt:1.3 php-src/ext/dba/tests/dba_db4.phpt:1.4
--- php-src/ext/dba/tests/dba_db4.phpt:1.3  Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_db4.phpt  Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
require_once('test.inc');
require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: db4
 3NYNYY
@@ -27,3 +28,19 @@
   ["key5"]=>
   string(23) "The last content string"
 }
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_dbm.phpt
diff -u php-src/ext/dba/tests/dba_dbm.phpt:1.4 php-src/ext/dba/tests/dba_dbm.phpt:1.5
--- php-src/ext/dba/tests/dba_dbm.phpt:1.4  Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_dbm.phpt  Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
require_once('test.inc');
require_once('dba_handler.inc');
 ?>
+===DONE===
 --EXPECT--
 database handler: dbm
 3NYNYY
@@ -27,3 +28,19 @@
   ["key5"]=>
   string(23) "The last content string"
 }
+--NO-LOCK--
+3NYNYY
+Content String 2
+Content 2 replaced
+Read during write: not allowed
+Content 2 replaced 2nd time
+The 6th value
+array(3) {
+  ["key number 6"]=>
+  string(13) "The 6th value"
+  ["key2"]=>
+  string(27) "Content 2 replaced 2nd time"
+  ["key5"]=>
+  string(23) "The last content string"
+}
+===DONE===
Index: php-src/ext/dba/tests/dba_flatfile.phpt
diff -u php-src/ext/dba/tests/dba_flatfile.phpt:1.4 
php-src/ext/dba/tests/dba_flatfile.phpt:1.5
--- php-src/ext/dba/tests/dba_flatfile.phpt:1.4 Tue Mar  4 15:31:42 2003
+++ php-src/ext/dba/tests/dba_flatfile.phpt Thu Dec 18 15:10:24 2003
@@ -11,6 +11,7 @@
req

[PHP-CVS] cvs: php-src /ext/dba dba.c dba_flatfile.c php_dba.h /ext/dba/libinifile inifile.c

2003-12-18 Thread Marcus Boerger
helly   Thu Dec 18 15:14:16 2003 EDT

  Modified files:  
/php-src/ext/dbadba.c dba_flatfile.c php_dba.h 
/php-src/ext/dba/libinifile inifile.c 
  Log:
  Centralize ability to drop APPEND flag. This probably fixes some ini file 
  issues.
  
  
Index: php-src/ext/dba/dba.c
diff -u php-src/ext/dba/dba.c:1.106 php-src/ext/dba/dba.c:1.107
--- php-src/ext/dba/dba.c:1.106 Sun Dec 14 17:08:18 2003
+++ php-src/ext/dba/dba.c   Thu Dec 18 15:14:15 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: dba.c,v 1.106 2003/12/14 22:08:18 helly Exp $ */
+/* $Id: dba.c,v 1.107 2003/12/18 20:14:15 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -248,10 +248,10 @@
DBA_HND(db4, DBA_LOCK_ALL) /* No lock in lib */
 #endif
 #if DBA_INIFILE
-   DBA_HND(inifile, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */
+   DBA_HND(inifile, DBA_STREAM_OPEN|DBA_LOCK_ALL|DBA_CAST_AS_FD) /* No lock in 
lib */
 #endif
 #if DBA_FLATFILE
-   DBA_HND(flatfile, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */
+   DBA_HND(flatfile, DBA_STREAM_OPEN|DBA_LOCK_ALL|DBA_NO_APPEND) /* No lock in 
lib */
 #endif
{ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
 };
@@ -802,6 +802,23 @@
FREENOW;
RETURN_FALSE;
}
+   if (hptr->flags & (DBA_NO_APPEND|DBA_CAST_AS_FD)) {
+   /* Needed becasue some systems do not allow to write to the 
original 
+* file contents with O_APPEND being set.
+*/
+   if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, 
(void*)&info->fd, 1)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not 
cast stream");
+   dba_close(info TSRMLS_CC);
+   FREENOW;
+   RETURN_FALSE;
+#ifdef F_SETFL
+   } else if (modenr == DBA_CREAT) {
+   int flags = fcntl(info->fd, F_SETFL);
+   fcntl(info->fd, F_SETFL, flags & ~O_APPEND);
+#endif
+   }
+   
+   }
}
 
if (error || hptr->open(info, &error TSRMLS_CC) != SUCCESS) {
Index: php-src/ext/dba/dba_flatfile.c
diff -u php-src/ext/dba/dba_flatfile.c:1.16 php-src/ext/dba/dba_flatfile.c:1.17
--- php-src/ext/dba/dba_flatfile.c:1.16 Wed Dec 17 03:50:50 2003
+++ php-src/ext/dba/dba_flatfile.c  Thu Dec 18 15:14:15 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: dba_flatfile.c,v 1.16 2003/12/17 08:50:50 helly Exp $ */
+/* $Id: dba_flatfile.c,v 1.17 2003/12/18 20:14:15 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -41,25 +41,6 @@
 
 DBA_OPEN_FUNC(flatfile)
 {
-   int fd;
-#ifdef F_SETFL
-   int flags;
-#endif
-
-   if (info->mode != DBA_READER) {
-   if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&fd, 
1)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast 
stream");
-   return FAILURE;
-   }
-#ifdef F_SETFL
-   /* Needed becasue some systems do not allow to write to the original 
-* file contents with O_APPEND being set.
-*/
-   flags = fcntl(fd, F_SETFL);
-   fcntl(fd, F_SETFL, flags & ~O_APPEND);
-#endif
-   }
-
info->dbf = pemalloc(sizeof(flatfile), info->flags&DBA_PERSISTENT);
memset(info->dbf, 0, sizeof(flatfile));
 
Index: php-src/ext/dba/php_dba.h
diff -u php-src/ext/dba/php_dba.h:1.26 php-src/ext/dba/php_dba.h:1.27
--- php-src/ext/dba/php_dba.h:1.26  Wed Nov 12 16:43:03 2003
+++ php-src/ext/dba/php_dba.h   Thu Dec 18 15:14:15 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_dba.h,v 1.26 2003/11/12 21:43:03 helly Exp $ */
+/* $Id: php_dba.h,v 1.27 2003/12/18 20:14:15 helly Exp $ */
 
 #ifndef PHP_DBA_H
 #define PHP_DBA_H
@@ -43,6 +43,7 @@
char *path;
dba_mode_t mode;
php_stream *fp;  /* this is the database stream for builtin handlers */
+   int fd;
/* arg[cv] are only available when the dba_open handler is called! */
int argc;
zval ***argv;
@@ -64,6 +65,9 @@
 #define DBA_STREAM_OPEN  (0x0010)
 #define DBA_PERSISTENT   (0x0020)
 
+#define DBA_CAST_AS_FD   (0x0050)
+#define DBA_NO_APPEND(0x00D0)
+
 extern zend_module_entry dba_module_entry;
 #define dba_module_ptr &dba_module_entry
 
Index: php-src/ext/dba/libinifile/inifile.c
diff -u php-src/ext/dba/libinifile/inifile.c:1.11 
php-src/ext/dba/libinifile/inifile.c:1.12
--- php-src/ext/dba/libinifile/inifile.c:1.11   Wed Dec 17 03:50:50 2003
+++ php

[PHP-CVS] cvs: php-src / NEWS /ext/dba config.m4 dba.c dba_qdbm.c /ext/dba/tests dba_qdbm.phpt

2003-12-18 Thread Marcus Boerger
helly   Thu Dec 18 15:25:21 2003 EDT

  Added files: 
/php-src/ext/dbadba_qdbm.c 
/php-src/ext/dba/tests  dba_qdbm.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/dbaconfig.m4 dba.c 
  Log:
  dded qdbm handler (http://qdbm.sourceforge.net).
  
  Index: php-src/NEWS
diff -u php-src/NEWS:1.1545 php-src/NEWS:1.1546
--- php-src/NEWS:1.1545 Thu Dec 18 15:07:29 2003
+++ php-src/NEWSThu Dec 18 15:25:19 2003
@@ -18,6 +18,7 @@
   support is used. (Derick)
 - Added iconv stream filter (convert.iconv.*). (Moriyoshi)
 - Added EXSLT support in ext/xsl. (Christian)
+- Added qdbm handler for dba extension. (mg at iceni dot pl, Marcus)
 - Added new functions:
   . dba_key_split() to split inifile keys in an array. (Marcus)
   . time_nanosleep() signal safe sleep (Magnus, Ilia)
Index: php-src/ext/dba/config.m4
diff -u php-src/ext/dba/config.m4:1.58 php-src/ext/dba/config.m4:1.59
--- php-src/ext/dba/config.m4:1.58  Sun Dec  7 10:59:13 2003
+++ php-src/ext/dba/config.m4   Thu Dec 18 15:25:20 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.58 2003/12/07 15:59:13 helly Exp $
+dnl $Id: config.m4,v 1.59 2003/12/18 20:25:20 helly Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -65,10 +65,45 @@
 PHP_ARG_ENABLE(dba,whether to enable DBA,
 [  --enable-dbaBuild DBA with builtin modules])
 
+AC_ARG_WITH(qdbm,
+[  --with-qdbm[=DIR] DBA: Include QDBM support],[
+  if test "$withval" != "no"; then
+PHP_DBA_STD_BEGIN
+for i in $withval /usr/local /usr; do
+  if test -f "$i/include/depot.h"; then
+THIS_PREFIX=$i
+THIS_INCLUDE=$i/include/depot.h
+break
+  fi
+done
+
+if test -n "$THIS_INCLUDE"; then
+  for LIB in qdbm; do
+PHP_CHECK_LIBRARY($LIB, dpopen, [
+  AC_DEFINE_UNQUOTED(QDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
+  AC_DEFINE(DBA_QDBM, 1, [ ])
+  THIS_LIBS=$LIB
+], [], [-L$THIS_PREFIX/lib])
+if test -n "$THIS_LIBS"; then
+  break
+fi
+  done
+fi
+
+PHP_DBA_STD_ASSIGN
+PHP_DBA_STD_CHECK
+PHP_DBA_STD_ATTACH
+  fi
+])
+AC_DBA_STD_RESULT(qdbm)
+
 AC_ARG_WITH(gdbm,
 [  --with-gdbm[=DIR] DBA: Include GDBM support],[
   if test "$withval" != "no"; then
 PHP_DBA_STD_BEGIN
+if test "$HAVE_QDBM" = "1"; then
+  AC_DBA_STD_RESULT(gdbm,gdbm,You cannot combine --with-gdbm with --with-qdbm)
+fi
 for i in $withval /usr/local /usr; do
   if test -f "$i/include/gdbm.h"; then
 THIS_PREFIX=$i
@@ -300,6 +335,9 @@
 [  --with-dbm[=DIR]  DBA: Include DBM support],[
   if test "$withval" != "no"; then
 PHP_DBA_STD_BEGIN
+if test "$HAVE_QDBM" = "1"; then
+  AC_DBA_STD_RESULT(dbm,dbm,You cannot combine --with-dbm with --with-qdbm)
+fi
 for i in $withval /usr/local /usr; do
   if test -f "$i/include/dbm.h"; then
 THIS_PREFIX=$i
@@ -429,7 +467,7 @@
 if test "$HAVE_DBA" = "1"; then
   AC_MSG_RESULT(yes)
   AC_DEFINE(HAVE_DBA, 1, [ ])
-  PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c 
dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c $cdb_sources $flat_sources 
$ini_sources, $ext_shared)
+  PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c 
dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c $cdb_sources $flat_sources 
$ini_sources, $ext_shared)
   PHP_ADD_BUILD_DIR($ext_builddir/libinifile)
   PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
   PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
Index: php-src/ext/dba/dba.c
diff -u php-src/ext/dba/dba.c:1.107 php-src/ext/dba/dba.c:1.108
--- php-src/ext/dba/dba.c:1.107 Thu Dec 18 15:14:15 2003
+++ php-src/ext/dba/dba.c   Thu Dec 18 15:25:20 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: dba.c,v 1.107 2003/12/18 20:14:15 helly Exp $ */
+/* $Id: dba.c,v 1.108 2003/12/18 20:25:20 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -48,6 +48,7 @@
 #include "php_db4.h"
 #include "php_flatfile.h"
 #include "php_inifile.h"
+#include "php_qdbm.h"
 
 /* {{{ dba_functions[]
  */
@@ -253,6 +254,9 @@
 #if DBA_FLATFILE
DBA_HND(flatfile, DBA_STREAM_OPEN|DBA_LOCK_ALL|DBA_NO_APPEND) /* No lock in 
lib */
 #endif
+#if DBA_QDBM
+   DBA_HND(qdbm, DBA_LOCK_EXT)
+#endif
{ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
 };
 
@@ -270,6 +274,8 @@
 #define DBA_DEFAULT "ndbm"
 #elif DBA_DBM
 #define DBA_DEFAULT "dbm"
+#elif DBA_QDBM
+#define DBA_DEFAULT "qdbm"
 #else
 #define DBA_DEFAULT ""
 #endif

Index: php-src/ext/dba/dba_qdbm.c
+++ php-src/ext/dba/dba_qdbm.c
/*
   +--+
   | PHP Version 4|
   +--+
   | Copyright (c) 199

[PHP-CVS] cvs: php-src /ext/dba php_qdbm.h

2003-12-18 Thread Marcus Boerger
helly   Thu Dec 18 15:32:40 2003 EDT

  Added files: 
/php-src/ext/dbaphp_qdbm.h 
  Log:
  Add this file too
  

Index: php-src/ext/dba/php_qdbm.h
+++ php-src/ext/dba/php_qdbm.h
#ifndef PHP_QDBM_H
#define PHP_QDBM_H

#if DBA_QDBM

#include "php_dba.h"

DBA_FUNCS(qdbm);

#endif

#endif

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



[PHP-CVS] cvs: php-src / NEWS /ext/sqlite php_sqlite.h sqlite.c /ext/sqlite/tests sqlite_026.phpt sqlite_oo_028.phpt

2003-12-18 Thread Ilia Alshanetsky
iliaa   Thu Dec 18 16:28:01 2003 EDT

  Added files: 
/php-src/ext/sqlite/tests   sqlite_026.phpt sqlite_oo_028.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/sqlite php_sqlite.h sqlite.c 
  Log:
  Added sqlite_fetch_column_types() function.
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1546 php-src/NEWS:1.1547
--- php-src/NEWS:1.1546 Thu Dec 18 15:25:19 2003
+++ php-src/NEWSThu Dec 18 16:27:59 2003
@@ -29,6 +29,7 @@
   . stream_socket_sendto() and stream_socket_recvfrom(). (Wez)
   . iconv_mime_decode_headers(). (Moriyoshi)
   . get_declared_interfaces(). (Andrey, Marcus)
+  . sqlite_fetch_column_types(). (Ilia)
 - Added proxy support to http:// wrapper. (Sara)
 - Added rename(), rmdir() and mkdir() support to userstreams. (Sara)
 - Added rename(), rmdir() and mkdir() support to ftp:// wrapper. (Sara)
Index: php-src/ext/sqlite/php_sqlite.h
diff -u php-src/ext/sqlite/php_sqlite.h:1.26 php-src/ext/sqlite/php_sqlite.h:1.27
--- php-src/ext/sqlite/php_sqlite.h:1.26Thu Aug 28 19:19:51 2003
+++ php-src/ext/sqlite/php_sqlite.h Thu Dec 18 16:28:00 2003
@@ -17,7 +17,7 @@
|  Marcus Boerger <[EMAIL PROTECTED]>  |
+--+
 
-   $Id: php_sqlite.h,v 1.26 2003/08/28 23:19:51 helly Exp $ 
+   $Id: php_sqlite.h,v 1.27 2003/12/18 21:28:00 iliaa Exp $ 
 */
 
 #ifndef PHP_SQLITE_H
@@ -88,6 +88,8 @@
 
 PHP_FUNCTION(sqlite_factory);
 
+PHP_FUNCTION(sqlite_fetch_column_types);
+
 ZEND_BEGIN_MODULE_GLOBALS(sqlite)
 int assoc_case;
 ZEND_END_MODULE_GLOBALS(sqlite)
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.104 php-src/ext/sqlite/sqlite.c:1.105
--- php-src/ext/sqlite/sqlite.c:1.104   Sun Dec 14 13:45:36 2003
+++ php-src/ext/sqlite/sqlite.c Thu Dec 18 16:28:00 2003
@@ -17,7 +17,7 @@
|  Marcus Boerger <[EMAIL PROTECTED]>  |
+--+
 
-   $Id: sqlite.c,v 1.104 2003/12/14 18:45:36 iliaa Exp $ 
+   $Id: sqlite.c,v 1.105 2003/12/18 21:28:00 iliaa Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -192,6 +192,7 @@
PHP_FE(sqlite_factory, third_arg_force_ref)
PHP_FE(sqlite_udf_encode_binary, NULL)
PHP_FE(sqlite_udf_decode_binary, NULL)
+   PHP_FE(sqlite_fetch_column_types, NULL)
{NULL, NULL, NULL}
 };
 
@@ -211,6 +212,7 @@
PHP_ME_MAPPING(create_function, sqlite_create_function, NULL)
PHP_ME_MAPPING(busy_timeout, sqlite_busy_timeout, NULL)
PHP_ME_MAPPING(last_error, sqlite_last_error, NULL)
+   PHP_ME_MAPPING(fetch_column_types, sqlite_fetch_column_types, NULL)
 /* PHP_ME_MAPPING(error_string, sqlite_error_string, NULL) static */
 /* PHP_ME_MAPPING(escape_string, sqlite_escape_string, NULL) static */
{NULL, NULL, NULL}
@@ -1071,7 +1073,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, "SQLite support", "enabled");
-   php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " 
$Id: sqlite.c,v 1.104 2003/12/14 18:45:36 iliaa Exp $");
+   php_info_print_table_row(2, "PECL Module version", PHP_SQLITE_MODULE_VERSION " 
$Id: sqlite.c,v 1.105 2003/12/18 21:28:00 iliaa Exp $");
php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
php_info_print_table_end();
@@ -1552,6 +1554,72 @@
 }
 /* }}} */
 
+/* {{{ proto resource sqlite_fetch_column_types(string table_name, resource db)
+   Return an array of column types from a particular table. */
+PHP_FUNCTION(sqlite_fetch_column_types)
+{
+   zval *zdb;
+   struct php_sqlite_db *db;
+   char *tbl, *sql;
+   long tbl_len;
+   char *errtext = NULL;
+   zval *object = getThis();
+   struct php_sqlite_result res;
+   const char **rowdata, **colnames, *tail;
+   int i, ncols;
+
+   if (object) {
+   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", 
&tbl, &tbl_len)) {
+   return;
+   }
+   DB_FROM_OBJECT(db, object);
+   } else {
+   if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
+   ZEND_NUM_ARGS() TSRMLS_CC, "sr", &tbl, &tbl_len, &zdb) 
&& 
+   FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
"rs", &zdb, &tbl, &tbl_len)) {
+   return;
+   }
+   DB_FROM_ZVAL(db, &zdb);
+   }
+
+   if (!(sql = sqlite_mprintf("SELECT * FROM %q LIMIT 1", tbl))) {
+   RETURN_FALSE;
+   }
+
+   sqlite_exec(db->db, "PRAGMA show_datatypes = ON", NULL, NULL, &errtext);
+
+   db->last_err_code = sqlite_compile(db->db, sql, &tail, &res.vm, &errtext);
+
+   sqlite_freemem(sql);
+
+   

[PHP-CVS] cvs: php-src /ext/standard/tests/array array_sum.phpt

2003-12-18 Thread Andrey Hristov
andrey  Thu Dec 18 17:12:30 2003 EDT

  Added files: 
/php-src/ext/standard/tests/array   array_sum.phpt 
  Log:
  test case for array_sum
  
  

Index: php-src/ext/standard/tests/array/array_sum.phpt
+++ php-src/ext/standard/tests/array/array_sum.phpt
--TEST--
Test array_sum()
--FILE--

--EXPECT--
int(500500)
int(500500)
float(55)
float(55)

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