示例#1
0
 /**
  * Import response metadata (SOAP headers) from another response.
  *
  * @param      AgaviResponse The other response to import information from.
  *
  * @author     David Zülke <*****@*****.**>
  * @since      0.11.0
  */
 public function merge(AgaviResponse $otherResponse)
 {
     parent::merge($otherResponse);
     if ($otherResponse instanceof AgaviSoapResponse) {
         foreach ($otherResponse->getSoapHeaders() as $soapHeader) {
             if (!$this->hasSoapHeader($soapHeader->namespace, $soapHeader->name)) {
                 $this->addSoapHeader($soapHeader);
             }
         }
     }
 }
 /**
  * Import response metadata (nothing in this case) from another response.
  *
  * @param      AgaviResponse The other response to import information from.
  *
  * @author     David Zülke <*****@*****.**>
  * @since      0.11.0
  */
 public function merge(AgaviResponse $otherResponse)
 {
     parent::merge($otherResponse);
 }
示例#3
0
 /**
  * Import response metadata (headers, cookies) from another response.
  *
  * @param      AgaviResponse The other response to import information from.
  *
  * @author     David Zülke <*****@*****.**>
  * @since      0.11.0
  */
 public function merge(AgaviResponse $otherResponse)
 {
     parent::merge($otherResponse);
     if ($otherResponse instanceof AgaviWebResponse) {
         foreach ($otherResponse->getHttpHeaders() as $name => $value) {
             if (!$this->hasHttpHeader($name)) {
                 $this->setHttpHeader($name, $value);
             }
         }
         foreach ($otherResponse->getCookies() as $name => $cookie) {
             if (!$this->hasCookie($name)) {
                 $this->setCookie($name, $cookie['value'], $cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httponly'], $cookie['encode_callback']);
             }
         }
         if ($otherResponse->hasRedirect() && !$this->hasRedirect()) {
             $redirect = $otherResponse->getRedirect();
             $this->setRedirect($redirect['location'], $redirect['code']);
         }
     }
 }