]> granicus.if.org Git - php/commitdiff
implement separate .htaccess stage
authorStanislav Malyshev <stas@php.net>
Fri, 3 Aug 2007 01:14:44 +0000 (01:14 +0000)
committerStanislav Malyshev <stas@php.net>
Fri, 3 Aug 2007 01:14:44 +0000 (01:14 +0000)
sapi/apache/mod_php5.c
sapi/apache2handler/apache_config.c

index 439ef168e7831fd9d0b46601b2867b3b124710b8..d41d9dfcd67435b4de82cc17b85cc1bfa12d4782 100644 (file)
@@ -80,6 +80,7 @@ typedef struct _php_per_dir_entry {
        uint key_length;
        uint value_length;
        int type;
+    char htaccess;
 } php_per_dir_entry;
 
 /* some systems are missing these from their header files */
@@ -547,7 +548,7 @@ static void init_request_info(TSRMLS_D)
  */
 static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC)
 {
-       zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE);
+       zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE);
        return 0;
 }
 /* }}} */
@@ -791,6 +792,7 @@ static CONST_PREFIX char *php_apache_value_handler_ex(cmd_parms *cmd, HashTable
                php_apache_startup(&apache_sapi_module);
        }
        per_dir_entry.type = mode;
+       per_dir_entry.htaccess = ((cmd->override & (RSRC_CONF|ACCESS_CONF)) == 0);
 
        if (strcasecmp(arg2, "none") == 0) {
                arg2 = "";
index 1c6b9ab0f650ae09a2099ade7a4d546f14441231..14d00a322be56ddd3434d44f4adfce9ca93c08c0 100644 (file)
@@ -51,6 +51,7 @@ 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)
@@ -67,7 +68,8 @@ static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name,
        e.value = apr_pstrdup(cmd->pool, value);
        e.value_len = strlen(value);
        e.status = status;
-       
+       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;
 }
@@ -170,7 +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"));
                }       
        }