| 1 | <?php |
||
| 16 | class AspectAuth implements SplObserver |
||
| 17 | { |
||
| 18 | 10 | public function update(SplSubject $ev) |
|
| 19 | { |
||
| 20 | 10 | $name = (string)$ev; |
|
| 21 | 10 | if ('pre-download' === $name) { |
|
| 22 | 8 | return $this->before($ev->refRequest()); |
|
| 23 | } |
||
| 24 | 7 | if ('post-download' === $name) { |
|
| 25 | 7 | $this->after($ev->refResponse()); |
|
| 26 | 6 | } |
|
| 27 | 6 | } |
|
| 28 | |||
| 29 | 8 | private function before(HttpGetRequest $req) |
|
| 50 | |||
| 51 | 7 | private function after(HttpGetResponse $res) |
|
| 62 | } |
||
| 63 |