Do not call RootControllerDelegate through WeakInterface.
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 31 Mar 2014 04:16:15 +0000 (00:16 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 31 Mar 2014 04:16:15 +0000 (00:16 -0400)
This adds too much indirection in critical codepaths.

http/root_controller.php

index 03e474770109f9e8fc55d522a124d4a34f53e5fa..f24b1f9bcf56377936398b38117563e941b4ee28 100644 (file)
@@ -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<RootControllerDelegate> */
+  /*! @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
 {