sas Wed Feb 28 06:03:58 2001 EDT
Modified files:
/php4/sapi/apache2filter README apache_config.c config.m4
php_apache.h sapi_apache2.c
Log:
Make the module compile again with the latest httpd-2.0 cvs.
Index: php4/sapi/apache2filter/README
diff -u php4/sapi/apache2filter/README:1.6 php4/sapi/apache2filter/README:1.7
--- php4/sapi/apache2filter/README:1.6 Mon Dec 11 00:05:53 2000
+++ php4/sapi/apache2filter/README Wed Feb 28 06:03:58 2001
@@ -36,8 +36,8 @@
At the end of conf/httpd.conf, add:
<Files *.php>
- AddOutputFilter PHP
- AddInputFilter PHP
+ SetOutputFilter PHP
+ SetInputFilter PHP
</Files>
That's it. Now start bin/httpd.
Index: php4/sapi/apache2filter/apache_config.c
diff -u php4/sapi/apache2filter/apache_config.c:1.9
php4/sapi/apache2filter/apache_config.c:1.10
--- php4/sapi/apache2filter/apache_config.c:1.9 Sun Feb 25 22:07:35 2001
+++ php4/sapi/apache2filter/apache_config.c Wed Feb 28 06:03:58 2001
@@ -62,12 +62,12 @@
str_len = strlen(name);
- if (zend_hash_find(&d->config, name, str_len + 1, (void **) &pe) == SUCCESS) {
+ if (zend_hash_find(&d->config, (char *) name, str_len + 1, (void **) &pe) ==
+SUCCESS) {
if (pe->status > status)
return NULL;
}
- zend_hash_update(&d->config, name, strlen(name) + 1, &e, sizeof(e),
+ zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, sizeof(e),
NULL);
return NULL;
}
Index: php4/sapi/apache2filter/config.m4
diff -u php4/sapi/apache2filter/config.m4:1.1 php4/sapi/apache2filter/config.m4:1.2
--- php4/sapi/apache2filter/config.m4:1.1 Thu Oct 26 10:55:05 2000
+++ php4/sapi/apache2filter/config.m4 Wed Feb 28 06:03:58 2001
@@ -28,7 +28,6 @@
APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
APXS_CFLAGS=`$APXS -q CFLAGS`
AC_ADD_INCLUDE($APXS_INCLUDEDIR)
- AC_ADD_INCLUDE($APXS_INCLUDEDIR/apr)
if `echo $APXS_CFLAGS|grep USE_HSREGEX>/dev/null`; then
APACHE_HAS_REGEX=yes
fi
Index: php4/sapi/apache2filter/php_apache.h
diff -u php4/sapi/apache2filter/php_apache.h:1.7
php4/sapi/apache2filter/php_apache.h:1.8
--- php4/sapi/apache2filter/php_apache.h:1.7 Sun Feb 25 22:07:35 2001
+++ php4/sapi/apache2filter/php_apache.h Wed Feb 28 06:03:58 2001
@@ -21,7 +21,7 @@
typedef struct php_struct {
int state;
- ap_bucket_brigade *bb;
+ apr_bucket_brigade *bb;
ap_filter_t *f;
/* Length of post_data buffer */
int post_len;
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.25
php4/sapi/apache2filter/sapi_apache2.c:1.26
--- php4/sapi/apache2filter/sapi_apache2.c:1.25 Sun Feb 25 22:07:35 2001
+++ php4/sapi/apache2filter/sapi_apache2.c Wed Feb 28 06:03:58 2001
@@ -46,8 +46,8 @@
static int
php_apache_sapi_ub_write(const char *str, uint str_length)
{
- ap_bucket *b;
- ap_bucket_brigade *bb;
+ apr_bucket *b;
+ apr_bucket_brigade *bb;
php_struct *ctx;
uint now;
SLS_FETCH();
@@ -56,10 +56,10 @@
if (!str_length) return 0;
- bb = ap_brigade_create(ctx->f->r->pool);
+ bb = apr_brigade_create(ctx->f->r->pool);
while (str_length > 0) {
now = MIN(str_length, 4096);
- b = ap_bucket_create_transient(str, now);
+ b = apr_bucket_transient_create(str, now);
AP_BRIGADE_INSERT_TAIL(bb, b);
str += now;
str_length -= now;
@@ -161,16 +161,16 @@
php_apache_sapi_flush(void *server_context)
{
php_struct *ctx = server_context;
- ap_bucket_brigade *bb;
- ap_bucket *b;
+ apr_bucket_brigade *bb;
+ apr_bucket *b;
/* Send a flush bucket down the filter chain. The current default
* handler seems to act on the first flush bucket, but ignores
* all further flush buckets.
*/
- bb = ap_brigade_create(ctx->f->r->pool);
- b = ap_bucket_create_flush();
+ bb = apr_brigade_create(ctx->f->r->pool);
+ b = apr_bucket_flush_create();
AP_BRIGADE_INSERT_TAIL(bb, b);
if (ap_pass_brigade(ctx->f->next, bb) != APR_SUCCESS) {
php_handle_aborted_connection();
@@ -221,21 +221,21 @@
};
-module MODULE_VAR_EXPORT php4_module;
+AP_MODULE_DECLARE_DATA module php4_module;
#define INIT_CTX \
if (ctx == NULL) { \
/* Initialize filter context */ \
SG(server_context) = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx)); \
- ctx->bb = ap_brigade_create(f->c->pool); \
+ ctx->bb = apr_brigade_create(f->c->pool); \
}
-static int php_input_filter(ap_filter_t *f, ap_bucket_brigade *bb,
+static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
ap_input_mode_t mode)
{
php_struct *ctx;
long old_index;
- ap_bucket *b;
+ apr_bucket *b;
const char *str;
apr_ssize_t n;
apr_status_t rv;
@@ -249,8 +249,8 @@
return rv;
}
- AP_BRIGADE_FOREACH(b, bb) {
- ap_bucket_read(b, &str, &n, 1);
+ APR_BRIGADE_FOREACH(b, bb) {
+ apr_bucket_read(b, &str, &n, 1);
if (n > 0) {
old_index = ctx->post_len;
ctx->post_len += n;
@@ -304,10 +304,10 @@
safe_free(SG(request_info).request_uri);
}
-static int php_output_filter(ap_filter_t *f, ap_bucket_brigade *bb)
+static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
{
php_struct *ctx;
- ap_bucket *b;
+ apr_bucket *b;
apr_status_t rv;
const char *str;
apr_ssize_t n;
@@ -339,11 +339,11 @@
/* If we have received all data from the previous filters,
* we "flatten" the buckets by creating a single string buffer.
*/
- if (ctx->state == 1 && AP_BUCKET_IS_EOS(AP_BRIGADE_LAST(ctx->bb))) {
+ if (ctx->state == 1 && apr_bucket_IS_EOS(AP_BRIGADE_LAST(ctx->bb))) {
int fd;
zend_file_handle zfd;
smart_str content = {0};
- ap_bucket *eos;
+ apr_bucket *eos;
CLS_FETCH();
ELS_FETCH();
PLS_FETCH();
@@ -360,8 +360,8 @@
goto ok;
/* Loop over all buckets and put them into the buffer */
- AP_BRIGADE_FOREACH(b, ctx->bb) {
- rv = ap_bucket_read(b, &str, &n, 1);
+ APR_BRIGADE_FOREACH(b, ctx->bb) {
+ rv = apr_bucket_read(b, &str, &n, 1);
if (rv == APR_SUCCESS && n > 0)
smart_str_appendl(&content, str, n);
}
@@ -400,14 +400,14 @@
goto ok;
skip_execution:
#define NO_DATA "php_filter did not get ANY data"
- eos = ap_bucket_create_transient(NO_DATA, sizeof(NO_DATA)-1);
+ eos = apr_bucket_transient_create(NO_DATA, sizeof(NO_DATA)-1);
AP_BRIGADE_INSERT_HEAD(bb, eos);
ok:
php_apache_request_dtor(f SLS_CC);
SG(server_context) = 0;
/* Pass EOS bucket to next filter to signal end of request */
- eos = ap_bucket_create_eos();
+ eos = apr_bucket_eos_create();
AP_BRIGADE_INSERT_TAIL(bb, eos);
return ap_pass_brigade(f->next, bb);
@@ -436,14 +436,14 @@
php_apache_register_module();
}
-static void php_register_hook(void)
+static void php_register_hook(apr_pool_t *p)
{
- ap_hook_child_init(php_apache_server_startup, NULL, NULL, AP_HOOK_MIDDLE);
+ ap_hook_child_init(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE);
ap_register_output_filter("PHP", php_output_filter, AP_FTYPE_CONTENT);
ap_register_input_filter("PHP", php_input_filter, AP_FTYPE_CONTENT);
}
-module MODULE_VAR_EXPORT php4_module = {
+AP_MODULE_DECLARE_DATA module php4_module = {
STANDARD20_MODULE_STUFF,
create_php_config, /* create per-directory config structure */
merge_php_config, /* merge per-directory config structures */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]