Development

Changeset 8225

You must first sign up to be able to contribute.

Changeset 8225

Show
Ignore:
Timestamp:
04/03/08 12:34:07 (5 months ago)
Author:
fabien
Message:

added sfBrowser::setHttpHeader()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/util/sfBrowser.class.php

    r7614 r8225  
    3131    $vars               = array(), 
    3232    $defaultServerArray = array(), 
     33    $headers            = array(), 
    3334    $currentException   = null; 
    3435 
     
    8990  { 
    9091    $this->vars[$name] = $value; 
     92 
     93    return $this; 
     94  } 
     95 
     96  /** 
     97   * Sets a HTTP header for the very next request. 
     98   * 
     99   * @param string The header name 
     100   * @param string The header value 
     101   */ 
     102  public function setHttpHeader($header, $value) 
     103  { 
     104    $this->headers[$header] = $value; 
    91105 
    92106    return $this; 
     
    188202    } 
    189203 
     204    foreach ($this->headers as $header => $value) 
     205    { 
     206      $_SERVER['HTTP_'.strtoupper(str_replace('-', '_', $header))] = $value; 
     207    } 
     208    $this->headers = array(); 
     209 
    190210    // request parameters 
    191211    $_GET = $_POST = array();