File tree Expand file tree Collapse file tree 6 files changed +29
-2
lines changed
Expand file tree Collapse file tree 6 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 44/build.properties
55.DS_Store
66.README.md.html
7+ /README.md~
78/.cproject
89/.buildpath
910/.project
Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ If you want to reset the flag that headers already sent while runtime you can ea
4646#####appserver_set_raw_post_data(string $postData)
4747To have the raw post data available in php://input you can simple use this function. I'll be available in $HTTP_RAW_POST_DATA too.
4848
49+ #####appserver_get_http_response_code()
50+ Gets the http response code if is set in sapi_headers hash table.
51+
4952# Debug on Mac OS X
5053
5154Additionally it provides various functionality for usage within the
Original file line number Diff line number Diff line change 1010# ---- General Settings ---------------------------------------------------------
1111php.ext.name = appserver
1212
13- release.version = 0.1.7
13+ release.version = 0.1.8
1414release.stability = beta
15- api.version = 0.1.7
15+ api.version = 0.1.8
1616api.stability = beta
1717
1818php.version = 5.5.10
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ const zend_function_entry appserver_functions[] = {
5555 PHP_FE (appserver_set_headers_sent , NULL )
5656 PHP_FE (appserver_redefine , NULL )
5757 PHP_FE (appserver_set_raw_post_data , NULL )
58+ PHP_FE (appserver_get_http_response_code , NULL )
5859 PHP_FE_END
5960};
6061
@@ -261,6 +262,16 @@ PHP_MINFO_FUNCTION(appserver)
261262 DISPLAY_INI_ENTRIES ();
262263}
263264
265+ /* {{{ proto boolean appserver_get_http_response_code()
266+ gets the http response code if is set in sapi_headers hash table */
267+ PHP_FUNCTION (appserver_get_http_response_code )
268+ {
269+ if (SG (sapi_headers ).http_response_code ) {
270+ RETURN_LONG (SG (sapi_headers ).http_response_code );
271+ }
272+ RETURN_NULL ();
273+ }
274+
264275/* {{{ proto boolean appserver_set_raw_post_data(string $postData)
265276 sets the raw post data to be available in php://input stream */
266277PHP_FUNCTION (appserver_set_raw_post_data )
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ PHP_FUNCTION(appserver_register_file_upload);
7272PHP_FUNCTION (appserver_set_headers_sent );
7373PHP_FUNCTION (appserver_redefine );
7474PHP_FUNCTION (appserver_set_raw_post_data );
75+ PHP_FUNCTION (appserver_get_http_response_code );
7576
7677ZEND_BEGIN_MODULE_GLOBALS (appserver )
7778 appserver_llist * headers ;
Original file line number Diff line number Diff line change 1+ --TEST--
2+ appserver: call appserver_get_http_response_code and check if correct code returns.
3+ --CREDITS--
4+ Johann Zelger <jz [at] techdivision [dot] com>
5+ --FILE--
6+ <?php
7+ header ('Location: www.appserver.io ' );
8+ var_dump (appserver_get_http_response_code ());
9+ ?>
10+ --EXPECT--
11+ int(302)
You can’t perform that action at this time.
0 commit comments