RE: [PHP-CVS] cvs: php4 /ext/overload .cvsignore CREDITS README config.m4 overload.c overload.dsp php_overload.h
> At 00:40 11.01.2003, Harald Radi wrote: > >phanto Fri Jan 10 18:40:13 2003 EDT > > > > Removed files: > > /php4/ext/overload .cvsignore config.m4 CREDITS overload.c > > overload.dsp php_overload.h README > > Log: > > this is now implemented by the engine itself > > > But now you removed it for ZE1, too. > > Wouldn't it be better to simply disable overload in ZE2 as we did > until you removed it? overload is implemented in ZE2 itself, so why keep it in the sources twice ? harald -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/com .cvsignore COM.c CREDITS TODO VARIANT.c com.h conversion.c conversion.h dispatch.c php_COM.h php_VARIANT.h variant.h
> At 00:39 11.01.2003, Harald Radi wrote: > >phanto Fri Jan 10 18:39:10 2003 EDT > > > > Removed files: > > /php4/ext/com .cvsignore COM.c com.h conversion.c > conversion.h > > CREDITS dispatch.c php_COM.h > php_VARIANT.h TODO > > VARIANT.c variant.h > > Log: > > ext/com is not compatible with ZE2, the ZE2 version is located in > > ext/rpc/com > > > > Does this mean you removed the wrong files? Removed files: > > /php4/ext/com the ZE2 version is located in > > ext/rpc/com so what's wrong ? harald -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc rpc.c rpc_proxy.c /ext/rpc/com variant.c
phanto Sat Jan 11 03:59:37 2003 EDT
Modified files:
/php4/ext/rpc rpc.c rpc_proxy.c
/php4/ext/rpc/com variant.c
Log:
fix build
Index: php4/ext/rpc/rpc.c
diff -u php4/ext/rpc/rpc.c:1.15 php4/ext/rpc/rpc.c:1.16
--- php4/ext/rpc/rpc.c:1.15 Tue Dec 31 11:07:22 2002
+++ php4/ext/rpc/rpc.c Sat Jan 11 03:59:36 2003
@@ -66,8 +66,6 @@
NULL,
rpc_get,
rpc_set,
- NULL,
- NULL,
rpc_has_property,
rpc_unset_property,
rpc_get_properties,
@@ -139,6 +137,24 @@
zend_llist_init(classes_list, sizeof(rpc_class_hash **), rpc_class_dtor, TRUE);
FOREACH_HANDLER {
+ /*
+ handle = DL_LOAD(path);
+ if (!handle) {
+#ifndef ZEND_WIN32
+ fprintf(stderr, "Failed loading %s: %s\n", path, DL_ERROR());
+#else
+ fprintf(stderr, "Failed loading %s\n", path);
+#endif
+ return FAILURE;
+ }
+
+ extension_version_info = (zend_extension_version_info *)
+DL_FETCH_SYMBOL(handle, "extension_version_info");
+ new_extension = (zend_extension *) DL_FETCH_SYMBOL(handle,
+"zend_extension_entry");
+ if (!extension_version_info || !new_extension) {
+ fprintf(stderr, "%s doesn't appear to be a valid Zend extension\n",
+path);
+ return FAILURE;
+ }
+*/
zend_class_entry ce;
HANDLER.rpc_handler_init(module_number TSRMLS_CC);
@@ -155,7 +171,7 @@
/* register classes and functions */
*HANDLER.ce = zend_register_internal_class_ex(&ce, rpc_entry, NULL
TSRMLS_CC);
- zend_register_functions(HANDLER.functions, NULL, MODULE_PERSISTENT
TSRMLS_CC);
+ zend_register_functions(NULLHANDLER.functions, NULL, MODULE_PERSISTENT
+TSRMLS_CC);
zend_register_ini_entries(HANDLER.ini, module_number TSRMLS_CC);
}
Index: php4/ext/rpc/rpc_proxy.c
diff -u php4/ext/rpc/rpc_proxy.c:1.5 php4/ext/rpc/rpc_proxy.c:1.6
--- php4/ext/rpc/rpc_proxy.c:1.5Tue Dec 31 11:07:22 2002
+++ php4/ext/rpc/rpc_proxy.cSat Jan 11 03:59:36 2003
@@ -52,8 +52,6 @@
NULL,
rpc_proxy_get,
rpc_proxy_set,
- NULL,
- NULL,
rpc_proxy_has_property,
rpc_proxy_unset_property,
rpc_proxy_get_properties,
Index: php4/ext/rpc/com/variant.c
diff -u php4/ext/rpc/com/variant.c:1.34 php4/ext/rpc/com/variant.c:1.35
--- php4/ext/rpc/com/variant.c:1.34 Tue Dec 31 11:07:23 2002
+++ php4/ext/rpc/com/variant.c Sat Jan 11 03:59:36 2003
@@ -62,8 +62,6 @@
NULL,
NULL,
NULL,
- NULL,
- NULL,
variant_get_constructor,
variant_get_class_entry,
NULL,
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/com .cvsignore COM.c CREDITS TODO VARIANT.c com.h conversion.c conversion.h dispatch.c php_COM.h php_VARIANT.hvariant.h
> so what's wrong ? You removed those files from the PHP 5 branch which you claimed were supposed to be used in the PHP 5 branch. - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/com .cvsignore COM.c CREDITS TODO VARIANT.c com.h conversion.c conversion.h dispatch.c php_COM.h php_VARIANT.h variant.h
i remove ext/com and claimed that ext/rpc/com is used from now on, am i blind or what ? > -Original Message- > From: Sascha Schumann [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 11, 2003 10:33 AM > To: Harald Radi > Cc: [EMAIL PROTECTED]; 'Harald Radi'; > [EMAIL PROTECTED] > Subject: RE: [PHP-CVS] cvs: php4 /ext/com .cvsignore COM.c > CREDITS TODO VARIANT.c com.h conversion.c conversion.h > dispatch.c php_COM.h php_VARIANT.h variant.h > > > > so what's wrong ? > > You removed those files from the PHP 5 branch which you > claimed were supposed to be used in the PHP 5 branch. > > - Sascha > -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/com .cvsignore COM.c CREDITS TODO VARIANT.c com.h conversion.c conversion.h dispatch.c php_COM.h php_VARIANT.h variant.h
At 09:57 11.01.2003, Harald Radi wrote: Removed files: > > /php4/ext/com the ZE2 version is located in > > ext/rpc/com so what's wrong ? ok my fault - i just missread the mail sorry marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/overload .cvsignore CREDITS README config.m4 overload.c overload.dsp php_overload.h
At 09:56 11.01.2003, Harald Radi wrote: > At 00:40 11.01.2003, Harald Radi wrote: > >phanto Fri Jan 10 18:40:13 2003 EDT > > > > Removed files: > > /php4/ext/overload .cvsignore config.m4 CREDITS overload.c > > overload.dsp php_overload.h README > > Log: > > this is now implemented by the engine itself > > > But now you removed it for ZE1, too. > > Wouldn't it be better to simply disable overload in ZE2 as we did > until you removed it? overload is implemented in ZE2 itself, so why keep it in the sources twice ? yes - but this makes building HEAD + ZE1 + overload impossible while you could do HEAD + ZE1 - overload perfectly even in the future. In other words as long as some people will use ZE1 they need to reconfigure and may perhaps miss overload functionality. marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/overload .cvsignore CREDITS README config.m4 overload.c overload.dsp php_overload.h
> yes - but this makes building HEAD + ZE1 + overload impossible > while you could do HEAD + ZE1 - overload perfectly even in the future. > In other words as long as some people will use ZE1 they need to > reconfigure and may perhaps miss overload functionality. we decided to push HEAD towards ZE2, so it won't successfully build with ZE1 very soon (maybe you can compile it, but the executeable wouldn't be worth very much). If you want to do ZE1 builds you can still check out the 4.3 branch and you get your overload extension back. harald -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/overload .cvsignore CREDITS READMEconfig.m4 overload.c overload.dsp php_overload.h
On Sat, 11 Jan 2003, Harald Radi wrote: > > yes - but this makes building HEAD + ZE1 + overload impossible > > while you could do HEAD + ZE1 - overload perfectly even in the future. > > In other words as long as some people will use ZE1 they need to > > reconfigure and may perhaps miss overload functionality. > > we decided to push HEAD towards ZE2, so it won't successfully > build with ZE1 very soon (maybe you can compile it, but the > executeable wouldn't be worth very much). If you want to do ZE1 > builds you can still check out the 4.3 branch and you get your > overload extension back. That's the problem with super secret mailing lists -- decisions are not transparent. Oh, and btw, even I missed that thread. - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/rpc rpc.c
sebastian Sat Jan 11 04:51:52 2003 EDT Modified files: /php4/ext/rpc rpc.c Log: Add missing ,. Index: php4/ext/rpc/rpc.c diff -u php4/ext/rpc/rpc.c:1.16 php4/ext/rpc/rpc.c:1.17 --- php4/ext/rpc/rpc.c:1.16 Sat Jan 11 03:59:36 2003 +++ php4/ext/rpc/rpc.c Sat Jan 11 04:51:52 2003 @@ -171,7 +171,7 @@ /* register classes and functions */ *HANDLER.ce = zend_register_internal_class_ex(&ce, rpc_entry, NULL TSRMLS_CC); - zend_register_functions(NULLHANDLER.functions, NULL, MODULE_PERSISTENT TSRMLS_CC); + zend_register_functions(NULL, HANDLER.functions, NULL, +MODULE_PERSISTENT TSRMLS_CC); zend_register_ini_entries(HANDLER.ini, module_number TSRMLS_CC); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/overload .cvsignore CREDITS README config.m4 overload.c overload.dsp php_overload.h
At 10:46 11.01.2003, Harald Radi wrote: > yes - but this makes building HEAD + ZE1 + overload impossible > while you could do HEAD + ZE1 - overload perfectly even in the future. > In other words as long as some people will use ZE1 they need to > reconfigure and may perhaps miss overload functionality. we decided to push HEAD towards ZE2, so it won't successfully build with ZE1 very soon (maybe you can compile it, but the executeable wouldn't be worth very much). If you want to do ZE1 builds you can still check out the 4.3 branch and you get your overload extension back. One more reason for what i said already: Then we should make HEAD builds against ZE1 impossible by configure. and i am already using ZE2 a long time ... but testing with 4.2,4.3 releases requires i also have ZE1 builds. marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php4 /ext/overload .cvsignore CREDITS README config.m4 overload.c overload.dsp php_overload.h
> One more reason for what i said already: > Then we should make HEAD builds against ZE1 impossible by configure. good point, i'll forward this to the super secret mailing list. > and i am already using ZE2 a long time ... but testing with > 4.2,4.3 releases > requires i also have ZE1 builds. yup, and you can still get them by checking out the php 4.3 branch. harald -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/dotnet .cvsignore CREDITS EXPERIMENTAL README dotnet.cpp dotnet.dsp dotnet.php php_dotnet.h /ext/java .cvsignore CREDITS EXPERIMENTAL Makefile.frag README config.m4 except.php java.c java.dsp jawt.php jver.php reflect.java
derick Sat Jan 11 07:23:46 2003 EDT Removed files: /php4/ext/java .cvsignore CREDITS EXPERIMENTAL Makefile.frag README config.m4 except.php java.c java.dsp jawt.php jver.php reflect.java /php4/ext/dotnet.cvsignore CREDITS EXPERIMENTAL README dotnet.cpp dotnet.dsp dotnet.php php_dotnet.h Log: - Moving java and dotnet extensions to ext/rpc -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard string.c
iliaa Sat Jan 11 12:52:39 2003 EDT
Modified files:
/php4/ext/standard string.c
Log:
Added stripos() & strripos() functions.
Added 3rd parameter (offset) to strrpos().
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.343 php4/ext/standard/string.c:1.344
--- php4/ext/standard/string.c:1.343Mon Jan 6 17:13:03 2003
+++ php4/ext/standard/string.c Sat Jan 11 12:52:38 2003
@@ -18,7 +18,7 @@
+--+
*/
-/* $Id: string.c,v 1.343 2003/01/06 22:13:03 iliaa Exp $ */
+/* $Id: string.c,v 1.344 2003/01/11 17:52:38 iliaa Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -1481,24 +1481,142 @@
}
/* }}} */
-/* {{{ proto int strrpos(string haystack, string needle)
+/* {{{ proto int stripos(string haystack, string needle [, int offset])
+ Finds position of first occurrence of a string within another, case insensitive */
+PHP_FUNCTION(stripos)
+{
+ char *found = NULL;
+ char *haystack;
+ int haystack_len;
+ long offset = 0;
+ char *needle_dup = NULL, *haystack_dup;
+ char needle_char[2];
+ zval *needle;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &haystack,
+&haystack_len, &needle, &offset) == FAILURE) {
+ return;
+ }
+ if (offset < 0 || offset > haystack_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in
+string.");
+ RETURN_FALSE;
+ }
+
+ haystack_dup = estrndup(haystack, haystack_len);
+ php_strtolower(haystack_dup, haystack_len);
+
+ if (Z_TYPE_P(needle) == IS_STRING) {
+ needle_dup = estrndup(Z_STRVAL_P(needle), Z_STRLEN_P(needle));
+ php_strtolower(needle_dup, Z_STRLEN_P(needle));
+ found = php_memnstr(haystack_dup + offset, needle_dup,
+Z_STRLEN_P(needle), haystack_dup + haystack_len);
+ } else {
+ switch (Z_TYPE_P(needle)) {
+ case IS_LONG:
+ case IS_BOOL:
+ needle_char[0] = tolower((char) Z_LVAL_P(needle));
+ break;
+ case IS_DOUBLE:
+ needle_char[0] = tolower((char) Z_DVAL_P(needle));
+ break;
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "needle is
+not a string or an integer.");
+ efree(haystack_dup);
+ RETURN_FALSE;
+ break;
+
+ }
+ needle_char[1] = '\0';
+ found = php_memnstr(haystack_dup + offset, needle_char,
+sizeof(needle_char) - 1, haystack_dup + haystack_len);
+ }
+
+ efree(haystack_dup);
+ if (needle_dup) {
+ efree(needle_dup);
+ }
+
+ if (found) {
+ RETURN_LONG(found - haystack_dup);
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto int strrpos(string haystack, string needle [, int offset])
Finds position of last occurrence of a character in a string within another */
PHP_FUNCTION(strrpos)
{
- zval **haystack, **needle;
+ zval **haystack, **needle, **offset;
char *found = NULL;
+ int argc = ZEND_NUM_ARGS();
+ int off = 0;
- if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &haystack, &needle) ==
FAILURE) {
+ if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &haystack, &needle,
+&offset) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(haystack);
+ if (argc == 3) {
+ convert_to_long_ex(offset);
+ if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) >
+Z_STRLEN_PP(haystack)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not
+contained in string.");
+ RETURN_FALSE;
+ }
+ off = Z_LVAL_PP(offset);
+ }
+
+ if (Z_TYPE_PP(needle) == IS_STRING) {
+ found = strrchr(Z_STRVAL_PP(haystack) + off, *Z_STRVAL_PP(needle));
+ } else {
+ convert_to_long_ex(needle);
+ found = strrchr(Z_STRVAL_PP(haystack) + off, (char) Z_LVAL_PP(needle));
+ }
+
+ if (found) {
+ RETURN_LONG(Z_STRLEN_PP(haystack) - strlen(found));
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+/* {{{ proto int strripos(string haystack, string needle [, int offset])
+ Finds position of last occurrence of a character in a string within another, case
+insensitive */
+PHP_FUNCTION(strripos)
+{
+ zval **haystack, **needle, **offset;
+ char *found = NULL;
+ int argc = ZEND_NUM_ARGS();
+ int of
[PHP-CVS] cvs: php4 /sapi/apache2filter php_functions.c
moriyoshi Sat Jan 11 17:36:38 2003 EDT Modified files: /php4/sapi/apache2filterphp_functions.c Log: This patch is likely to fix win32 build Index: php4/sapi/apache2filter/php_functions.c diff -u php4/sapi/apache2filter/php_functions.c:1.34 php4/sapi/apache2filter/php_functions.c:1.35 --- php4/sapi/apache2filter/php_functions.c:1.34Tue Dec 31 10:59:03 2002 +++ php4/sapi/apache2filter/php_functions.c Sat Jan 11 17:36:38 2003 @@ -16,13 +16,14 @@ +--+ */ -/* $Id: php_functions.c,v 1.34 2002/12/31 15:59:03 sebastian Exp $ */ +/* $Id: php_functions.c,v 1.35 2003/01/11 22:36:38 moriyoshi Exp $ */ #include "php.h" #include "ext/standard/php_smart_str.h" #include "ext/standard/info.h" #include "SAPI.h" +#define CORE_PRIVATE #include "apr_strings.h" #include "apr_time.h" #include "ap_config.h" -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/standard browscap.c datetime.c pack.c reg.c string.c
moriyoshi Sat Jan 11 17:32:19 2003 EDT
Modified files:
/php4/ext/standard browscap.c datetime.c pack.c reg.c string.c
Log:
Reduced warnings in ZE2 build
Index: php4/ext/standard/browscap.c
diff -u php4/ext/standard/browscap.c:1.65 php4/ext/standard/browscap.c:1.66
--- php4/ext/standard/browscap.c:1.65 Mon Jan 6 16:43:28 2003
+++ php4/ext/standard/browscap.cSat Jan 11 17:32:19 2003
@@ -16,7 +16,7 @@
+--+
*/
-/* $Id: browscap.c,v 1.65 2003/01/06 21:43:28 iliaa Exp $ */
+/* $Id: browscap.c,v 1.66 2003/01/11 22:32:19 moriyoshi Exp $ */
#include "php.h"
#include "php_regex.h"
@@ -49,20 +49,20 @@
register int i, j;
char *t;
- for (i=0; i |
+--+
*/
-/* $Id: pack.c,v 1.43 2002/12/31 16:07:49 sebastian Exp $ */
+/* $Id: pack.c,v 1.44 2003/01/11 22:32:19 moriyoshi Exp $ */
#include "php.h"
@@ -320,7 +320,7 @@
val = argv[currentarg++];
convert_to_string_ex(val);
memcpy(&output[outputpos], Z_STRVAL_PP(val),
- (Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val)
: arg);
+ ((int)Z_STRLEN_PP(val) < arg) ?
+Z_STRLEN_PP(val) : arg);
outputpos += arg;
break;
@@ -334,7 +334,7 @@
convert_to_string_ex(val);
v = Z_STRVAL_PP(val);
outputpos--;
- if(arg > Z_STRLEN_PP(val)) {
+ if(arg > (int)Z_STRLEN_PP(val)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Type %c: not enough characters in string", code);
arg = Z_STRLEN_PP(val);
}
Index: php4/ext/standard/reg.c
diff -u php4/ext/standard/reg.c:1.70 php4/ext/standard/reg.c:1.71
--- php4/ext/standard/reg.c:1.70Thu Jan 9 23:44:21 2003
+++ php4/ext/standard/reg.c Sat Jan 11 17:32:19 2003
@@ -17,7 +17,7 @@
| Jaakko Hyvätti <[EMAIL PROTECTED]> |
+--+
*/
-/* $Id: reg.c,v 1.70 2003/01/10 04:44:21 moriyoshi Exp $ */
+/* $Id: reg.c,v 1.71 2003/01/11 22:32:19 moriyoshi Exp $ */
#include
#include
@@ -605,7 +605,7 @@
tmp = emalloc((Z_STRLEN_PP(string) * 4) + 1);
- for (i = j = 0; i < Z_STRLEN_PP(string); i++) {
+ for (i = j = 0; i < (int)Z_STRLEN_PP(string); i++) {
c = (unsigned char) Z_STRVAL_PP(string)[i];
if(isalpha(c)) {
tmp[j++] = '[';
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.344 php4/ext/standard/string.c:1.345
--- php4/ext/standard/string.c:1.344Sat Jan 11 12:52:38 2003
+++ php4/ext/standard/string.c Sat Jan 11 17:32:19 2003
@@ -18,7 +18,7 @@
+--+
*/
-/* $Id: string.c,v 1.344 2003/01/11 17:52:38 iliaa Exp $ */
+/* $Id: string.c,v 1.345 2003/01/11 22:32:19 moriyoshi Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -1557,7 +1557,7 @@
if (argc == 3) {
convert_to_long_ex(offset);
- if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) >
Z_STRLEN_PP(haystack)) {
+ if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) >
+(int)Z_STRLEN_PP(haystack)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not
contained in string.");
RETURN_FALSE;
}
@@ -1597,7 +1597,7 @@
if (argc == 3) {
convert_to_long_ex(offset);
- if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) >
Z_STRLEN_PP(haystack)) {
+ if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) >
+(int)Z_STRLEN_PP(haystack)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not
contained in string.");
RETURN_FALSE;
}
@@ -1786,11 +1786,11 @@
}
}
- if (f >= Z_STRLEN_PP(str)) {
+ if (f >= (int)Z_STRLEN_PP(str)) {
RETURN_FALSE;
}
- if ((f + l) > Z_STRLEN_PP(str)) {
+ if ((f + l) > (int)Z_STRLEN_PP(str)) {
l = Z_STRLEN_PP(str) - f;
}
@@ -1833,11 +1833,11 @@
* of the string
*/
if (f < 0) {
- f = Z_STRLEN_PP(str) + f;
+ f = (int)Z_STRLEN_PP(str) + f;
if (f < 0) {
f = 0;
}
- } else if (f > Z_STRLEN_PP(str)) {
+
[PHP-CVS] cvs: php4 /ext/standard browscap.c datetime.c file.c formatted_print.c pack.c reg.c string.c
moriyoshi Sat Jan 11 18:05:20 2003 EDT
Modified files:
/php4/ext/standard browscap.c datetime.c file.c formatted_print.c
pack.c reg.c string.c
Log:
Reverted because correct decision has not been made yet.
Index: php4/ext/standard/browscap.c
diff -u php4/ext/standard/browscap.c:1.66 php4/ext/standard/browscap.c:1.67
--- php4/ext/standard/browscap.c:1.66 Sat Jan 11 17:32:19 2003
+++ php4/ext/standard/browscap.cSat Jan 11 18:05:19 2003
@@ -16,7 +16,7 @@
+--+
*/
-/* $Id: browscap.c,v 1.66 2003/01/11 22:32:19 moriyoshi Exp $ */
+/* $Id: browscap.c,v 1.67 2003/01/11 23:05:19 moriyoshi Exp $ */
#include "php.h"
#include "php_regex.h"
@@ -49,20 +49,20 @@
register int i, j;
char *t;
- for (i = 0; i < (int)Z_STRLEN_P(pattern); i++) {
+ for (i=0; i 1 && (int)Z_STRLEN_P(return_value) < len / 2) {
+ if (argc > 1 && Z_STRLEN_P(return_value) < len / 2) {
Z_STRVAL_P(return_value) = erealloc(buf, line_len + 1);
}
}
@@ -1559,7 +1559,7 @@
}
convert_to_string_ex(arg2);
convert_to_long_ex(arg3);
- num_bytes = MIN(Z_LVAL_PP(arg3), (int)Z_STRLEN_PP(arg2));
+ num_bytes = MIN(Z_LVAL_PP(arg3), Z_STRLEN_PP(arg2));
break;
default:
WRONG_PARAM_COUNT;
Index: php4/ext/standard/formatted_print.c
diff -u php4/ext/standard/formatted_print.c:1.62
php4/ext/standard/formatted_print.c:1.63
--- php4/ext/standard/formatted_print.c:1.62Sat Jan 11 17:17:37 2003
+++ php4/ext/standard/formatted_print.c Sat Jan 11 18:05:19 2003
@@ -16,7 +16,7 @@
+--+
*/
-/* $Id: formatted_print.c,v 1.62 2003/01/11 22:17:37 moriyoshi Exp $ */
+/* $Id: formatted_print.c,v 1.63 2003/01/11 23:05:19 moriyoshi Exp $ */
#include /* modf() */
#include "php.h"
@@ -504,7 +504,7 @@
currarg = 1;
- while (inpos < (int)Z_STRLEN_PP(args[format_offset])) {
+ while (inpos |
+--+
*/
-/* $Id: pack.c,v 1.44 2003/01/11 22:32:19 moriyoshi Exp $ */
+/* $Id: pack.c,v 1.45 2003/01/11 23:05:19 moriyoshi Exp $ */
#include "php.h"
@@ -320,7 +320,7 @@
val = argv[currentarg++];
convert_to_string_ex(val);
memcpy(&output[outputpos], Z_STRVAL_PP(val),
- ((int)Z_STRLEN_PP(val) < arg) ?
Z_STRLEN_PP(val) : arg);
+ (Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val)
+: arg);
outputpos += arg;
break;
@@ -334,7 +334,7 @@
convert_to_string_ex(val);
v = Z_STRVAL_PP(val);
outputpos--;
- if(arg > (int)Z_STRLEN_PP(val)) {
+ if(arg > Z_STRLEN_PP(val)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Type %c: not enough characters in string", code);
arg = Z_STRLEN_PP(val);
}
Index: php4/ext/standard/reg.c
diff -u php4/ext/standard/reg.c:1.71 php4/ext/standard/reg.c:1.72
--- php4/ext/standard/reg.c:1.71Sat Jan 11 17:32:19 2003
+++ php4/ext/standard/reg.c Sat Jan 11 18:05:19 2003
@@ -17,7 +17,7 @@
| Jaakko Hyvätti <[EMAIL PROTECTED]> |
+--+
*/
-/* $Id: reg.c,v 1.71 2003/01/11 22:32:19 moriyoshi Exp $ */
+/* $Id: reg.c,v 1.72 2003/01/11 23:05:19 moriyoshi Exp $ */
#include
#include
@@ -605,7 +605,7 @@
tmp = emalloc((Z_STRLEN_PP(string) * 4) + 1);
- for (i = j = 0; i < (int)Z_STRLEN_PP(string); i++) {
+ for (i = j = 0; i < Z_STRLEN_PP(string); i++) {
c = (unsigned char) Z_STRVAL_PP(string)[i];
if(isalpha(c)) {
tmp[j++] = '[';
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.345 php4/ext/standard/string.c:1.346
--- php4/ext/standard/string.c:1.345Sat Jan 11 17:32:19 2003
+++ php4/ext/standard/string.c Sat Jan 11 18:05:19 2003
@@ -18,7 +18,7 @@
+--+
*/
-/* $Id: string.c,v 1.345 2003/01/11 22:32:19 moriyoshi Exp $ */
+/* $Id: string.c,v 1.346 2003/01/11 23:05:19 moriyoshi Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -1557,7 +1557,7 @@
if (argc == 3) {
[PHP-CVS] cvs: php4 /ext/sybase_ct php_sybase_ct.c
iliaa Sat Jan 11 18:06:35 2003 EDT Modified files: /php4/ext/sybase_ct php_sybase_ct.c Log: Fixed handling of NUMERIC type, when it contains numbers that could potentially exceed the interger limit. Index: php4/ext/sybase_ct/php_sybase_ct.c diff -u php4/ext/sybase_ct/php_sybase_ct.c:1.75 php4/ext/sybase_ct/php_sybase_ct.c:1.76 --- php4/ext/sybase_ct/php_sybase_ct.c:1.75 Tue Dec 31 11:07:58 2002 +++ php4/ext/sybase_ct/php_sybase_ct.c Sat Jan 11 18:06:35 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.75 2002/12/31 16:07:58 sebastian Exp $ */ +/* $Id: php_sybase_ct.c,v 1.76 2003/01/11 23:06:35 iliaa Exp $ */ #ifdef HAVE_CONFIG_H @@ -1168,7 +1168,7 @@ case CS_DECIMAL_TYPE: result->datafmt[i].maxlength = result->datafmt[i].precision + 3; /* numeric(10) vs numeric(10, 1) */ - result->numerics[i] = (result->datafmt[i].scale == 0) ? 1 : 2; + result->numerics[i] = (result->datafmt[i].scale == 0 +&& result->datafmt[i].precision <= 10) ? 1 : 2; break; default: result->datafmt[i].maxlength++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/sybase_ct php_sybase_ct.c
iliaa Sat Jan 11 18:07:13 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/sybase_ct php_sybase_ct.c Log: MFH Index: php4/ext/sybase_ct/php_sybase_ct.c diff -u php4/ext/sybase_ct/php_sybase_ct.c:1.73.2.2 php4/ext/sybase_ct/php_sybase_ct.c:1.73.2.3 --- php4/ext/sybase_ct/php_sybase_ct.c:1.73.2.2 Tue Dec 31 11:35:37 2002 +++ php4/ext/sybase_ct/php_sybase_ct.c Sat Jan 11 18:07:13 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.73.2.2 2002/12/31 16:35:37 sebastian Exp $ */ +/* $Id: php_sybase_ct.c,v 1.73.2.3 2003/01/11 23:07:13 iliaa Exp $ */ #ifdef HAVE_CONFIG_H @@ -1168,7 +1168,7 @@ case CS_DECIMAL_TYPE: result->datafmt[i].maxlength = result->datafmt[i].precision + 3; /* numeric(10) vs numeric(10, 1) */ - result->numerics[i] = (result->datafmt[i].scale == 0) ? 1 : 2; + result->numerics[i] = (result->datafmt[i].scale == 0 +&& result->datafmt[i].precision <= 10) ? 1 : 2; break; default: result->datafmt[i].maxlength++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/sybase_ct php_sybase_ct.c
iliaa Sat Jan 11 18:50:37 2003 EDT Modified files: /php4/ext/sybase_ct php_sybase_ct.c Log: Do not 'convert' double columns to integers after the 1st row in the result set. Index: php4/ext/sybase_ct/php_sybase_ct.c diff -u php4/ext/sybase_ct/php_sybase_ct.c:1.76 php4/ext/sybase_ct/php_sybase_ct.c:1.77 --- php4/ext/sybase_ct/php_sybase_ct.c:1.76 Sat Jan 11 18:06:35 2003 +++ php4/ext/sybase_ct/php_sybase_ct.c Sat Jan 11 18:50:37 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.76 2003/01/11 23:06:35 iliaa Exp $ */ +/* $Id: php_sybase_ct.c,v 1.77 2003/01/11 23:50:37 iliaa Exp $ */ #ifdef HAVE_CONFIG_H @@ -1059,7 +1059,7 @@ convert_to_long(&result->data[i][j]); break; case 2: - convert_to_double(&result->data[i][j]); result->numerics[j]= 1; + convert_to_double(&result->data[i][j]); break; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/sybase_ct php_sybase_ct.c
iliaa Sat Jan 11 18:51:00 2003 EDT Modified files: (Branch: PHP_4_3) /php4/ext/sybase_ct php_sybase_ct.c Log: MFH Index: php4/ext/sybase_ct/php_sybase_ct.c diff -u php4/ext/sybase_ct/php_sybase_ct.c:1.73.2.3 php4/ext/sybase_ct/php_sybase_ct.c:1.73.2.4 --- php4/ext/sybase_ct/php_sybase_ct.c:1.73.2.3 Sat Jan 11 18:07:13 2003 +++ php4/ext/sybase_ct/php_sybase_ct.c Sat Jan 11 18:50:59 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: php_sybase_ct.c,v 1.73.2.3 2003/01/11 23:07:13 iliaa Exp $ */ +/* $Id: php_sybase_ct.c,v 1.73.2.4 2003/01/11 23:50:59 iliaa Exp $ */ #ifdef HAVE_CONFIG_H @@ -1059,7 +1059,7 @@ convert_to_long(&result->data[i][j]); break; case 2: - convert_to_double(&result->data[i][j]); result->numerics[j]= 1; + convert_to_double(&result->data[i][j]); break; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/standard browscap.c datetime.c pack.creg.c string.c
On Sat, 11 Jan 2003, Moriyoshi Koizumi wrote:
> moriyoshi Sat Jan 11 17:32:19 2003 EDT
>
> Modified files:
> /php4/ext/standardbrowscap.c datetime.c pack.c reg.c string.c
> Log:
> Reduced warnings in ZE2 build
Isn't there another way for this, as this makes the code quire ugly?
Derick
> Index: php4/ext/standard/browscap.c
> diff -u php4/ext/standard/browscap.c:1.65 php4/ext/standard/browscap.c:1.66
> --- php4/ext/standard/browscap.c:1.65 Mon Jan 6 16:43:28 2003
> +++ php4/ext/standard/browscap.c Sat Jan 11 17:32:19 2003
> @@ -16,7 +16,7 @@
> +--+
> */
>
> -/* $Id: browscap.c,v 1.65 2003/01/06 21:43:28 iliaa Exp $ */
> +/* $Id: browscap.c,v 1.66 2003/01/11 22:32:19 moriyoshi Exp $ */
>
> #include "php.h"
> #include "php_regex.h"
> @@ -49,20 +49,20 @@
> register int i, j;
> char *t;
>
> - for (i=0; i + for (i = 0; i < (int)Z_STRLEN_P(pattern); i++) {
> if (Z_STRVAL_P(pattern)[i]=='*' || Z_STRVAL_P(pattern)[i]=='?' ||
>Z_STRVAL_P(pattern)[i]=='.') {
> break;
> }
> }
>
> - if (i==Z_STRLEN_P(pattern)) { /* no wildcards */
> + if (i == (int)Z_STRLEN_P(pattern)) { /* no wildcards */
> Z_STRVAL_P(pattern) = zend_strndup(Z_STRVAL_P(pattern),
>Z_STRLEN_P(pattern));
> return;
> }
>
> t = (char *) malloc(Z_STRLEN_P(pattern)*2 + 1);
>
> - for (i=0, j=0; i + for (i = 0, j = 0; i < (int)Z_STRLEN_P(pattern); i++, j++) {
> switch (Z_STRVAL_P(pattern)[i]) {
> case '?':
> t[j] = '.';
> Index: php4/ext/standard/datetime.c
> diff -u php4/ext/standard/datetime.c:1.99 php4/ext/standard/datetime.c:1.100
> --- php4/ext/standard/datetime.c:1.99 Tue Dec 31 11:07:35 2002
> +++ php4/ext/standard/datetime.c Sat Jan 11 17:32:19 2003
> @@ -19,7 +19,7 @@
> */
>
>
> -/* $Id: datetime.c,v 1.99 2002/12/31 16:07:35 sebastian Exp $ */
> +/* $Id: datetime.c,v 1.100 2003/01/11 22:32:19 moriyoshi Exp $ */
>
>
> #include "php.h"
> @@ -313,7 +313,7 @@
> php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected error");
> RETURN_FALSE;
> }
> - for (i = 0; i < Z_STRLEN_PP(format); i++) {
> + for (i = 0; i < (int)Z_STRLEN_PP(format); i++) {
> switch (Z_STRVAL_PP(format)[i]) {
> case 'r': /* rfc822 format */
> size += 31;
> @@ -366,7 +366,7 @@
> size += 2;
> break;
> case '\\':
> - if(i < Z_STRLEN_PP(format)-1) {
> + if(i < ((int)Z_STRLEN_PP(format)) - 1) {
> i++;
> }
> size ++;
> @@ -383,10 +383,10 @@
> Z_STRVAL_P(return_value) = (char *) emalloc(size + 1);
> Z_STRVAL_P(return_value)[0] = '\0';
>
> - for (i = 0; i < Z_STRLEN_PP(format); i++) {
> + for (i = 0; i < (int)Z_STRLEN_PP(format); i++) {
> switch (Z_STRVAL_PP(format)[i]) {
> case '\\':
> - if(i < Z_STRLEN_PP(format)-1) {
> + if(i < (int)(Z_STRLEN_PP(format)) - 1) {
> char ch[2];
> ch[0]=Z_STRVAL_PP(format)[i+1];
> ch[1]='\0';
> Index: php4/ext/standard/pack.c
> diff -u php4/ext/standard/pack.c:1.43 php4/ext/standard/pack.c:1.44
> --- php4/ext/standard/pack.c:1.43 Tue Dec 31 11:07:49 2002
> +++ php4/ext/standard/pack.c Sat Jan 11 17:32:19 2003
> @@ -15,7 +15,7 @@
> | Author: Chris Schneider <[EMAIL PROTECTED]> |
> +--+
> */
> -/* $Id: pack.c,v 1.43 2002/12/31 16:07:49 sebastian Exp $ */
> +/* $Id: pack.c,v 1.44 2003/01/11 22:32:19 moriyoshi Exp $ */
>
> #include "php.h"
>
> @@ -320,7 +320,7 @@
> val = argv[currentarg++];
> convert_to_string_ex(val);
> memcpy(&output[outputpos], Z_STRVAL_PP(val),
> -(Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val)
>: arg);
> +((int)Z_STRLEN_PP(val) < arg) ?
>Z_STRLEN_PP(val) : arg);
> outputpos += arg;
> break;
>
> @@ -334,7 +334,7 @@
> convert_to_string_ex(val);
> v = Z_STRVAL_PP(val);
> outputpos--;
> - if(arg > Z_STRLEN_PP(val)) {
> + if(arg > (int)Z
Re: [PHP-CVS] cvs: php4 /ext/standard browscap.c datetime.c pack.c reg.c string.c
> > Modified files: > > /php4/ext/standard browscap.c datetime.c pack.c reg.c string.c > > Log: > > Reduced warnings in ZE2 build > > Isn't there another way for this, as this makes the code quire ugly? These changes had been reverted prior to the discussion about the change of len field in ZE2 zvalue_value, and it seems we have concluded to restore the structure as it was in ZE1. Moriyoshi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4(PHP_4_3) /ext/mssql php_mssql.c
fmk Sat Jan 11 22:17:44 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/mssql php_mssql.c
Log:
MFH
Index: php4/ext/mssql/php_mssql.c
diff -u php4/ext/mssql/php_mssql.c:1.86.2.8 php4/ext/mssql/php_mssql.c:1.86.2.9
--- php4/ext/mssql/php_mssql.c:1.86.2.8 Thu Jan 9 03:28:18 2003
+++ php4/ext/mssql/php_mssql.c Sat Jan 11 22:17:44 2003
@@ -16,7 +16,7 @@
+--+
*/
-/* $Id: php_mssql.c,v 1.86.2.8 2003/01/09 08:28:18 fmk Exp $ */
+/* $Id: php_mssql.c,v 1.86.2.9 2003/01/12 03:17:44 fmk Exp $ */
#ifdef COMPILE_DL_MSSQL
#define HAVE_MSSQL 1
@@ -1187,7 +1187,7 @@
/* Release remaining results */
do {
retvalue = dbresults(result->mssql_ptr->link);
- } while (retvalue != NO_MORE_RESULTS && retvalue != FAIL);
+ } while (retvalue == SUCCEED);
zend_list_delete(Z_RESVAL_PP(mssql_result_index));
RETURN_TRUE;
@@ -2020,11 +2020,12 @@
}
/* }}} */
-/* {{{ proto int mssql_execute(int stmt)
+/* {{{ proto int mssql_execute(int stmt [, bool skip_results = false])
Executes a stored procedure on a MS-SQL server database */
PHP_FUNCTION(mssql_execute)
{
- zval **stmt;
+ zval **stmt, **skip;
+ zend_bool skip_results = 0;
int retvalue,retval_results;
mssql_link *mssql_ptr;
mssql_statement *statement;
@@ -2035,9 +2036,12 @@
int ac = ZEND_NUM_ARGS();
batchsize = MS_SQL_G(batchsize);
- if (ac !=1 || zend_get_parameters_ex(1, &stmt)==FAILURE) {
+ if (ac < 1 || ac > 2 || zend_get_parameters_ex(1, &stmt, &skip)==FAILURE) {
WRONG_PARAM_COUNT;
}
+ if (ac == 2) {
+ skip_results = Z_BVAL_PP(skip);
+ }
ZEND_FETCH_RESOURCE(statement, mssql_statement *, stmt, -1, "MS
SQL-Statement", le_statement);
@@ -2059,7 +2063,7 @@
* set into the row buffer.
*/
result=NULL;
- if (retval_results==SUCCEED) {
+ if (retval_results == SUCCEED) {
if ( (retvalue=(dbnextrow(mssql_ptr->link)))!=NO_MORE_ROWS ) {
num_fields = dbnumcols(mssql_ptr->link);
if (num_fields <= 0) {
@@ -2078,11 +2082,17 @@
result->num_rows = _mssql_fetch_batch(mssql_ptr, result,
retvalue TSRMLS_CC);
result->statement = statement;
}
+ if (skip_results) {
+ do {
+ retval_results = dbresults(mssql_ptr->link);
+ } while (retval_results == SUCCEED);
+
+ _mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
+ }
+ }
+ else if (retval_results == NO_MORE_RESULTS || retval_results ==
+NO_MORE_RPC_RESULTS) {
+ _mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
}
- /* Try to get output parameters. Won't work if there are more record sets
-* in the batch until they are all retrieved with mssql_next_result().
-*/
- _mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
if (result==NULL) {
RETURN_TRUE;/* no recordset returned ...*/
@@ -2113,7 +2123,7 @@
/* Release remaining results */
do {
retvalue = dbresults(statement->link->link);
- } while (retvalue != NO_MORE_RESULTS && retvalue != FAIL);
+ } while (retvalue == SUCCEED);
zend_list_delete(Z_RESVAL_PP(mssql_statement_index));
RETURN_TRUE;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php4 /ext/mssql php_mssql.c
fmk Sun Jan 12 01:28:41 2003 EDT
Modified files:
/php4/ext/mssql php_mssql.c
Log:
Release skiped results. This will free memory on the server.
Make mssql_execute work for stored procedures with and without returning result sets
Index: php4/ext/mssql/php_mssql.c
diff -u php4/ext/mssql/php_mssql.c:1.98 php4/ext/mssql/php_mssql.c:1.99
--- php4/ext/mssql/php_mssql.c:1.98 Fri Jan 10 14:33:31 2003
+++ php4/ext/mssql/php_mssql.c Sun Jan 12 01:28:41 2003
@@ -16,7 +16,7 @@
+--+
*/
-/* $Id: php_mssql.c,v 1.98 2003/01/10 19:33:31 fmk Exp $ */
+/* $Id: php_mssql.c,v 1.99 2003/01/12 06:28:41 fmk Exp $ */
#ifdef COMPILE_DL_MSSQL
#define HAVE_MSSQL 1
@@ -1105,21 +1105,16 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set query");
RETURN_FALSE;
}
- if (dbsqlexec(mssql_ptr->link)==FAIL || dbresults(mssql_ptr->link)==FAIL) {
+ if (dbsqlexec(mssql_ptr->link)==FAIL || (retvalue =
+dbresults(mssql_ptr->link))==FAIL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed");
RETURN_FALSE;
}
- /* The following is more or less the equivalent of mysql_store_result().
-* fetch all rows from the server into the row buffer, thus:
-* 1) Being able to fire up another query without explicitly reading all rows
-* 2) Having numrows accessible
-*/
-#ifdef HAVE_FREETDS
+ // Skip results not returning any columns
+ while ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 && retvalue == SUCCEED) {
+ retvalue = dbresults(mssql_ptr->link);
+ }
if ((num_fields = dbnumcols(mssql_ptr->link)) <= 0) {
-#else
- if ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 &&
!dbdataready(mssql_ptr->link)) {
-#endif
RETURN_TRUE;
}
@@ -1186,6 +1181,7 @@
ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS
SQL-result", le_result);
/* Release remaining results */
do {
+ dbcanquery(result->mssql_ptr->link);
retvalue = dbresults(result->mssql_ptr->link);
} while (retvalue == SUCCEED);
@@ -2026,7 +2022,7 @@
{
zval **stmt, **skip;
zend_bool skip_results = 0;
- int retvalue,retval_results;
+ int retvalue, retval_results;
mssql_link *mssql_ptr;
mssql_statement *statement;
mssql_result *result;
@@ -2036,7 +2032,7 @@
int ac = ZEND_NUM_ARGS();
batchsize = MS_SQL_G(batchsize);
- if (ac < 1 || ac > 2 || zend_get_parameters_ex(1, &stmt, &skip)==FAILURE) {
+ if (ac < 1 || ac > 2 || zend_get_parameters_ex(ac, &stmt, &skip)==FAILURE) {
WRONG_PARAM_COUNT;
}
if (ac == 2) {
@@ -2064,34 +2060,40 @@
*/
result=NULL;
if (retval_results == SUCCEED) {
- if ( (retvalue=(dbnextrow(mssql_ptr->link)))!=NO_MORE_ROWS ) {
- num_fields = dbnumcols(mssql_ptr->link);
- if (num_fields <= 0) {
- RETURN_TRUE;
- }
-
- result = (mssql_result *) emalloc(sizeof(mssql_result));
- result->batchsize = batchsize;
- result->blocks_initialized = 1;
- result->data = (zval **) emalloc(sizeof(zval
*)*MSSQL_ROWS_BLOCK);
- result->mssql_ptr = mssql_ptr;
- result->cur_field=result->cur_row=result->num_rows=0;
- result->num_fields = num_fields;
-
- result->fields = (mssql_field *)
emalloc(sizeof(mssql_field)*num_fields);
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result,
retvalue TSRMLS_CC);
- result->statement = statement;
- }
if (skip_results) {
do {
+ dbcanquery(mssql_ptr->link);
retval_results = dbresults(mssql_ptr->link);
} while (retval_results == SUCCEED);
_mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
}
+ else {
+ // Skip results not returning any columns
+ while ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 &&
+retval_results == SUCCEED) {
+ retval_results = dbresults(mssql_ptr->link);
+ }
+ if ((num_fields = dbnumcols(mssql_ptr->link)) > 0) {
+ retvalue = dbnextrow(mssql_ptr->link);
+ result = (mssql_result *)
+emalloc(sizeof(mssql_result));
+ result->batchsize = batchsize;
[PHP-CVS] cvs: php4(PHP_4_3) /ext/mssql php_mssql.c
fmk Sun Jan 12 01:29:34 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/mssql php_mssql.c
Log:
MFH
Index: php4/ext/mssql/php_mssql.c
diff -u php4/ext/mssql/php_mssql.c:1.86.2.9 php4/ext/mssql/php_mssql.c:1.86.2.10
--- php4/ext/mssql/php_mssql.c:1.86.2.9 Sat Jan 11 22:17:44 2003
+++ php4/ext/mssql/php_mssql.c Sun Jan 12 01:29:33 2003
@@ -16,7 +16,7 @@
+--+
*/
-/* $Id: php_mssql.c,v 1.86.2.9 2003/01/12 03:17:44 fmk Exp $ */
+/* $Id: php_mssql.c,v 1.86.2.10 2003/01/12 06:29:33 fmk Exp $ */
#ifdef COMPILE_DL_MSSQL
#define HAVE_MSSQL 1
@@ -1105,21 +1105,16 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set query");
RETURN_FALSE;
}
- if (dbsqlexec(mssql_ptr->link)==FAIL || dbresults(mssql_ptr->link)==FAIL) {
+ if (dbsqlexec(mssql_ptr->link)==FAIL || (retvalue =
+dbresults(mssql_ptr->link))==FAIL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed");
RETURN_FALSE;
}
- /* The following is more or less the equivalent of mysql_store_result().
-* fetch all rows from the server into the row buffer, thus:
-* 1) Being able to fire up another query without explicitly reading all rows
-* 2) Having numrows accessible
-*/
-#ifdef HAVE_FREETDS
+ // Skip results not returning any columns
+ while ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 && retvalue == SUCCEED) {
+ retvalue = dbresults(mssql_ptr->link);
+ }
if ((num_fields = dbnumcols(mssql_ptr->link)) <= 0) {
-#else
- if ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 &&
!dbdataready(mssql_ptr->link)) {
-#endif
RETURN_TRUE;
}
@@ -1186,6 +1181,7 @@
ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS
SQL-result", le_result);
/* Release remaining results */
do {
+ dbcanquery(result->mssql_ptr->link);
retvalue = dbresults(result->mssql_ptr->link);
} while (retvalue == SUCCEED);
@@ -2026,7 +2022,7 @@
{
zval **stmt, **skip;
zend_bool skip_results = 0;
- int retvalue,retval_results;
+ int retvalue, retval_results;
mssql_link *mssql_ptr;
mssql_statement *statement;
mssql_result *result;
@@ -2036,7 +2032,7 @@
int ac = ZEND_NUM_ARGS();
batchsize = MS_SQL_G(batchsize);
- if (ac < 1 || ac > 2 || zend_get_parameters_ex(1, &stmt, &skip)==FAILURE) {
+ if (ac < 1 || ac > 2 || zend_get_parameters_ex(ac, &stmt, &skip)==FAILURE) {
WRONG_PARAM_COUNT;
}
if (ac == 2) {
@@ -2064,34 +2060,40 @@
*/
result=NULL;
if (retval_results == SUCCEED) {
- if ( (retvalue=(dbnextrow(mssql_ptr->link)))!=NO_MORE_ROWS ) {
- num_fields = dbnumcols(mssql_ptr->link);
- if (num_fields <= 0) {
- RETURN_TRUE;
- }
-
- result = (mssql_result *) emalloc(sizeof(mssql_result));
- result->batchsize = batchsize;
- result->blocks_initialized = 1;
- result->data = (zval **) emalloc(sizeof(zval
*)*MSSQL_ROWS_BLOCK);
- result->mssql_ptr = mssql_ptr;
- result->cur_field=result->cur_row=result->num_rows=0;
- result->num_fields = num_fields;
-
- result->fields = (mssql_field *)
emalloc(sizeof(mssql_field)*num_fields);
- result->num_rows = _mssql_fetch_batch(mssql_ptr, result,
retvalue TSRMLS_CC);
- result->statement = statement;
- }
if (skip_results) {
do {
+ dbcanquery(mssql_ptr->link);
retval_results = dbresults(mssql_ptr->link);
} while (retval_results == SUCCEED);
_mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
}
+ else {
+ // Skip results not returning any columns
+ while ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 &&
+retval_results == SUCCEED) {
+ retval_results = dbresults(mssql_ptr->link);
+ }
+ if ((num_fields = dbnumcols(mssql_ptr->link)) > 0) {
+ retvalue = dbnextrow(mssql_ptr->link);
+ result = (mssql_result *)
+emalloc(sizeof(mssql_result));
+ result->batchsize = batchsize;
+ result->blocks_initialized = 1;
+ result->data
