https://src.bluestatic.org
/
hoplite.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dc08cff
)
Check for the presence of a RootControllerDelegate before calling it.
author
Robert Sesek <rsesek@bluestatic.org>
Mon, 31 Mar 2014 13:16:26 +0000
(09:16 -0400)
committer
Robert Sesek <rsesek@bluestatic.org>
Mon, 31 Mar 2014 13:16:26 +0000
(09:16 -0400)
http/root_controller.php
patch
|
blob
|
history
diff --git
a/http/root_controller.php
b/http/root_controller.php
index f24b1f9bcf56377936398b38117563e941b4ee28..75a25d7dcd85ccf7ade032776fc683684f42d428 100644
(file)
--- a/
http/root_controller.php
+++ b/
http/root_controller.php
@@
-80,7
+80,7
@@
class RootController
}
public function delegate()
{
}
public function delegate()
{
- return $this->delegate
->Get()
;
+ return $this->delegate;
}
/*!
}
/*!
@@
-113,7
+113,8
@@
class RootController
// Register self as the active instance.
$GLOBALS[__CLASS__] = $this;
// Register self as the active instance.
$GLOBALS[__CLASS__] = $this;
- $this->delegate->OnInitialRequest($this->request, $this->response);
+ if ($this->delegate)
+ $this->delegate->OnInitialRequest($this->request, $this->response);
// Dispatch the request to an Action.
$this->RouteRequest($this->request);
// Dispatch the request to an Action.
$this->RouteRequest($this->request);
@@
-129,7
+130,8
@@
class RootController
*/
public function Stop()
{
*/
public function Stop()
{
- $this->delegate->WillStop($this->request, $this->response);
+ if ($this->delegate)
+ $this->delegate->WillStop($this->request, $this->response);
$this->output_filter->FilterOutput($this->request, $this->response);
$this->_Exit();
}
$this->output_filter->FilterOutput($this->request, $this->response);
$this->_Exit();
}
@@
-170,7
+172,8
@@
class RootController
*/
public function RouteRequest(Request $request)
{
*/
public function RouteRequest(Request $request)
{
- $this->delegate->WillRouteRequest($request, $this->response);
+ if ($this->delegate)
+ $this->delegate->WillRouteRequest($request, $this->response);
$url_map_value = $this->url_map->Evaluate($request);
$url_map_value = $this->url_map->Evaluate($request);
@@
-193,13
+196,15
@@
class RootController
*/
public function InvokeAction(Action $action)
{
*/
public function InvokeAction(Action $action)
{
- $this->delegate->WillInvokeAction($action, $this->request, $this->response);
+ if ($this->delegate)
+ $this->delegate->WillInvokeAction($action, $this->request, $this->response);
$action->FilterRequest($this->request, $this->response);
$action->Invoke($this->request, $this->response);
$action->FilterResponse($this->request, $this->response);
$action->FilterRequest($this->request, $this->response);
$action->Invoke($this->request, $this->response);
$action->FilterResponse($this->request, $this->response);
- $this->delegate->DidInvokeAction($action, $this->request, $this->response);
+ if ($this->delegate)
+ $this->delegate->DidInvokeAction($action, $this->request, $this->response);
}
/*!
}
/*!