|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ?? 1999, Version 4.0 Beta 3
+- Added support for unknown POST content types (Zeev)
- Added "wddx" serialization handler for session module (Sascha)
(automatically enabled, if you compile with --with-wddx)
- Fixed deserializing objects (Thies)
variables.
- Clean up apxs build
- Add INSTALL.REDHAT file to walk RedHat users through the install
-- Added optional second argument to mysql_fetch_array(); MYSQL_ASSOC will
- cause the resulting array to contain the associative indices only,
- MYSQL_NUM will cause the array to contain the numeric indices only (like
- mysql_fetch_row()) and MYSQL_BOTH would cause them both to be defined
- (default).
-- Backport the Zend debugging memory manager into the PHP 3.0.x tree.
- Add function_exists() function.
- Add another version of WDDX module
(we need to pick a single implementation here)
- Fix bug in pdf_close() function
- Add WDDX support (see http://www.wddx.org for more info)
- Add similar_text() function
-- Constructors of parent classes weren't accessible to derived classes (as
- of 3.0.6). Fixed.
- Introduce simple regex compilation cache
sapi_cgi_send_header, /* send header handler */
sapi_cgi_read_post, /* read POST data */
- sapi_cgi_read_cookies /* read Cookies */
+ sapi_cgi_read_cookies, /* read Cookies */
+
+ STANDARD_SAPI_MODULE_PROPERTIES
};
Get string length */
PHP_FUNCTION(strlen)
{
- pval *str;
+ pval **str;
- if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &str) == FAILURE) {
+ if (ARG_COUNT(ht) != 1 || getParametersEx(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_string(str);
- RETVAL_LONG(str->value.str.len);
+ convert_to_string_ex(str);
+ RETVAL_LONG((*str)->value.str.len);
}
/* }}} */
static sapi_post_content_type_reader supported_post_content_types[] = {
{ DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data },
- { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, rfc1867_post_reader },
{ NULL, 0, NULL }
};
SAPI_API void sapi_startup(sapi_module_struct *sf)
{
- sapi_post_content_type_reader *post_content_type_reader=supported_post_content_types;
-
sapi_module = *sf;
zend_hash_init(&known_post_content_types, 5, NULL, NULL, 1);
- while (post_content_type_reader->content_type) {
- sapi_register_post_reader(post_content_type_reader);
- post_content_type_reader++;
- }
+
+ sapi_register_post_reader(supported_post_content_types);
+
#ifdef ZTS
sapi_globals_id = ts_allocate_id(sizeof(sapi_globals_struct), NULL, NULL);
#endif
char *content_type = estrndup(SG(request_info).content_type, content_type_length);
char *p;
char oldchar=0;
+ void (*post_reader_func)(char *content_type_dup SLS_DC);
+
/* dedicated implementation for increased performance:
* - Make the content type lowercase
}
}
- if (zend_hash_find(&known_post_content_types, content_type, content_type_length+1, (void **) &post_content_type_reader)==FAILURE) {
- sapi_module.sapi_error(E_COMPILE_ERROR, "Unsupported content type: '%s'", content_type);
- return;
+ if (zend_hash_find(&known_post_content_types, content_type, content_type_length+1, (void **) &post_content_type_reader)==SUCCESS) {
+ post_reader_func = post_content_type_reader->post_reader;
+ } else {
+ if (!sapi_module.default_post_reader) {
+ sapi_module.sapi_error(E_COMPILE_ERROR, "Unsupported content type: '%s'", content_type);
+ return;
+ }
+ post_reader_func = sapi_module.default_post_reader;
}
if (oldchar) {
*(p-1) = oldchar;
}
- post_content_type_reader->post_reader(content_type SLS_CC);
+ post_reader_func(content_type SLS_CC);
efree(content_type);
}
}
}
SG(request_info).post_data[total_read_bytes] = 0; /* terminating NULL */
+ SG(request_info).post_data_length = total_read_bytes;
}
}
+SAPI_API int sapi_register_post_readers(sapi_post_content_type_reader *post_content_type_readers)
+{
+ sapi_post_content_type_reader *p=post_content_type_readers;
+
+ while (p->content_type) {
+ if (sapi_register_post_reader(p)==FAILURE) {
+ return FAILURE;
+ }
+ p++;
+ }
+ return SUCCESS;
+}
+
+
SAPI_API int sapi_register_post_reader(sapi_post_content_type_reader *post_content_type_reader)
{
return zend_hash_add(&known_post_content_types, post_content_type_reader->content_type, post_content_type_reader->content_type_len+1, (void *) post_content_type_reader, sizeof(sapi_post_content_type_reader), NULL);
{
zend_hash_del(&known_post_content_types, post_content_type_reader->content_type, post_content_type_reader->content_type_len+1);
}
+
+
+SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(char *content_type_dup SLS_DC))
+{
+ sapi_module.default_post_reader = default_post_reader;
+ return SUCCESS;
+}
+
char *post_data;
char *cookie_data;
uint content_length;
+ uint post_data_length;
char *path_translated;
char *request_uri;
SAPI_API int sapi_add_header(char *header_line, uint header_line_len);
SAPI_API int sapi_send_headers();
+SAPI_API int sapi_register_post_readers(sapi_post_content_type_reader *post_content_type_readers);
SAPI_API int sapi_register_post_reader(sapi_post_content_type_reader *post_content_type_reader);
SAPI_API void sapi_unregister_post_reader(sapi_post_content_type_reader *post_content_type_reader);
+SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(char *content_type_dup SLS_DC));
struct _sapi_module_struct {
char *name;
int (*read_post)(char *buffer, uint count_bytes SLS_DC);
char *(*read_cookies)(SLS_D);
+
+ void (*default_post_reader)(char *content_type_dup SLS_DC);
};
SAPI_POST_READER_FUNC(sapi_read_standard_form_data);
+#define STANDARD_SAPI_MODULE_PROPERTIES NULL
+
#endif /* _NEW_SAPI_H */
#define HAVE_BINDLIB 1
/* set to enable bcmath */
-#define WITH_BCMATH 0
+#define WITH_BCMATH 1
+
+/* set to enable bundled PCRE library */
+#define HAVE_BUNDLED_PCRE 1
+
/* should be added to runtime config*/
#define PHP3_URL_FOPEN 1
#include "zend_highlight.h"
#include "zend_indent.h"
+#include "php_content_types.h"
+
#if USE_SAPI
#include "serverapi/sapi.h"
void *gLock;
zuv.short_tags = (unsigned char) PG(short_tags);
zuv.asp_tags = (unsigned char) PG(asp_tags);
zend_set_utility_values(&zuv);
+ php_startup_SAPI_content_types();
if (module_startup_modules() == FAILURE) {
php_printf("Unable to start modules\n");
static sapi_post_content_type_reader php_post_content_types[] = {
{ MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, rfc1867_post_reader },
{ NULL, 0, NULL }
+};
+
+
+SAPI_POST_READER_FUNC(php_default_post_reader)
+{
+ ELS_FETCH();
+
+ sapi_read_standard_form_data(content_type_dup SLS_CC);
+ SET_VAR_STRINGL("HTTP_RAW_POST_DATA", SG(request_info).post_data, SG(request_info).post_data_length);
}
+
int php_startup_SAPI_content_types()
{
sapi_register_post_readers(php_post_content_types);
+ sapi_register_default_post_reader(php_default_post_reader);
return SUCCESS;
}
sapi_read_standard_form_data(content_type_dup SLS_CC);
if (SG(request_info).post_data) {
- php_mime_split(SG(request_info).post_data, SG(request_info).content_length, boundary);
+ php_mime_split(SG(request_info).post_data, SG(request_info).post_data_length, boundary);
efree(SG(request_info).post_data);
SG(request_info).post_data = NULL;
}
NULL, /* send header handler */
sapi_apache_read_post, /* read POST data */
- sapi_apache_read_cookies /* read Cookies */
+ sapi_apache_read_cookies, /* read Cookies */
+
+ STANDARD_SAPI_MODULE_PROPERTIES
};
# Begin Source File\r
\r
SOURCE=.\ext\pcre\php_pcre.c\r
+\r
+!IF "$(CFG)" == "php4dll - Win32 Debug"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dll - Win32 Release"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\pcrelib\chartables.c\r
+\r
+!IF "$(CFG)" == "php4dll - Win32 Debug"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dll - Win32 Release"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\pcrelib\get.c\r
+\r
+!IF "$(CFG)" == "php4dll - Win32 Debug"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dll - Win32 Release"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\pcrelib\maketables.c\r
+\r
+!IF "$(CFG)" == "php4dll - Win32 Debug"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dll - Win32 Release"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\pcrelib\pcre.c\r
+\r
+!IF "$(CFG)" == "php4dll - Win32 Debug"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dll - Win32 Release"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\pcrelib\study.c\r
+\r
+!IF "$(CFG)" == "php4dll - Win32 Debug"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dll - Win32 Release"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# End Group\r
# Begin Group "Header Files No. 3"\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\php_pcre.c\r
+\r
+!IF "$(CFG)" == "php4dllts - Win32 Debug_TS"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
SOURCE=.\ext\standard\url.h\r
# End Source File\r
# End Group\r
-# Begin Group "Regular Expressions"\r
+# Begin Group "PCRE"\r
\r
# PROP Default_Filter ""\r
-# Begin Source File\r
+# Begin Group "Source Files No. 3"\r
\r
-SOURCE=.\regex\regcomp.c\r
-# End Source File\r
+# PROP Default_Filter ".c"\r
# Begin Source File\r
\r
-SOURCE=.\regex\regerror.c\r
-# End Source File\r
-# Begin Source File\r
+SOURCE=.\ext\pcre\pcrelib\chartables.c\r
\r
-SOURCE=.\regex\regexec.c\r
-# End Source File\r
-# Begin Source File\r
+!IF "$(CFG)" == "php4dllts - Win32 Debug_TS"\r
\r
-SOURCE=.\regex\regfree.c\r
-# End Source File\r
-# End Group\r
-# Begin Group "PCRE"\r
+# ADD CPP /D "STATIC"\r
\r
-# PROP Default_Filter ""\r
-# Begin Group "Source Files No. 3"\r
+!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS"\r
\r
-# PROP Default_Filter ".c"\r
-# Begin Source File\r
+!ENDIF \r
\r
-SOURCE=.\ext\pcre\pcrelib\chartables.c\r
# End Source File\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\pcrelib\get.c\r
+\r
+!IF "$(CFG)" == "php4dllts - Win32 Debug_TS"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\pcrelib\maketables.c\r
+\r
+!IF "$(CFG)" == "php4dllts - Win32 Debug_TS"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\pcrelib\pcre.c\r
+\r
+!IF "$(CFG)" == "php4dllts - Win32 Debug_TS"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# Begin Source File\r
\r
SOURCE=.\ext\pcre\pcrelib\study.c\r
+\r
+!IF "$(CFG)" == "php4dllts - Win32 Debug_TS"\r
+\r
+# ADD CPP /D "STATIC"\r
+\r
+!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS"\r
+\r
+!ENDIF \r
+\r
# End Source File\r
# End Group\r
# Begin Group "Header Files No. 3"\r
# End Source File\r
# End Group\r
# End Group\r
+# Begin Group "Regular Expressions"\r
+\r
+# PROP Default_Filter ""\r
+# Begin Source File\r
+\r
+SOURCE=.\regex\regcomp.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\regex\regerror.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\regex\regexec.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\regex\regfree.c\r
+# End Source File\r
+# End Group\r
# End Group\r
# Begin Group "Win32"\r
\r