From dc08cff4b89d90466ebc2b3f2a8dc38b611558ab Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 31 Mar 2014 00:16:15 -0400 Subject: [PATCH] Do not call RootControllerDelegate through WeakInterface. This adds too much indirection in critical codepaths. --- http/root_controller.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/http/root_controller.php b/http/root_controller.php index 03e4747..f24b1f9 100644 --- a/http/root_controller.php +++ b/http/root_controller.php @@ -16,7 +16,6 @@ namespace hoplite\http; -require_once HOPLITE_ROOT . '/base/weak_interface.php'; require_once HOPLITE_ROOT . '/http/request.php'; require_once HOPLITE_ROOT . '/http/response.php'; require_once HOPLITE_ROOT . '/http/response_code.php'; @@ -39,7 +38,7 @@ class RootController /*! @var OutputFilter */ private $output_filter = NULL; - /*! @var WeakInterface */ + /*! @var RootControllerDelegate */ private $delegate = NULL; /*! @@ -59,7 +58,6 @@ class RootController '_COOKIE' => &$globals['_COOKIE'], '_SERVER' => &$globals['_SERVER'] ); - $this->delegate = new \hoplite\base\WeakInterface('hoplite\http\RootControllerDelegate'); } /*! Accessors */ @@ -78,7 +76,7 @@ class RootController /*! Sets the delegate. */ public function set_delegate($delegate) { - $this->delegate->Bind($delegate); + $this->delegate = $delegate; } public function delegate() { @@ -257,8 +255,7 @@ class RootController } /*! - Delegate for the root controller. The controller uses WeakInterface to call - these methods, so they're all optional. + Delegate for the root controller. All methods are optional. */ interface RootControllerDelegate { -- 2.43.5