Back to index

php5  5.3.10
php_apache.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Sascha Schumann <sascha@schumann.cx>                         |
00016    +----------------------------------------------------------------------+
00017  */
00018 
00019 /* $Id: php_apache.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_APACHE_H
00022 #define PHP_APACHE_H
00023 
00024 #include "httpd.h"
00025 #include "http_config.h"
00026 #include "http_core.h"
00027 
00028 /* Declare this so we can get to it from outside the sapi_apache2.c file */
00029 extern module AP_MODULE_DECLARE_DATA php5_module;
00030 
00031 /* A way to specify the location of the php.ini dir in an apache directive */
00032 extern char *apache2_php_ini_path_override;
00033 
00034 /* The server_context used by PHP */
00035 typedef struct php_struct {
00036        int state;
00037        request_rec *r;
00038        ap_filter_t *f; /* downstream output filters after the PHP filter. */
00039        /* Length of post_data buffer */
00040        int post_len;
00041        /* Index for reading from buffer */
00042        int post_idx;
00043        /* stat structure of the current file */  
00044        struct stat finfo;
00045        /* Buffer for request body filter */
00046        char *post_data;
00047        /* Whether or not we've processed PHP in the output filters yet. */
00048        int request_processed;
00049 } php_struct;
00050 
00051 typedef struct _php_apr_bucket_brigade {
00052        apr_bucket_brigade *bb;
00053 } php_apr_bucket_brigade;
00054 
00055 void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf);
00056 void *create_php_config(apr_pool_t *p, char *dummy);
00057 char *get_php_config(void *conf, char *name, size_t name_len);
00058 void apply_config(void *);
00059 extern const command_rec php_dir_cmds[];
00060 
00061 static size_t php_apache_read_stream(void *, char *, size_t TSRMLS_DC);
00062 static size_t php_apache_fsizer_stream(void * TSRMLS_DC);
00063 
00064 #define APR_ARRAY_FOREACH_OPEN(arr, key, val)           \
00065 {                                                                                          \
00066        apr_table_entry_t *elts;                                       \
00067        int i;                                                                       \
00068        elts = (apr_table_entry_t *) arr->elts;                 \
00069        for (i = 0; i < arr->nelts; i++) {                      \
00070               key = elts[i].key;                                             \
00071               val = elts[i].val;
00072 
00073 #define APR_ARRAY_FOREACH_CLOSE() }}
00074 
00075 /* fix for gcc4 visibility patch */
00076 #ifndef PHP_WIN32
00077 # undef AP_MODULE_DECLARE_DATA
00078 # define AP_MODULE_DECLARE_DATA PHPAPI
00079 #endif
00080 
00081 #endif /* PHP_APACHE_H */