File tree 6 files changed +29
-2
lines changed
6 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 4
4
/build.properties
5
5
.DS_Store
6
6
.README.md.html
7
+ /README.md~
7
8
/.cproject
8
9
/.buildpath
9
10
/.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
46
46
#####appserver_set_raw_post_data(string $postData)
47
47
To 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.
48
48
49
+ #####appserver_get_http_response_code()
50
+ Gets the http response code if is set in sapi_headers hash table.
51
+
49
52
# Debug on Mac OS X
50
53
51
54
Additionally it provides various functionality for usage within the
Original file line number Diff line number Diff line change 10
10
# ---- General Settings ---------------------------------------------------------
11
11
php.ext.name = appserver
12
12
13
- release.version = 0.1.7
13
+ release.version = 0.1.8
14
14
release.stability = beta
15
- api.version = 0.1.7
15
+ api.version = 0.1.8
16
16
api.stability = beta
17
17
18
18
php.version = 5.5.10
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ const zend_function_entry appserver_functions[] = {
55
55
PHP_FE (appserver_set_headers_sent , NULL )
56
56
PHP_FE (appserver_redefine , NULL )
57
57
PHP_FE (appserver_set_raw_post_data , NULL )
58
+ PHP_FE (appserver_get_http_response_code , NULL )
58
59
PHP_FE_END
59
60
};
60
61
@@ -261,6 +262,16 @@ PHP_MINFO_FUNCTION(appserver)
261
262
DISPLAY_INI_ENTRIES ();
262
263
}
263
264
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
+
264
275
/* {{{ proto boolean appserver_set_raw_post_data(string $postData)
265
276
sets the raw post data to be available in php://input stream */
266
277
PHP_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);
72
72
PHP_FUNCTION (appserver_set_headers_sent );
73
73
PHP_FUNCTION (appserver_redefine );
74
74
PHP_FUNCTION (appserver_set_raw_post_data );
75
+ PHP_FUNCTION (appserver_get_http_response_code );
75
76
76
77
ZEND_BEGIN_MODULE_GLOBALS (appserver )
77
78
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