|
Revision 1442, 2.6 kB
(checked in by mikey, 2 years ago)
|
|
refactoring #137, part 5: replaced stubAbstractPageProcessor by interface stubPageBasedProcessor
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | stubClassLoader::load('net::stubbles::websites::processors::stubProcessor', |
|---|
| 10 | 'net::stubbles::util::validators::stubEqualValidator', |
|---|
| 11 | 'net::stubbles::util::validators::stubRegexValidator' |
|---|
| 12 | ); |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | abstract class stubAbstractProcessor extends stubBaseObject implements stubProcessor |
|---|
| 20 | { |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | protected $request; |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | protected $session; |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | protected $response; |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | protected $interceptorDescriptor = 'interceptors'; |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | private $ssl = null; |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | public function __construct(stubRequest $request, stubSession $session, stubResponse $response) |
|---|
| 60 | { |
|---|
| 61 | $this->request = $request; |
|---|
| 62 | $this->session = $session; |
|---|
| 63 | $this->response = $response; |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | |
|---|
| 71 | public function setInterceptorDescriptor($interceptorDescriptor) |
|---|
| 72 | { |
|---|
| 73 | $this->interceptorDescriptor = $interceptorDescriptor; |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | public function getInterceptorDescriptor() |
|---|
| 82 | { |
|---|
| 83 | return $this->interceptorDescriptor; |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | public function forceSSL() |
|---|
| 92 | { |
|---|
| 93 | return false; |
|---|
| 94 | } |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | public function isSSL() |
|---|
| 102 | { |
|---|
| 103 | if (null === $this->ssl) { |
|---|
| 104 | $this->ssl = false; |
|---|
| 105 | if ($this->request->validateValue(new stubEqualValidator(443), 'SERVER_PORT', stubRequest::SOURCE_HEADER) === true) { |
|---|
| 106 | $this->ssl = true; |
|---|
| 107 | } |
|---|
| 108 | } |
|---|
| 109 | |
|---|
| 110 | return $this->ssl; |
|---|
| 111 | } |
|---|
| 112 | } |
|---|
| 113 | ?> |
|---|