Skip to content
This repository
Browse code

BUG Make RequestProcessor->filters settable as a property too

filters was a DI property that could only be set via constructor. This meant that modules couldnt add a
filter without interfering with other modules. With this change you can now add a config block like:

Injector:
  RequestProcessor:
    properties:
      filters:
        - "%$MyFilter"

Which will add a filter to RequestProcessors list of filters
  • Loading branch information...
commit 35cc65820c2a02f97936d16622374bef1eb9b68e 1 parent 09067cc
Hamish Friedlander authored July 19, 2012

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  control/RequestProcessor.php
4  control/RequestProcessor.php
@@ -14,6 +14,10 @@ public function __construct($filters = array()) {
14 14
 		$this->filters = $filters;
15 15
 	}
16 16
 
  17
+	public function setFilters($filters) {
  18
+		$this->filters = $filters;
  19
+	}
  20
+
17 21
 	public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model) {
18 22
 		foreach ($this->filters as $filter) {
19 23
 			$res = $filter->preRequest($request, $session, $model);

0 notes on commit 35cc658

Please sign in to comment.
Something went wrong with that request. Please try again.