Changeset 113

Show
Ignore:
Timestamp:
01/18/07 20:52:52 (2 years ago)
Author:
mikey
Message:

added net.stubbles.ipo.response.stubCookie

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/ipo/response/stubBaseResponse.php

    r97 r113  
    2323     * list of cookies for this response 
    2424     * 
    25      * @var  array<string,string
     25     * @var  array<string,stubCookie
    2626     */ 
    2727    protected $cookie = array(); 
     
    5757     * add a cookie to the response 
    5858     * 
    59      * @param  string  $name   the name of the cookie 
    60      * @param  string  $value  the value of the cookie 
     59     * @param  stubCookie  $cookie  the cookie to set 
    6160     */ 
    62     public function setCookie($name, $value) 
     61    public function setCookie(stubCookie $cookie) 
    6362    { 
    64         $this->cookie[$name] = $value; 
     63        $this->cookie[$cookie->getName()] = $cookie; 
    6564    } 
    6665     
     
    8685         
    8786        // send the cookies 
    88         foreach ($this->cookie as $name => $value) { 
    89             setcookie($name, $value); 
     87        foreach ($this->cookie as $cookie) { 
     88            setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiration(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly()); 
    9089        } 
    9190         
  • trunk/src/main/php/net/stubbles/ipo/response/stubResponse.php

    r81 r113  
    55 * @author  Frank Kleine <mikey@stubbles.net> 
    66 */ 
     7stubClassLoader::load('net.stubbles.ipo.response.stubCookie'); 
    78/** 
    89 * interface for a response to a request 
     
    2930     * add a cookie to the response 
    3031     * 
    31      * @param  string  $name   the name of the cookie 
    32      * @param  string  $value  the value of the cookie 
     32     * @param  stubCookie  $cookie  the cookie to set 
    3333     */ 
    34     public function setCookie($name, $value); 
     34    public function setCookie(stubCookie $cookie); 
    3535     
    3636    /** 
  • trunk/src/test/php/net/stubbles/ipo/IPOTestSuite.php

    r79 r113  
    3232        $this->addTestFile($dir . '/request/filters/stubStringFilterTestCase.php'); 
    3333        $this->addTestFile($dir . '/request/filters/stubTextFilterTestCase.php'); 
     34         
     35        $this->addTestFile($dir . '/response/stubCookieTestCase.php'); 
    3436    } 
    3537}