From: Andrey Kutejko Date: Sat, 17 Dec 2016 18:35:46 +0000 (+0100) Subject: add project to middlewares X-Git-Tag: 0.6~39 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=eba1008d4eb925e83eb2346e39552a1896a330b9;p=ipf.git add project to middlewares --- diff --git a/ipf/middleware/base.php b/ipf/middleware/base.php index 39731a7..7449207 100644 --- a/ipf/middleware/base.php +++ b/ipf/middleware/base.php @@ -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); } } - diff --git a/ipf/project.php b/ipf/project.php index 4da1fae..6ca989e 100644 --- a/ipf/project.php +++ b/ipf/project.php @@ -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; }