Skip to content

Commit

Permalink
Added cookie field in Request object
Browse files Browse the repository at this point in the history
  • Loading branch information
marekweb committed Jun 12, 2011
1 parent 630293a commit 3a376ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion init.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

ini_set('display_errors', 1);
error_reporting(E_ALL | E_NOTICE | E_STRICT);
ini_set('html_errors', true);
ini_set('html_errors', 0);

/**
* Handler that converts errors into exceptions.
Expand Down
4 changes: 2 additions & 2 deletions lib/oak/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Dispatcher {
public function __construct($router, $invoker) {
$this->router = $router;
$this->invoker = $invoker;
}
}

public function dispatch($requestPath, $requestMethod = 'GET', $requestParams = array()) {

Expand All @@ -24,7 +24,7 @@ public function dispatch($requestPath, $requestMethod = 'GET', $requestParams =

$params = array_merge($pathParams, $requestParams);

$request = new Request($requestMethod, $params, $requestPath, $this);
$request = new Request($requestMethod, $params, $requestPath, $this, $_COOKIE);

// Invocation of the controller: this is where the application handles the request.
$response = $this->invoker->invoke($callback, $request);
Expand Down
4 changes: 3 additions & 1 deletion lib/oak/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ class Request {
public $params;
public $path;
public $dispatcher;
public $cookie;

public function __construct($requestMethod, $params, $path, $dispatcher) {
public function __construct($requestMethod, $params, $path, $dispatcher, $cookie) {
$this->method = $requestMethod;
$this->params = $params;
$this->path = $path;
$this->dispatcher = $dispatcher;
$this->cookie = $cookie;
}

}

0 comments on commit 3a376ab

Please sign in to comment.