PHP Classes
elePHPant
Icontem

add exit parameter on sendHeaders

Recommend this page to a friend!

      Header  >  All threads  >  add exit parameter on sendHeaders  >  (Un) Subscribe thread alerts  
Subject:add exit parameter on sendHeaders
Summary:add exit parameter on sendHeaders
Messages:1
Author:Juan Antonio
Date:2010-02-11 09:52:33
 

  1. add exit parameter on sendHeaders   Reply   Report abuse  
Juan Antonio - 2010-02-11 09:52:34
Hello, i have added one optional 'exit' parameter to sendHeaders method to exit from php after send headers.

public function sendHeaders($exit=null)
{
if($exit===null) $exit=false;
$return=false;
if(headers_sent()) $this->sent=true;

if(!$this->sent)
{
foreach($this->buffer as $part)
if(strlen($part[1]) > 0)
header($part[0] . ': ' . $part[1]);
else
header($part[0]);
$this->sendCookies();
$return=true;
}

if($exit) exit();

return $return;
}