php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52555
Patch http_response_code revision 2010-08-08 22:49 UTC by dragoonis@php.net
revision 2010-08-07 13:53 UTC by dragoonis@php.net
Patch httpd_response_code revision 2010-08-08 22:48 UTC by dragoonis@php.net

Patch http_response_code for *Web Server problem Bug #52555

Patch version 2010-08-08 22:49 UTC

Return to Bug #52555 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: dragoonis@php.net

Index: basic_functions.c
===================================================================
--- basic_functions.c	(revision 301970)
+++ basic_functions.c	(working copy)
@@ -1470,6 +1470,10 @@
 
 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 +2987,7 @@
 	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)
Index: head.c
===================================================================
--- head.c	(revision 301970)
+++ head.c	(working copy)
@@ -281,6 +281,17 @@
 }
 /* }}} */
 
+/* {{{ proto long http_response_code()
+   Returns the current 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
Index: head.h
===================================================================
--- head.h	(revision 301970)
+++ head.h	(working copy)
@@ -28,6 +28,7 @@
 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);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 12 00:01:29 2024 UTC