diff --git a/src/Application/Application.php b/src/Application/Application.php index 9ac0c2a84..26adced3e 100644 --- a/src/Application/Application.php +++ b/src/Application/Application.php @@ -222,4 +222,22 @@ public function getPresenterFactory() return $this->presenterFactory; } + + /********************* request serialization ****************d*g**/ + + + /** @deprecated */ + function storeRequest($expiration = '+ 10 minutes') + { + trigger_error(__METHOD__ . '() is deprecated; use $presenter->storeRequest() instead.', E_USER_DEPRECATED); + return $this->presenter->storeRequest($expiration); + } + + /** @deprecated */ + function restoreRequest($key) + { + trigger_error(__METHOD__ . '() is deprecated; use $presenter->restoreRequest() instead.', E_USER_DEPRECATED); + return $this->presenter->restoreRequest($key); + } + } diff --git a/src/Application/UI/Presenter.php b/src/Application/UI/Presenter.php index 6459809e9..0c2ed8b08 100644 --- a/src/Application/UI/Presenter.php +++ b/src/Application/UI/Presenter.php @@ -639,6 +639,10 @@ public function sendResponse(Application\IResponse $response) */ public function terminate() { + if (func_num_args() !== 0) { + trigger_error(__METHOD__ . ' is not intended to send a Application\Response; use sendResponse() instead.', E_USER_WARNING); + $this->sendResponse(func_get_arg(0)); + } throw new Application\AbortException(); } @@ -1333,6 +1337,16 @@ public function getContext() } + /** + * @deprecated + */ + final public function getService($name) + { + trigger_error(__METHOD__ . '() is deprecated; use dependency injection instead.', E_USER_DEPRECATED); + return $this->context->getService($name); + } + + /** * @return Nette\Http\IRequest */ diff --git a/src/Application/UI/PresenterComponent.php b/src/Application/UI/PresenterComponent.php index e35fff468..f2555125c 100644 --- a/src/Application/UI/PresenterComponent.php +++ b/src/Application/UI/PresenterComponent.php @@ -184,7 +184,11 @@ public function saveState(array & $params, $reflection = NULL) */ public function getParameter($name, $default = NULL) { - if (isset($this->params[$name])) { + if (func_num_args() === 0) { + trigger_error('Calling ' . __METHOD__ . ' with no arguments to get all parameters is deprecated, use getParameters() instead.', E_USER_DEPRECATED); + return $this->params; + + } elseif (isset($this->params[$name])) { return $this->params[$name]; } else {