Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 318 lines (245 sloc) 9.921 kb
c5724cb @zsuraski License update
zsuraski authored
1 /*
2 +----------------------------------------------------------------------+
ccfc46b - Happy new year and PHP 5 for rest of the files too..
foobar authored
3 | PHP Version 5 |
c5724cb @zsuraski License update
zsuraski authored
4 +----------------------------------------------------------------------+
4e19825 @felipensp - Year++
felipensp authored
5 | Copyright (c) 1997-2012 The PHP Group |
c5724cb @zsuraski License update
zsuraski authored
6 +----------------------------------------------------------------------+
5bd9322 bump year and license version
foobar authored
7 | This source file is subject to version 3.01 of the PHP license, |
c5724cb @zsuraski License update
zsuraski authored
8 | that is bundled with this package in the file LICENSE, and is |
f68c7ff updating license information in the headers.
James Cox authored
9 | available through the world-wide-web at the following url: |
5bd9322 bump year and license version
foobar authored
10 | http://www.php.net/license/3_01.txt |
c5724cb @zsuraski License update
zsuraski authored
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
90613d2 Maintain headers.
Sebastian Bergmann authored
15 | Author: Zeev Suraski <zeev@zend.com> |
c5724cb @zsuraski License update
zsuraski authored
16 +----------------------------------------------------------------------+
17 */
18
8e3f23e ws fixes + missing $Id$ tags, headers added
foobar authored
19 /* $Id$ */
c5724cb @zsuraski License update
zsuraski authored
20
16017f6 Change header protection macros to conform to standard.
Sascha Schumann authored
21 #ifndef SAPI_H
22 #define SAPI_H
10710c0 @andigutmans Ah, these too
andigutmans authored
23
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
24 #include "zend.h"
88f1929 - Add needed include as reported by Pierre
Marcus Boerger authored
25 #include "zend_API.h"
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
26 #include "zend_llist.h"
72f6e82 @zsuraski * Add generic POST content-type support. Only application/x-www-form…
zsuraski authored
27 #include "zend_operators.h"
e398e6b @fmk Fix win32 compilation. Missing uid_t and gid_t definitions.
fmk authored
28 #ifdef PHP_WIN32
29 #include "win95nt.h"
30 #endif
41f6bca @zsuraski More cleanup!
zsuraski authored
31 #include <sys/stat.h>
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
32
0b2641e @Added -C command-line option to avoid chdir to the script's director…
Stig Bakken authored
33 #define SAPI_OPTION_NO_CHDIR 1
34
4079f91 @andigutmans * Make read_post() read input by chunks instead of returning a single…
andigutmans authored
35 #define SAPI_POST_BLOCK_SIZE 4000
7942eaf @zsuraski * Plenty of thread safety and Win32 work.
zsuraski authored
36
80bdd19 @zsuraski Fine tune Andi's patch
zsuraski authored
37 #ifdef PHP_WIN32
7942eaf @zsuraski * Plenty of thread safety and Win32 work.
zsuraski authored
38 # ifdef SAPI_EXPORTS
240fa24 Improved PHP binary size and startup speed with GCC4 visibility contr…
Dmitry Stogov authored
39 # define SAPI_API __declspec(dllexport)
7942eaf @zsuraski * Plenty of thread safety and Win32 work.
zsuraski authored
40 # else
240fa24 Improved PHP binary size and startup speed with GCC4 visibility contr…
Dmitry Stogov authored
41 # define SAPI_API __declspec(dllimport)
7942eaf @zsuraski * Plenty of thread safety and Win32 work.
zsuraski authored
42 # endif
240fa24 Improved PHP binary size and startup speed with GCC4 visibility contr…
Dmitry Stogov authored
43 #elif defined(__GNUC__) && __GNUC__ >= 4
44 # define SAPI_API __attribute__ ((visibility("default")))
7942eaf @zsuraski * Plenty of thread safety and Win32 work.
zsuraski authored
45 #else
240fa24 Improved PHP binary size and startup speed with GCC4 visibility contr…
Dmitry Stogov authored
46 # define SAPI_API
7942eaf @zsuraski * Plenty of thread safety and Win32 work.
zsuraski authored
47 #endif
48
b9e54cb - Fixed bug #21169: Compile Failure, and lots of warnings on UnixWare
Derick Rethans authored
49 #undef shutdown
7942eaf @zsuraski * Plenty of thread safety and Win32 work.
zsuraski authored
50
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
51 typedef struct {
52 char *header;
53 uint header_len;
54 } sapi_header_struct;
5dbe924 @andigutmans - Make ISAPI hook in as an extension too.
andigutmans authored
55
56
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
57 typedef struct {
58 zend_llist headers;
59 int http_response_code;
bc415d5 @zsuraski * Finalizing the PHP version of SAPI. Support POST and cookies among…
zsuraski authored
60 unsigned char send_default_content_type;
fbbeaec fixed: output encoding translation by mb_output_handler() in ext/mbst…
Rui Hirokawa authored
61 char *mimetype;
ceeb9b3 @zsuraski * Finally commit that -q patch
zsuraski authored
62 char *http_status_line;
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
63 } sapi_headers_struct;
64
65
a6393de @zsuraski Make POST handling the way it should be. RFC1867, and any future POS…
zsuraski authored
66 typedef struct _sapi_post_entry sapi_post_entry;
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
67 typedef struct _sapi_module_struct sapi_module_struct;
5dbe924 @andigutmans - Make ISAPI hook in as an extension too.
andigutmans authored
68
3d6426e Fix use of EXTERN_C macros
Ard Biesheuvel authored
69 BEGIN_EXTERN_C()
bd0ac7f @zsuraski Many patches. I hope I remember them all:
zsuraski authored
70 extern SAPI_API sapi_module_struct sapi_module; /* true global */
3d6426e Fix use of EXTERN_C macros
Ard Biesheuvel authored
71 END_EXTERN_C()
5dbe924 @andigutmans - Make ISAPI hook in as an extension too.
andigutmans authored
72
dcd971e A field of mines
Sascha Schumann authored
73 /* Some values in this structure needs to be filled in before
3b19572 Add a note about what a missing const specifier does mean in the context
Sascha Schumann authored
74 * calling sapi_activate(). We WILL change the `char *' entries,
75 * so make sure that you allocate a separate buffer for them
76 * and that you free them after sapi_deactivate().
77 */
5dbe924 @andigutmans - Make ISAPI hook in as an extension too.
andigutmans authored
78
79 typedef struct {
43ff395 Const'ify part of sapi_request_info.
Sascha Schumann authored
80 const char *request_method;
5dbe924 @andigutmans - Make ISAPI hook in as an extension too.
andigutmans authored
81 char *query_string;
be5e379 HTTP_RAW_POST_DATA BC fixes
Hartmut Holzgraefe authored
82 char *post_data, *raw_post_data;
50e0d9d @zsuraski cookie_data may also be modified...
zsuraski authored
83 char *cookie_data;
b7ecaac @zsuraski More security-related (control) patches:
zsuraski authored
84 long content_length;
be5e379 HTTP_RAW_POST_DATA BC fixes
Hartmut Holzgraefe authored
85 uint post_data_length, raw_post_data_length;
7071131 @zsuraski Get rid of request_info.path_translated
zsuraski authored
86
87 char *path_translated;
88 char *request_uri;
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
89
43ff395 Const'ify part of sapi_request_info.
Sascha Schumann authored
90 const char *content_type;
bc415d5 @zsuraski * Finalizing the PHP version of SAPI. Support POST and cookies among…
zsuraski authored
91
0f7f5c2 @zsuraski - Import Jade Nicoletti's transparent gzip encoding support as an output
zsuraski authored
92 zend_bool headers_only;
93 zend_bool no_headers;
99c7ddc added support functions for the apache_hooks SAPI
George Schlossnagle authored
94 zend_bool headers_read;
ceeb9b3 @zsuraski * Finally commit that -q patch
zsuraski authored
95
a6393de @zsuraski Make POST handling the way it should be. RFC1867, and any future POS…
zsuraski authored
96 sapi_post_entry *post_entry;
97
98 char *content_type_dup;
99
ceeb9b3 @zsuraski * Finally commit that -q patch
zsuraski authored
100 /* for HTTP authentication */
101 char *auth_user;
102 char *auth_password;
8235a70 added a server variable PHP_AUTH_DIGEST to support HTTP Digest Authen…
Rui Hirokawa authored
103 char *auth_digest;
6723bdd @zsuraski request_info.c is giving up
zsuraski authored
104
105 /* this is necessary for the CGI SAPI module */
106 char *argv0;
49e98c3 @zsuraski request_info.c is dead! long live SAPI
zsuraski authored
107
108 char *current_user;
109 int current_user_length;
1788410 Added argc and argv in request_info needed for the new cli sapi.
Edin Kadribasic authored
110
11750c3 MFH: ws
Jani Taskinen authored
111 /* this is necessary for CLI module */
112 int argc;
113 char **argv;
3c0411c @rlerdorf Fix for bug #32263
rlerdorf authored
114 int proto_num;
5dbe924 @andigutmans - Make ISAPI hook in as an extension too.
andigutmans authored
115 } sapi_request_info;
10710c0 @andigutmans Ah, these too
andigutmans authored
116
117
2cf2589 @zsuraski improve typedef definition
zsuraski authored
118 typedef struct _sapi_globals_struct {
10710c0 @andigutmans Ah, these too
andigutmans authored
119 void *server_context;
5dbe924 @andigutmans - Make ISAPI hook in as an extension too.
andigutmans authored
120 sapi_request_info request_info;
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
121 sapi_headers_struct sapi_headers;
5358637 @zsuraski @- Fix a problem when dealing with large POST blocks in CGI mode
zsuraski authored
122 int read_post_bytes;
2740382 @zsuraski ISAPI WORKS!
zsuraski authored
123 unsigned char headers_sent;
41f6bca @zsuraski More cleanup!
zsuraski authored
124 struct stat global_stat;
d23e5d8 @- Implemented default_charset and default_mimetype config directives…
Stig Bakken authored
125 char *default_mimetype;
126 char *default_charset;
75086e3 @zsuraski - Implemented is_upload_file()
zsuraski authored
127 HashTable *rfc1867_uploaded_files;
b7ecaac @zsuraski More security-related (control) patches:
zsuraski authored
128 long post_max_size;
4668b71 whitespace
Sascha Schumann authored
129 int options;
130 zend_bool sapi_started;
f89effd Updated _SERVER['REQUEST_TIME'] to include microsecond precision.
Ilia Alshanetsky authored
131 double global_request_time;
0d78453 - Fix bug #28568 (known_post_content_types is not thread safe).
Moriyoshi Koizumi authored
132 HashTable known_post_content_types;
ca378ee Add header_register_callback(), allows a userland function
Scott MacVicar authored
133 zval *callback_func;
134 zend_fcall_info_cache fci_cache;
135 zend_bool callback_run;
10710c0 @andigutmans Ah, these too
andigutmans authored
136 } sapi_globals_struct;
137
138
3d6426e Fix use of EXTERN_C macros
Ard Biesheuvel authored
139 BEGIN_EXTERN_C()
10710c0 @andigutmans Ah, these too
andigutmans authored
140 #ifdef ZTS
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
141 # define SG(v) TSRMG(sapi_globals_id, sapi_globals_struct *, v)
7942eaf @zsuraski * Plenty of thread safety and Win32 work.
zsuraski authored
142 SAPI_API extern int sapi_globals_id;
10710c0 @andigutmans Ah, these too
andigutmans authored
143 #else
144 # define SG(v) (sapi_globals.v)
7942eaf @zsuraski * Plenty of thread safety and Win32 work.
zsuraski authored
145 extern SAPI_API sapi_globals_struct sapi_globals;
10710c0 @andigutmans Ah, these too
andigutmans authored
146 #endif
147
54fa0e5 @zsuraski fix
zsuraski authored
148 SAPI_API void sapi_startup(sapi_module_struct *sf);
d9a8628 Fix some warnings
Sascha Schumann authored
149 SAPI_API void sapi_shutdown(void);
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
150 SAPI_API void sapi_activate(TSRMLS_D);
151 SAPI_API void sapi_deactivate(TSRMLS_D);
152 SAPI_API void sapi_initialize_empty_request(TSRMLS_D);
3d6426e Fix use of EXTERN_C macros
Ard Biesheuvel authored
153 END_EXTERN_C()
54fa0e5 @zsuraski fix
zsuraski authored
154
9c876ea Add sapi_header_op interface which supersedes the sapi_add_header and…
Sascha Schumann authored
155 /*
156 * This is the preferred and maintained API for
157 * operating on HTTP headers.
158 */
159
160 /*
161 * Always specify a sapi_header_line this way:
162 *
163 * sapi_header_line ctr = {0};
164 */
165
166 typedef struct {
167 char *line; /* If you allocated this, you need to free it yourself */
168 uint line_len;
169 long response_code; /* long due to zend_parse_parameters compatibility */
170 } sapi_header_line;
171
172 typedef enum { /* Parameter: */
173 SAPI_HEADER_REPLACE, /* sapi_header_line* */
174 SAPI_HEADER_ADD, /* sapi_header_line* */
8c4151a @arnaud-lb Added header_remove() (chsc at peytz dotdk, Arnaud)
arnaud-lb authored
175 SAPI_HEADER_DELETE, /* sapi_header_line* */
176 SAPI_HEADER_DELETE_ALL, /* void */
9c876ea Add sapi_header_op interface which supersedes the sapi_add_header and…
Sascha Schumann authored
177 SAPI_HEADER_SET_STATUS /* int */
178 } sapi_header_op_enum;
179
3d6426e Fix use of EXTERN_C macros
Ard Biesheuvel authored
180 BEGIN_EXTERN_C()
9c876ea Add sapi_header_op interface which supersedes the sapi_add_header and…
Sascha Schumann authored
181 SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC);
182
183 /* Deprecated functions. Use sapi_header_op instead. */
184 SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC);
185 #define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1 TSRMLS_CC)
186
187
bc42c37 @zsuraski More TSRMLS_FETCH work. Got it under 400 now.
zsuraski authored
188 SAPI_API int sapi_send_headers(TSRMLS_D);
e08b2e7 Export sapi_free_header()
Sascha Schumann authored
189 SAPI_API void sapi_free_header(sapi_header_struct *sapi_header);
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
190 SAPI_API void sapi_handle_post(void *arg TSRMLS_DC);
54fa0e5 @zsuraski fix
zsuraski authored
191
0d78453 - Fix bug #28568 (known_post_content_types is not thread safe).
Moriyoshi Koizumi authored
192 SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entry TSRMLS_DC);
193 SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC);
194 SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC);
05383a1 @pierrejoye - drop TSRMLS_FETCH in sapi_register_* (won't bring much at runtime :…
pierrejoye authored
195 SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D) TSRMLS_DC);
196 SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC) TSRMLS_DC);
197 SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC), unsigned int (*input_filter_init)(TSRMLS_D) TSRMLS_DC);
72f6e82 @zsuraski * Add generic POST content-type support. Only application/x-www-form…
zsuraski authored
198
bc42c37 @zsuraski More TSRMLS_FETCH work. Got it under 400 now.
zsuraski authored
199 SAPI_API int sapi_flush(TSRMLS_D);
200 SAPI_API struct stat *sapi_get_stat(TSRMLS_D);
201 SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC);
972631b @zsuraski - Added flush() support to SAPI
zsuraski authored
202
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
203 SAPI_API char *sapi_get_default_content_type(TSRMLS_D);
204 SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header TSRMLS_DC);
205 SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC);
51e4dba Fix ZTS build.
Sebastian Bergmann authored
206 SAPI_API void sapi_activate_headers_only(TSRMLS_D);
d23e5d8 @- Implemented default_charset and default_mimetype config directives…
Stig Bakken authored
207
09f463d Add sapi_get_fd() and implement it for the Apache/thttpd SAPIs.
Sascha Schumann authored
208 SAPI_API int sapi_get_fd(int *fd TSRMLS_DC);
2b95b3c add a "force HTTP/1.0 response" facility to the SAPI layer
Sascha Schumann authored
209 SAPI_API int sapi_force_http_10(TSRMLS_D);
09f463d Add sapi_get_fd() and implement it for the Apache/thttpd SAPIs.
Sascha Schumann authored
210
294e776 add sapi_get_target_uid/_gid for obtaining information about the
Sascha Schumann authored
211 SAPI_API int sapi_get_target_uid(uid_t * TSRMLS_DC);
212 SAPI_API int sapi_get_target_gid(gid_t * TSRMLS_DC);
f89effd Updated _SERVER['REQUEST_TIME'] to include microsecond precision.
Ilia Alshanetsky authored
213 SAPI_API double sapi_get_request_time(TSRMLS_D);
6c15837 @rlerdorf exit_on_timeout patch
rlerdorf authored
214 SAPI_API void sapi_terminate_process(TSRMLS_D);
3d6426e Fix use of EXTERN_C macros
Ard Biesheuvel authored
215 END_EXTERN_C()
294e776 add sapi_get_target_uid/_gid for obtaining information about the
Sascha Schumann authored
216
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
217 struct _sapi_module_struct {
218 char *name;
4010b42 Separate plain name returned by php_sapi_module() and pretty name
Andrei Zmievski authored
219 char *pretty_name;
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
220
221 int (*startup)(struct _sapi_module_struct *sapi_module);
222 int (*shutdown)(struct _sapi_module_struct *sapi_module);
223
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
224 int (*activate)(TSRMLS_D);
225 int (*deactivate)(TSRMLS_D);
073b148 @zsuraski More abstraction
zsuraski authored
226
8aef193 more tsrm cleanup
Sascha Schumann authored
227 int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC);
972631b @zsuraski - Added flush() support to SAPI
zsuraski authored
228 void (*flush)(void *server_context);
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
229 struct stat *(*get_stat)(TSRMLS_D);
230 char *(*getenv)(char *name, size_t name_len TSRMLS_DC);
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
231
ade1117 @zsuraski * Get output buffering to work again
zsuraski authored
232 void (*sapi_error)(int type, const char *error_msg, ...);
233
8c4151a @arnaud-lb Added header_remove() (chsc at peytz dotdk, Arnaud)
arnaud-lb authored
234 int (*header_handler)(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC);
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
235 int (*send_headers)(sapi_headers_struct *sapi_headers TSRMLS_DC);
d76cf1d @zsuraski More TSRMLS_FETCH work
zsuraski authored
236 void (*send_header)(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC);
bc415d5 @zsuraski * Finalizing the PHP version of SAPI. Support POST and cookies among…
zsuraski authored
237
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
238 int (*read_post)(char *buffer, uint count_bytes TSRMLS_DC);
239 char *(*read_cookies)(TSRMLS_D);
98d95dd @zsuraski - Added support for unknown POST content types (Zeev)
zsuraski authored
240
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
241 void (*register_server_variables)(zval *track_vars_array TSRMLS_DC);
34b631f @KalleZ Pass the TSRMS pointers to sapi_module_struct.log_message, this saves…
KalleZ authored
242 void (*log_message)(char *message TSRMLS_DC);
27dd44d @rlerdorf Fix a couple of warnings. Use %zu to printf a time_t and get_request_…
rlerdorf authored
243 double (*get_request_time)(TSRMLS_D);
6c15837 @rlerdorf exit_on_timeout patch
rlerdorf authored
244 void (*terminate_process)(TSRMLS_D);
9ab35ae @zsuraski Tried to centralize global variable registration as much as possible:
zsuraski authored
245
bd0ac7f @zsuraski Many patches. I hope I remember them all:
zsuraski authored
246 char *php_ini_path_override;
247
5bdd18c @zsuraski Yes, you guessed it... More cleanup
zsuraski authored
248 void (*block_interruptions)(void);
249 void (*unblock_interruptions)(void);
4668b71 whitespace
Sascha Schumann authored
250
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
251 void (*default_post_reader)(TSRMLS_D);
7527bf0 made sapi_register_treat_data() to support multibyte input encoding t…
Rui Hirokawa authored
252 void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC);
5af649e @zsuraski Revert to the old php_ini.c, and reimplement the binary-path searching.
zsuraski authored
253 char *executable_location;
cecb9df Implemented -n switch to skip parsing ini at startup as suggested by …
Marcus Boerger authored
254
255 int php_ini_ignore;
e1b87cc - Fixed #52045 (FPM tries to open php.ini from the current dir)
Jérôme Loyet authored
256 int php_ini_ignore_cwd; /* don't look for php.ini in the current directory */
4668b71 whitespace
Sascha Schumann authored
257
09f463d Add sapi_get_fd() and implement it for the Apache/thttpd SAPIs.
Sascha Schumann authored
258 int (*get_fd)(int *fd TSRMLS_DC);
4668b71 whitespace
Sascha Schumann authored
259
2b95b3c add a "force HTTP/1.0 response" facility to the SAPI layer
Sascha Schumann authored
260 int (*force_http_10)(TSRMLS_D);
294e776 add sapi_get_target_uid/_gid for obtaining information about the
Sascha Schumann authored
261
262 int (*get_target_uid)(uid_t * TSRMLS_DC);
263 int (*get_target_gid)(gid_t * TSRMLS_DC);
7429c2d @rlerdorf Input Filter support. See README.input_filter for details.
rlerdorf authored
264
750b033 - Fix sapi_input_filter patch. Returning 1 from the filter handler sh…
Derick Rethans authored
265 unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC);
63739c7 give sapi modules the possibility to overwrite default ini settings
Marcus Boerger authored
266
267 void (*ini_defaults)(HashTable *configuration_hash);
3e621fa make phpinfo() depend on executed sapi
Marcus Boerger authored
268 int phpinfo_as_text;
7d14dad MFH: Fixed mess with CGI/CLI -d command line option (now it works wit…
Dmitry Stogov authored
269
270 char *ini_entries;
f77719d MFH
Marcus Boerger authored
271 const zend_function_entry *additional_functions;
94b7a00 @smalyshev fix for #47930
smalyshev authored
272 unsigned int (*input_filter_init)(TSRMLS_D);
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
273 };
274
275
a6393de @zsuraski Make POST handling the way it should be. RFC1867, and any future POS…
zsuraski authored
276 struct _sapi_post_entry {
277 char *content_type;
278 uint content_type_len;
d87cc97 @zsuraski Redesigned thread safety mechanism - nua nua
zsuraski authored
279 void (*post_reader)(TSRMLS_D);
280 void (*post_handler)(char *content_type_dup, void *arg TSRMLS_DC);
a6393de @zsuraski Make POST handling the way it should be. RFC1867, and any future POS…
zsuraski authored
281 };
282
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
283 /* header_handler() constants */
284 #define SAPI_HEADER_ADD (1<<0)
285
286
287 #define SAPI_HEADER_SENT_SUCCESSFULLY 1
288 #define SAPI_HEADER_DO_SEND 2
289 #define SAPI_HEADER_SEND_FAILED 3
290
ba03c9f started implementing directives for default mimetype/charset
Stig Bakken authored
291 #define SAPI_DEFAULT_MIMETYPE "text/html"
c32e09f @rlerdorf As it turns out, there are some browsers that can't handle default
rlerdorf authored
292 #define SAPI_DEFAULT_CHARSET ""
331221e @andigutmans - X-* is probably more standard.
andigutmans authored
293 #define SAPI_PHP_VERSION_HEADER "X-Powered-By: PHP/" PHP_VERSION
537cc54 @andigutmans Added initial headers support in SAPI
andigutmans authored
294
0dab84d fix SAPI_POST_* exports
Daniel Beulshausen authored
295 #define SAPI_POST_READER_FUNC(post_reader) void post_reader(TSRMLS_D)
296 #define SAPI_POST_HANDLER_FUNC(post_handler) void post_handler(char *content_type_dup, void *arg TSRMLS_DC)
72f6e82 @zsuraski * Add generic POST content-type support. Only application/x-www-form…
zsuraski authored
297
7527bf0 made sapi_register_treat_data() to support multibyte input encoding t…
Rui Hirokawa authored
298 #define SAPI_TREAT_DATA_FUNC(treat_data) void treat_data(int arg, char *str, zval* destArray TSRMLS_DC)
630e169 - Fixed standard wrapper for input filter.
Derick Rethans authored
299 #define SAPI_INPUT_FILTER_FUNC(input_filter) unsigned int input_filter(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC)
7527bf0 made sapi_register_treat_data() to support multibyte input encoding t…
Rui Hirokawa authored
300
3d6426e Fix use of EXTERN_C macros
Ard Biesheuvel authored
301 BEGIN_EXTERN_C()
0dab84d fix SAPI_POST_* exports
Daniel Beulshausen authored
302 SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data);
303 SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader);
7527bf0 made sapi_register_treat_data() to support multibyte input encoding t…
Rui Hirokawa authored
304 SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data);
7429c2d @rlerdorf Input Filter support. See README.input_filter for details.
rlerdorf authored
305 SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter);
3d6426e Fix use of EXTERN_C macros
Ard Biesheuvel authored
306 END_EXTERN_C()
96bfbc7 @zsuraski First attempt at moving the old RFC1867 support to the right place
zsuraski authored
307
6f4333c scrap STANDARD_SAPI_MODULE_PROPERTIES; it is causing more harm than good
Sascha Schumann authored
308 #define STANDARD_SAPI_MODULE_PROPERTIES
98d95dd @zsuraski - Added support for unknown POST content types (Zeev)
zsuraski authored
309
16017f6 Change header protection macros to conform to standard.
Sascha Schumann authored
310 #endif /* SAPI_H */
ba03c9f started implementing directives for default mimetype/charset
Stig Bakken authored
311
312 /*
313 * Local variables:
314 * tab-width: 4
315 * c-basic-offset: 4
316 * End:
317 */
Something went wrong with that request. Please try again.