diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:38:07 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:38:07 -0400 |
| commit | bb01389fbd53ec1cbcb80d0681a37cca1267891a (patch) | |
| tree | 4783178fca65a5d9071c8df34f2ddc3d31728673 /sapi/apache2filter | |
| parent | eddbbea4325e602ddc87c545531609132d4f0e3b (diff) | |
| download | php-bb01389fbd53ec1cbcb80d0681a37cca1267891a.tar.gz | |
Imported Upstream version 5.2.4upstream/5.2.4
Diffstat (limited to 'sapi/apache2filter')
| -rw-r--r-- | sapi/apache2filter/apache_config.c | 61 | ||||
| -rw-r--r-- | sapi/apache2filter/config.m4 | 20 |
2 files changed, 34 insertions, 47 deletions
diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c index fe43075e8..968ad8bf8 100644 --- a/sapi/apache2filter/apache_config.c +++ b/sapi/apache2filter/apache_config.c @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: apache_config.c,v 1.34.2.1.2.2 2007/01/01 09:36:12 sebastian Exp $ */ +/* $Id: apache_config.c,v 1.34.2.1.2.3 2007/08/03 09:33:30 jani Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -35,7 +35,7 @@ #include "http_log.h" #include "http_main.h" #include "util_script.h" -#include "http_core.h" +#include "http_core.h" #ifdef PHP_AP_DEBUG #define phpapdebug(a) fprintf a @@ -51,16 +51,15 @@ typedef struct { char *value; size_t value_len; char status; + char htaccess; } php_dir_entry; -static const char *real_value_hnd(cmd_parms *cmd, void *dummy, - const char *name, const char *value, int status) +static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, const char *value, int status) { php_conf_rec *d = dummy; php_dir_entry e; - phpapdebug((stderr, "Getting %s=%s for %p (%d)\n", name, value, dummy, - zend_hash_num_elements(&d->config))); + phpapdebug((stderr, "Getting %s=%s for %p (%d)\n", name, value, dummy, zend_hash_num_elements(&d->config))); if (!strncasecmp(value, "none", sizeof("none"))) { value = ""; @@ -69,26 +68,23 @@ static const char *real_value_hnd(cmd_parms *cmd, void *dummy, e.value = apr_pstrdup(cmd->pool, value); e.value_len = strlen(value); e.status = status; - - zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, - sizeof(e), NULL); + e.htaccess = ((cmd->override & (RSRC_CONF|ACCESS_CONF)) == 0); + + zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, sizeof(e), NULL); return NULL; } -static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, - const char *name, const char *value) +static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_value_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); } -static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, - const char *name, const char *value) +static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_value_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); } -static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, - const char *arg2, int status) +static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, const char *arg2, int status) { char bool_val[2]; @@ -102,24 +98,20 @@ static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, return real_value_hnd(cmd, dummy, arg1, bool_val, status); } -static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, - const char *name, const char *value) +static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_flag_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); } -static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, - const char *name, const char *value) +static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_flag_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); } -static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, - const char *arg) +static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg) { if (apache2_php_ini_path_override) { - return "Only first PHPINIDir directive honored per configuration tree " - "- subsequent ones ignored"; + return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; } apache2_php_ini_path_override = ap_server_root_relative(cmd->pool, arg); return NULL; @@ -180,8 +172,7 @@ void apply_config(void *dummy) zend_hash_move_forward(&d->config)) { zend_hash_get_current_data(&d->config, (void **) &data); phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value)); - if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, - data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) { + if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) { phpapdebug((stderr, "..FAILED\n")); } } @@ -189,17 +180,12 @@ void apply_config(void *dummy) const command_rec php_dir_cmds[] = { - AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS, - "PHP Value Modifier"), - AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, - "PHP Flag Modifier"), - AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, - ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"), - AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, - ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"), - AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, - "Directory containing the php.ini file"), - {NULL} + AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS, "PHP Value Modifier"), + AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, "PHP Flag Modifier"), + AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"), + AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"), + AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, "Directory containing the php.ini file"), + {NULL} }; static apr_status_t destroy_php_config(void *data) @@ -214,8 +200,7 @@ static apr_status_t destroy_php_config(void *data) void *create_php_config(apr_pool_t *p, char *dummy) { - php_conf_rec *newx = - (php_conf_rec *) apr_pcalloc(p, sizeof(*newx)); + php_conf_rec *newx = (php_conf_rec *) apr_pcalloc(p, sizeof(*newx)); phpapdebug((stderr, "Creating new config (%p) for %s\n", newx, dummy)); zend_hash_init(&newx->config, 0, NULL, NULL, 1); diff --git a/sapi/apache2filter/config.m4 b/sapi/apache2filter/config.m4 index c5a0a323d..f9677334a 100644 --- a/sapi/apache2filter/config.m4 +++ b/sapi/apache2filter/config.m4 @@ -1,20 +1,23 @@ dnl -dnl $Id: config.m4,v 1.41.2.1 2005/09/01 14:33:47 sniper Exp $ +dnl $Id: config.m4,v 1.41.2.1.2.2 2007/07/11 23:20:36 jani Exp $ dnl -AC_MSG_CHECKING(for Apache 2.0 filter-module support via DSO through APXS) -AC_ARG_WITH(apxs2filter, +PHP_ARG_WITH(apxs2filter,, [ --with-apxs2filter[=FILE] EXPERIMENTAL: Build shared Apache 2.0 Filter module. FILE is the optional - pathname to the Apache apxs tool [apxs]],[ - if test "$withval" = "yes"; then + pathname to the Apache apxs tool [apxs]], no, no) + +AC_MSG_CHECKING([for Apache 2.0 filter-module support via DSO through APXS]) + +if test "$PHP_APXS2FILTER" != "no"; then + if test "$PHP_APXS2FILTER" = "yes"; then APXS=apxs $APXS -q CFLAGS >/dev/null 2>&1 if test "$?" != "0" && test -x /usr/sbin/apxs; then APXS=/usr/sbin/apxs fi else - PHP_EXPAND_PATH($withval, APXS) + PHP_EXPAND_PATH($PHP_APXS2FILTER, APXS) fi $APXS -q CFLAGS >/dev/null 2>&1 @@ -119,11 +122,10 @@ AC_ARG_WITH(apxs2filter, PHP_BUILD_THREAD_SAFE fi AC_MSG_RESULT(yes) - PHP_SUBST(APXS) -],[ +else AC_MSG_RESULT(no) -]) +fi dnl ## Local Variables: dnl ## tab-width: 4 |
