Skip to content

Commit

Permalink
Application: $allowedMethods is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 6, 2012
1 parent fd97fd4 commit 8ac02f6
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions Nette/Application/Application.php
Expand Up @@ -51,8 +51,8 @@ class Application extends Nette\Object
/** @var array of function(Application $sender, \Exception $e); Occurs when an unhandled exception occurs in the application */
public $onError;

/** @var array of string */
public $allowedMethods = array('GET', 'POST', 'HEAD', 'PUT', 'DELETE');
/** @deprecated */
public $allowedMethods;

/** @var array of Request */
private $requests = array();
Expand Down Expand Up @@ -95,18 +95,6 @@ public function __construct(IPresenterFactory $presenterFactory, IRouter $router
*/
public function run()
{
// check HTTP method
if ($this->allowedMethods) {
$method = $this->httpRequest->getMethod();
if (!in_array($method, $this->allowedMethods, TRUE)) {
$this->httpResponse->setCode(Nette\Http\IResponse::S501_NOT_IMPLEMENTED);
$this->httpResponse->setHeader('Allow', implode(',', $this->allowedMethods));
echo '<h1>Method ' . htmlSpecialChars($method) . ' is not implemented</h1>';
return;
}
}

// dispatching
$request = NULL;
$repeatedError = FALSE;
do {
Expand Down

0 comments on commit 8ac02f6

Please sign in to comment.