]> granicus.if.org Git - php/commitdiff
Added headers_sent() function
authorAndrey Hristov <andrey@php.net>
Tue, 20 Jul 1999 18:03:27 +0000 (18:03 +0000)
committerAndrey Hristov <andrey@php.net>
Tue, 20 Jul 1999 18:03:27 +0000 (18:03 +0000)
ext/standard/basic_functions.c
ext/standard/head.c
ext/standard/head.h

index 4ff386f0cdeb90d1d781272471e05b402cf405bf..2a955860439e64673429e23cc38b00040201a6d0 100644 (file)
@@ -284,6 +284,7 @@ function_entry basic_functions[] = {
        PHP_FE(print_r,                                 NULL)
        {"setcookie",           php3_SetCookie,         NULL},
        {"header",                      php3_Header,            NULL},
+       PHP_FE(headers_sent,                            NULL)
        PHP_FE(function_exists,                         NULL)
        PHP_FE(in_array,                                        NULL)
        PHP_FE(extract,                                         NULL)
index f1bd0dcdc8ccc988ce62b706d144b7ad53b1fc93..cfc6930f7db3e8d2287bd5a4e88b501dc5b55f14 100644 (file)
@@ -24,6 +24,7 @@
 #include "main.h"
 #include "head.h"
 #include "post.h"
+#include "SAPI.h"
 #ifdef TM_IN_SYS_TIME
 #include <sys/time.h>
 #else
@@ -556,6 +557,16 @@ int php3_headers_unsent(void)
        }
 }
 
+PHP_FUNCTION(headers_sent)
+{
+       SLS_FETCH();
+       
+       if (SG(headers_sent)) {
+               RETURN_TRUE;
+       } else {
+               RETURN_FALSE;
+       }
+}
 
 function_entry php3_header_functions[] = {
        {NULL, NULL, NULL}
index 977fc83345ef2b728f91d2ba7c1cd8e96d161516..a8096ecaca23cd234b29ad4519a450e80ac7f017 100644 (file)
@@ -55,6 +55,7 @@ extern php3_module_entry php3_header_module_entry;
 extern int php3_init_head(INIT_FUNC_ARGS);
 PHP_FUNCTION(Header);
 PHP_FUNCTION(SetCookie);
+PHP_FUNCTION(headers_sent);
 
 void php4i_add_header_information(char *header_information, uint header_length);