]> git.andy128k.dev Git - ipf.git/commitdiff
add project to middlewares
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 17 Dec 2016 18:35:46 +0000 (19:35 +0100)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 17 Dec 2016 18:35:46 +0000 (19:35 +0100)
ipf/middleware/base.php
ipf/project.php

index 39731a77613a6d7e7e64f64bbfdb4b88f2586e38..7449207650942bc74cbc0d68fe7fd14489c0ec58 100644 (file)
@@ -2,12 +2,20 @@
 
 class IPF_Middleware
 {
-    protected $next, $settings;
+    /** @var IPF_Middleware */
+    protected $next;
 
-    function __construct($next, $settings)
+    /** @var IPF_Settings */
+    protected $settings;
+
+    /** @var IPF_Project */
+    protected $project;
+
+    function __construct(IPF_Middleware $next, IPF_Settings $settings, IPF_Project $project)
     {
         $this->next = $next;
         $this->settings = $settings;
+        $this->project = $project;
     }
 
     function processRequest($request)
@@ -34,4 +42,3 @@ class IPF_Middleware
         return $this->processResponse($request, $response);
     }
 }
-
index 4da1fae4cc2ff340288e409cbd6ba6c87f53b1d0..6ca989ed8133c3844736f5b8a9583ed9c3b0d816 100644 (file)
@@ -46,7 +46,7 @@ final class IPF_Project
 
         $m = null;
         foreach (array_reverse($middlewares) as $mw) {
-            $m = new $mw($m, IPF::$settings);
+            $m = new $mw($m, IPF::$settings, $this);
         }
         return $m;
     }