Changeset 113
- Timestamp:
- 01/18/07 20:52:52 (2 years ago)
- Files:
-
- trunk/src/main/php/net/stubbles/ipo/response/stubBaseResponse.php (modified) (3 diffs)
- trunk/src/main/php/net/stubbles/ipo/response/stubCookie.php (added)
- trunk/src/main/php/net/stubbles/ipo/response/stubResponse.php (modified) (2 diffs)
- trunk/src/test/php/net/stubbles/ipo/IPOTestSuite.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/ipo/response (added)
- trunk/src/test/php/net/stubbles/ipo/response/stubCookieTestCase.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/ipo/response/stubBaseResponse.php
r97 r113 23 23 * list of cookies for this response 24 24 * 25 * @var array<string,st ring>25 * @var array<string,stubCookie> 26 26 */ 27 27 protected $cookie = array(); … … 57 57 * add a cookie to the response 58 58 * 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 61 60 */ 62 public function setCookie( $name, $value)61 public function setCookie(stubCookie $cookie) 63 62 { 64 $this->cookie[$ name] = $value;63 $this->cookie[$cookie->getName()] = $cookie; 65 64 } 66 65 … … 86 85 87 86 // 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()); 90 89 } 91 90 trunk/src/main/php/net/stubbles/ipo/response/stubResponse.php
r81 r113 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 */ 7 stubClassLoader::load('net.stubbles.ipo.response.stubCookie'); 7 8 /** 8 9 * interface for a response to a request … … 29 30 * add a cookie to the response 30 31 * 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 33 33 */ 34 public function setCookie( $name, $value);34 public function setCookie(stubCookie $cookie); 35 35 36 36 /** trunk/src/test/php/net/stubbles/ipo/IPOTestSuite.php
r79 r113 32 32 $this->addTestFile($dir . '/request/filters/stubStringFilterTestCase.php'); 33 33 $this->addTestFile($dir . '/request/filters/stubTextFilterTestCase.php'); 34 35 $this->addTestFile($dir . '/response/stubCookieTestCase.php'); 34 36 } 35 37 }
