Browse Source

Implemented FR #52555 (Ability to get HTTP response code)

- Patch by Paul Dragoonis
experimental/with_scalar_types
Kalle Sommer Nielsen 16 years ago
parent
commit
4281addcb7
  1. 3
      NEWS
  2. 4
      ext/standard/basic_functions.c
  3. 12
      ext/standard/head.c
  4. 1
      ext/standard/head.h

3
NEWS

@ -1,4 +1,4 @@
PHP NEWS
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 201?, PHP 5.3.99
- Upgraded bundled sqlite to version 3.6.23.1. (Ilia)
@ -89,6 +89,7 @@ PHP NEWS
- Removed support for linking against MySQL client libraries older 4.1 from
PDO_mysql. (Johannes)
- Implemented FR #52555 (Ability to get HTTP response code). (Paul Dragoonis)
- Implemented FR #51295 (SQLite3::busyTimeout not existing). (Mark)
- Implemented FR #48632 (OpenSSL AES support). (yonas dot y
at gmail dot com, Pierre)

4
ext/standard/basic_functions.c

@ -1470,6 +1470,9 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_headers_list, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_http_response_code, 0)
ZEND_END_ARG_INFO()
/* }}} */
/* {{{ html.c */
ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars, 0, 0, 1)
@ -2983,6 +2986,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FE(header_remove, arginfo_header_remove)
PHP_FE(headers_sent, arginfo_headers_sent)
PHP_FE(headers_list, arginfo_headers_list)
PHP_FE(http_response_code, arginfo_http_response_code)
PHP_FE(connection_aborted, arginfo_connection_aborted)
PHP_FE(connection_status, arginfo_connection_status)

12
ext/standard/head.c

@ -281,6 +281,18 @@ PHP_FUNCTION(headers_list)
}
/* }}} */
/* {{{ proto long http_response_code()
Returns the current HTTP response code */
PHP_FUNCTION(http_response_code)
{
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_LONG(SG(sapi_headers).http_response_code);
}
/* }}} */
/*
* Local variables:
* tab-width: 4

1
ext/standard/head.h

@ -28,6 +28,7 @@ PHP_FUNCTION(setcookie);
PHP_FUNCTION(setrawcookie);
PHP_FUNCTION(headers_sent);
PHP_FUNCTION(headers_list);
PHP_FUNCTION(http_response_code);
PHPAPI int php_header(TSRMLS_D);
PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC);

Loading…
Cancel
Save