@@ -14,115 +14,115 @@ |
||
14 | 14 | interface RequestTypeContextCheckerInterface |
15 | 15 | { |
16 | 16 | |
17 | - /** |
|
18 | - * true if the current request involves some form of activation |
|
19 | - * |
|
20 | - * @return bool |
|
21 | - */ |
|
22 | - public function isActivation(); |
|
17 | + /** |
|
18 | + * true if the current request involves some form of activation |
|
19 | + * |
|
20 | + * @return bool |
|
21 | + */ |
|
22 | + public function isActivation(); |
|
23 | 23 | |
24 | 24 | |
25 | - /** |
|
26 | - * @param $is_activation |
|
27 | - * @return bool |
|
28 | - */ |
|
29 | - public function setIsActivation($is_activation); |
|
25 | + /** |
|
26 | + * @param $is_activation |
|
27 | + * @return bool |
|
28 | + */ |
|
29 | + public function setIsActivation($is_activation); |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * true if the current request is for the admin and is not being made via AJAX |
|
34 | - * |
|
35 | - * @return bool |
|
36 | - */ |
|
37 | - public function isAdmin(); |
|
32 | + /** |
|
33 | + * true if the current request is for the admin and is not being made via AJAX |
|
34 | + * |
|
35 | + * @return bool |
|
36 | + */ |
|
37 | + public function isAdmin(); |
|
38 | 38 | |
39 | 39 | |
40 | - /** |
|
41 | - * true if the current request is for the admin AND is being made via AJAX |
|
42 | - * |
|
43 | - * @return bool |
|
44 | - */ |
|
45 | - public function isAdminAjax(); |
|
40 | + /** |
|
41 | + * true if the current request is for the admin AND is being made via AJAX |
|
42 | + * |
|
43 | + * @return bool |
|
44 | + */ |
|
45 | + public function isAdminAjax(); |
|
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * true if the current request is being made via AJAX... any AJAX |
|
50 | - * |
|
51 | - * @return bool |
|
52 | - */ |
|
53 | - public function isAjax(); |
|
48 | + /** |
|
49 | + * true if the current request is being made via AJAX... any AJAX |
|
50 | + * |
|
51 | + * @return bool |
|
52 | + */ |
|
53 | + public function isAjax(); |
|
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * true if the current request is for the EE REST API |
|
58 | - * |
|
59 | - * @return bool |
|
60 | - */ |
|
61 | - public function isApi(); |
|
56 | + /** |
|
57 | + * true if the current request is for the EE REST API |
|
58 | + * |
|
59 | + * @return bool |
|
60 | + */ |
|
61 | + public function isApi(); |
|
62 | 62 | |
63 | 63 | |
64 | - /** |
|
65 | - * true if the current request is from the command line |
|
66 | - * |
|
67 | - * @return bool |
|
68 | - */ |
|
69 | - public function isCli(); |
|
64 | + /** |
|
65 | + * true if the current request is from the command line |
|
66 | + * |
|
67 | + * @return bool |
|
68 | + */ |
|
69 | + public function isCli(); |
|
70 | 70 | |
71 | 71 | |
72 | - /** |
|
73 | - * true if the current request is for a WP_Cron |
|
74 | - * |
|
75 | - * @return bool |
|
76 | - */ |
|
77 | - public function isCron(); |
|
72 | + /** |
|
73 | + * true if the current request is for a WP_Cron |
|
74 | + * |
|
75 | + * @return bool |
|
76 | + */ |
|
77 | + public function isCron(); |
|
78 | 78 | |
79 | 79 | |
80 | - /** |
|
81 | - * true if the current request is for either the EE admin or EE frontend AND is being made via AJAX |
|
82 | - * |
|
83 | - * @return bool |
|
84 | - */ |
|
85 | - public function isEeAjax(); |
|
80 | + /** |
|
81 | + * true if the current request is for either the EE admin or EE frontend AND is being made via AJAX |
|
82 | + * |
|
83 | + * @return bool |
|
84 | + */ |
|
85 | + public function isEeAjax(); |
|
86 | 86 | |
87 | 87 | |
88 | - /** |
|
89 | - * true if the current request is for a feed (ie: RSS) |
|
90 | - * |
|
91 | - * @return bool |
|
92 | - */ |
|
93 | - public function isFeed(); |
|
88 | + /** |
|
89 | + * true if the current request is for a feed (ie: RSS) |
|
90 | + * |
|
91 | + * @return bool |
|
92 | + */ |
|
93 | + public function isFeed(); |
|
94 | 94 | |
95 | 95 | |
96 | - /** |
|
97 | - * true if the current request is for the frontend and is not being made via AJAX |
|
98 | - * |
|
99 | - * @return bool |
|
100 | - */ |
|
101 | - public function isFrontend(); |
|
96 | + /** |
|
97 | + * true if the current request is for the frontend and is not being made via AJAX |
|
98 | + * |
|
99 | + * @return bool |
|
100 | + */ |
|
101 | + public function isFrontend(); |
|
102 | 102 | |
103 | 103 | |
104 | - /** |
|
105 | - * @return bool |
|
106 | - */ |
|
107 | - public function isFrontAjax(); |
|
104 | + /** |
|
105 | + * @return bool |
|
106 | + */ |
|
107 | + public function isFrontAjax(); |
|
108 | 108 | |
109 | 109 | |
110 | - /** |
|
111 | - * @return bool |
|
112 | - */ |
|
113 | - public function isIframe(); |
|
110 | + /** |
|
111 | + * @return bool |
|
112 | + */ |
|
113 | + public function isIframe(); |
|
114 | 114 | |
115 | 115 | |
116 | - /** |
|
117 | - * true if the current request is being made via AJAX but is NOT for EE related logic |
|
118 | - * |
|
119 | - * @return bool |
|
120 | - */ |
|
121 | - public function isOtherAjax(); |
|
116 | + /** |
|
117 | + * true if the current request is being made via AJAX but is NOT for EE related logic |
|
118 | + * |
|
119 | + * @return bool |
|
120 | + */ |
|
121 | + public function isOtherAjax(); |
|
122 | 122 | |
123 | 123 | |
124 | - /** |
|
125 | - * @return string |
|
126 | - */ |
|
127 | - public function slug(); |
|
124 | + /** |
|
125 | + * @return string |
|
126 | + */ |
|
127 | + public function slug(); |
|
128 | 128 | } |
@@ -14,25 +14,25 @@ |
||
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
17 | - * @deprecated 4.9.53 |
|
18 | - * @param EEI_Request_Decorator $application |
|
17 | + * @deprecated 4.9.53 |
|
18 | + * @param EEI_Request_Decorator $application |
|
19 | 19 | * @param array $middlewares |
20 | 20 | */ |
21 | 21 | public function __construct( EEI_Request_Decorator $application, $middlewares = array() ) { |
22 | - EE_Error::doing_it_wrong( |
|
23 | - __METHOD__, |
|
24 | - sprintf( |
|
25 | - esc_html__( |
|
26 | - 'This class is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
27 | - 'event_espresso' |
|
28 | - ), |
|
29 | - 'EventEspresso\core\services\request\RequestStack', |
|
30 | - '\core\services\request', |
|
31 | - 'EventEspresso\core\services\request' |
|
32 | - ), |
|
33 | - '4.9.53' |
|
34 | - ); |
|
35 | - } |
|
22 | + EE_Error::doing_it_wrong( |
|
23 | + __METHOD__, |
|
24 | + sprintf( |
|
25 | + esc_html__( |
|
26 | + 'This class is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
27 | + 'event_espresso' |
|
28 | + ), |
|
29 | + 'EventEspresso\core\services\request\RequestStack', |
|
30 | + '\core\services\request', |
|
31 | + 'EventEspresso\core\services\request' |
|
32 | + ), |
|
33 | + '4.9.53' |
|
34 | + ); |
|
35 | + } |
|
36 | 36 | |
37 | 37 | |
38 | 38 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * @param EEI_Request_Decorator $application |
19 | 19 | * @param array $middlewares |
20 | 20 | */ |
21 | - public function __construct( EEI_Request_Decorator $application, $middlewares = array() ) { |
|
21 | + public function __construct(EEI_Request_Decorator $application, $middlewares = array()) { |
|
22 | 22 | EE_Error::doing_it_wrong( |
23 | 23 | __METHOD__, |
24 | 24 | sprintf( |
@@ -19,59 +19,59 @@ |
||
19 | 19 | class RequestStack |
20 | 20 | { |
21 | 21 | |
22 | - /** |
|
23 | - * @var RequestDecoratorInterface $request_stack_app |
|
24 | - */ |
|
25 | - protected $request_stack_app; |
|
22 | + /** |
|
23 | + * @var RequestDecoratorInterface $request_stack_app |
|
24 | + */ |
|
25 | + protected $request_stack_app; |
|
26 | 26 | |
27 | - /** |
|
28 | - * @var RequestStackCoreAppInterface $core_app |
|
29 | - */ |
|
30 | - protected $core_app; |
|
27 | + /** |
|
28 | + * @var RequestStackCoreAppInterface $core_app |
|
29 | + */ |
|
30 | + protected $core_app; |
|
31 | 31 | |
32 | - /** |
|
33 | - * @var RequestInterface $request |
|
34 | - */ |
|
35 | - protected $request; |
|
32 | + /** |
|
33 | + * @var RequestInterface $request |
|
34 | + */ |
|
35 | + protected $request; |
|
36 | 36 | |
37 | - /** |
|
38 | - * @var ResponseInterface $response |
|
39 | - */ |
|
40 | - protected $response; |
|
37 | + /** |
|
38 | + * @var ResponseInterface $response |
|
39 | + */ |
|
40 | + protected $response; |
|
41 | 41 | |
42 | 42 | |
43 | - /** |
|
44 | - * @param RequestDecoratorInterface $request_stack_app |
|
45 | - * @param RequestStackCoreAppInterface $core_app |
|
46 | - */ |
|
47 | - public function __construct(RequestDecoratorInterface $request_stack_app, RequestStackCoreAppInterface $core_app) |
|
48 | - { |
|
49 | - $this->request_stack_app = $request_stack_app; |
|
50 | - $this->core_app = $core_app; |
|
51 | - } |
|
43 | + /** |
|
44 | + * @param RequestDecoratorInterface $request_stack_app |
|
45 | + * @param RequestStackCoreAppInterface $core_app |
|
46 | + */ |
|
47 | + public function __construct(RequestDecoratorInterface $request_stack_app, RequestStackCoreAppInterface $core_app) |
|
48 | + { |
|
49 | + $this->request_stack_app = $request_stack_app; |
|
50 | + $this->core_app = $core_app; |
|
51 | + } |
|
52 | 52 | |
53 | 53 | |
54 | - /** |
|
55 | - * @param RequestInterface $request |
|
56 | - * @param ResponseInterface $response |
|
57 | - * @return ResponseInterface |
|
58 | - */ |
|
59 | - public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
60 | - { |
|
61 | - $this->request = $request; |
|
62 | - $this->response = $response; |
|
63 | - return $this->request_stack_app->handleRequest($request, $response); |
|
64 | - } |
|
54 | + /** |
|
55 | + * @param RequestInterface $request |
|
56 | + * @param ResponseInterface $response |
|
57 | + * @return ResponseInterface |
|
58 | + */ |
|
59 | + public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
60 | + { |
|
61 | + $this->request = $request; |
|
62 | + $this->response = $response; |
|
63 | + return $this->request_stack_app->handleRequest($request, $response); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | |
67 | - /** |
|
68 | - * handle_response |
|
69 | - * executes the handle_response() method on the RequestStackCoreAppInterface object |
|
70 | - * after the request stack has been fully processed |
|
71 | - */ |
|
72 | - public function handleResponse() |
|
73 | - { |
|
74 | - $this->core_app->handleResponse($this->request, $this->response); |
|
75 | - } |
|
67 | + /** |
|
68 | + * handle_response |
|
69 | + * executes the handle_response() method on the RequestStackCoreAppInterface object |
|
70 | + * after the request stack has been fully processed |
|
71 | + */ |
|
72 | + public function handleResponse() |
|
73 | + { |
|
74 | + $this->core_app->handleResponse($this->request, $this->response); |
|
75 | + } |
|
76 | 76 | } |
77 | 77 | // Location: RequestStack.php |
@@ -47,7 +47,7 @@ |
||
47 | 47 | public function __construct(RequestDecoratorInterface $request_stack_app, RequestStackCoreAppInterface $core_app) |
48 | 48 | { |
49 | 49 | $this->request_stack_app = $request_stack_app; |
50 | - $this->core_app = $core_app; |
|
50 | + $this->core_app = $core_app; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 |
@@ -16,22 +16,22 @@ |
||
16 | 16 | interface RequestDecoratorInterface |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * converts a Request to a Response |
|
21 | - * can perform their logic either before or after the core application has run like so: |
|
22 | - * public function handle_request( EE_Request $request, EE_Response $response ) { |
|
23 | - * $this->request = $request; |
|
24 | - * $this->response = $response; |
|
25 | - * // logic performed BEFORE core app has run |
|
26 | - * $this->process_request_stack( $this->request, $this->response ); |
|
27 | - * // logic performed AFTER core app has run |
|
28 | - * return $response; |
|
29 | - * } |
|
30 | - * |
|
31 | - * @param RequestInterface $request |
|
32 | - * @param ResponseInterface $response |
|
33 | - * @return ResponseInterface |
|
34 | - */ |
|
35 | - public function handleRequest(RequestInterface $request, ResponseInterface $response); |
|
19 | + /** |
|
20 | + * converts a Request to a Response |
|
21 | + * can perform their logic either before or after the core application has run like so: |
|
22 | + * public function handle_request( EE_Request $request, EE_Response $response ) { |
|
23 | + * $this->request = $request; |
|
24 | + * $this->response = $response; |
|
25 | + * // logic performed BEFORE core app has run |
|
26 | + * $this->process_request_stack( $this->request, $this->response ); |
|
27 | + * // logic performed AFTER core app has run |
|
28 | + * return $response; |
|
29 | + * } |
|
30 | + * |
|
31 | + * @param RequestInterface $request |
|
32 | + * @param ResponseInterface $response |
|
33 | + * @return ResponseInterface |
|
34 | + */ |
|
35 | + public function handleRequest(RequestInterface $request, ResponseInterface $response); |
|
36 | 36 | } |
37 | 37 | // Location: RequestDecoratorInterface.php |
@@ -29,56 +29,56 @@ |
||
29 | 29 | abstract class Middleware implements RequestDecoratorInterface |
30 | 30 | { |
31 | 31 | |
32 | - /** |
|
33 | - * @var RequestDecoratorInterface $request_stack_app |
|
34 | - */ |
|
35 | - protected $request_stack_app; |
|
36 | - |
|
37 | - /** |
|
38 | - * @var RequestInterface $request |
|
39 | - */ |
|
40 | - protected $request; |
|
41 | - |
|
42 | - /** |
|
43 | - * @var ResponseInterface $response |
|
44 | - */ |
|
45 | - protected $response; |
|
46 | - |
|
47 | - /** |
|
48 | - * @var LoaderInterface |
|
49 | - */ |
|
50 | - protected $loader; |
|
51 | - |
|
52 | - |
|
53 | - |
|
54 | - /** |
|
55 | - * @param RequestDecoratorInterface $request_stack_app |
|
56 | - * @param LoaderInterface $loader |
|
57 | - */ |
|
58 | - public function __construct(RequestDecoratorInterface $request_stack_app, LoaderInterface $loader) |
|
59 | - { |
|
60 | - $this->request_stack_app = $request_stack_app; |
|
61 | - $this->loader = $loader; |
|
62 | - } |
|
63 | - |
|
64 | - |
|
65 | - |
|
66 | - /** |
|
67 | - * process_request_stack |
|
68 | - * |
|
69 | - * @param RequestInterface $request |
|
70 | - * @param ResponseInterface $response |
|
71 | - * @return ResponseInterface |
|
72 | - */ |
|
73 | - protected function processRequestStack(RequestInterface $request, ResponseInterface $response) |
|
74 | - { |
|
75 | - $this->request = $request; |
|
76 | - $this->response = $response; |
|
77 | - if (! $this->response->requestTerminated()) { |
|
78 | - $this->response = $this->request_stack_app->handleRequest($this->request, $this->response); |
|
79 | - } |
|
80 | - return $this->response; |
|
81 | - } |
|
32 | + /** |
|
33 | + * @var RequestDecoratorInterface $request_stack_app |
|
34 | + */ |
|
35 | + protected $request_stack_app; |
|
36 | + |
|
37 | + /** |
|
38 | + * @var RequestInterface $request |
|
39 | + */ |
|
40 | + protected $request; |
|
41 | + |
|
42 | + /** |
|
43 | + * @var ResponseInterface $response |
|
44 | + */ |
|
45 | + protected $response; |
|
46 | + |
|
47 | + /** |
|
48 | + * @var LoaderInterface |
|
49 | + */ |
|
50 | + protected $loader; |
|
51 | + |
|
52 | + |
|
53 | + |
|
54 | + /** |
|
55 | + * @param RequestDecoratorInterface $request_stack_app |
|
56 | + * @param LoaderInterface $loader |
|
57 | + */ |
|
58 | + public function __construct(RequestDecoratorInterface $request_stack_app, LoaderInterface $loader) |
|
59 | + { |
|
60 | + $this->request_stack_app = $request_stack_app; |
|
61 | + $this->loader = $loader; |
|
62 | + } |
|
63 | + |
|
64 | + |
|
65 | + |
|
66 | + /** |
|
67 | + * process_request_stack |
|
68 | + * |
|
69 | + * @param RequestInterface $request |
|
70 | + * @param ResponseInterface $response |
|
71 | + * @return ResponseInterface |
|
72 | + */ |
|
73 | + protected function processRequestStack(RequestInterface $request, ResponseInterface $response) |
|
74 | + { |
|
75 | + $this->request = $request; |
|
76 | + $this->response = $response; |
|
77 | + if (! $this->response->requestTerminated()) { |
|
78 | + $this->response = $this->request_stack_app->handleRequest($this->request, $this->response); |
|
79 | + } |
|
80 | + return $this->response; |
|
81 | + } |
|
82 | 82 | |
83 | 83 | |
84 | 84 | } |
@@ -74,7 +74,7 @@ |
||
74 | 74 | { |
75 | 75 | $this->request = $request; |
76 | 76 | $this->response = $response; |
77 | - if (! $this->response->requestTerminated()) { |
|
77 | + if ( ! $this->response->requestTerminated()) { |
|
78 | 78 | $this->response = $this->request_stack_app->handleRequest($this->request, $this->response); |
79 | 79 | } |
80 | 80 | return $this->response; |
@@ -22,36 +22,36 @@ |
||
22 | 22 | class SetRequestTypeContextChecker extends Middleware |
23 | 23 | { |
24 | 24 | |
25 | - /** |
|
26 | - * converts a Request to a Response |
|
27 | - * |
|
28 | - * @param RequestInterface $request |
|
29 | - * @param ResponseInterface $response |
|
30 | - * @return ResponseInterface |
|
31 | - * @throws InvalidArgumentException |
|
32 | - */ |
|
33 | - public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
34 | - { |
|
35 | - $this->request = $request; |
|
36 | - $this->response = $response; |
|
37 | - /** @var RequestTypeContextDetector $request_type_context_detector */ |
|
38 | - $request_type_context_detector = $this->loader->getShared( |
|
39 | - 'EventEspresso\core\domain\services\contexts\RequestTypeContextDetector', |
|
40 | - array( |
|
41 | - $this->request, |
|
42 | - $this->loader->getShared( |
|
43 | - 'EventEspresso\core\domain\services\contexts\RequestTypeContextFactory', |
|
44 | - array($this->loader) |
|
45 | - ), |
|
46 | - ) |
|
47 | - ); |
|
48 | - $request_type_context = $request_type_context_detector->detectRequestTypeContext(); |
|
49 | - $request_type_context_checker = $this->loader->getShared( |
|
50 | - 'EventEspresso\core\domain\services\contexts\RequestTypeContextChecker', |
|
51 | - array($request_type_context) |
|
52 | - ); |
|
53 | - $this->request->setRequestTypeContextChecker($request_type_context_checker); |
|
54 | - $this->response = $this->processRequestStack($this->request, $this->response); |
|
55 | - return $this->response; |
|
56 | - } |
|
25 | + /** |
|
26 | + * converts a Request to a Response |
|
27 | + * |
|
28 | + * @param RequestInterface $request |
|
29 | + * @param ResponseInterface $response |
|
30 | + * @return ResponseInterface |
|
31 | + * @throws InvalidArgumentException |
|
32 | + */ |
|
33 | + public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
34 | + { |
|
35 | + $this->request = $request; |
|
36 | + $this->response = $response; |
|
37 | + /** @var RequestTypeContextDetector $request_type_context_detector */ |
|
38 | + $request_type_context_detector = $this->loader->getShared( |
|
39 | + 'EventEspresso\core\domain\services\contexts\RequestTypeContextDetector', |
|
40 | + array( |
|
41 | + $this->request, |
|
42 | + $this->loader->getShared( |
|
43 | + 'EventEspresso\core\domain\services\contexts\RequestTypeContextFactory', |
|
44 | + array($this->loader) |
|
45 | + ), |
|
46 | + ) |
|
47 | + ); |
|
48 | + $request_type_context = $request_type_context_detector->detectRequestTypeContext(); |
|
49 | + $request_type_context_checker = $this->loader->getShared( |
|
50 | + 'EventEspresso\core\domain\services\contexts\RequestTypeContextChecker', |
|
51 | + array($request_type_context) |
|
52 | + ); |
|
53 | + $this->request->setRequestTypeContextChecker($request_type_context_checker); |
|
54 | + $this->response = $this->processRequestStack($this->request, $this->response); |
|
55 | + return $this->response; |
|
56 | + } |
|
57 | 57 | } |
@@ -20,31 +20,31 @@ |
||
20 | 20 | class DetectLogin extends Middleware |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * converts a Request to a Response |
|
25 | - * |
|
26 | - * @param RequestInterface $request |
|
27 | - * @param ResponseInterface $response |
|
28 | - * @return ResponseInterface |
|
29 | - */ |
|
30 | - public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
31 | - { |
|
32 | - $this->request = $request; |
|
33 | - $this->response = $response; |
|
34 | - global $pagenow; |
|
35 | - if ( |
|
36 | - in_array( |
|
37 | - $pagenow, |
|
38 | - array('wp-login.php', 'wp-register.php'), |
|
39 | - true |
|
40 | - ) |
|
41 | - && ! filter_var($request->getRequestParam('ee_load_on_login'), FILTER_VALIDATE_BOOLEAN) |
|
42 | - ) { |
|
43 | - $this->response->terminateRequest(); |
|
44 | - } |
|
45 | - $this->response = $this->processRequestStack($this->request, $this->response); |
|
46 | - return $this->response; |
|
47 | - } |
|
23 | + /** |
|
24 | + * converts a Request to a Response |
|
25 | + * |
|
26 | + * @param RequestInterface $request |
|
27 | + * @param ResponseInterface $response |
|
28 | + * @return ResponseInterface |
|
29 | + */ |
|
30 | + public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
31 | + { |
|
32 | + $this->request = $request; |
|
33 | + $this->response = $response; |
|
34 | + global $pagenow; |
|
35 | + if ( |
|
36 | + in_array( |
|
37 | + $pagenow, |
|
38 | + array('wp-login.php', 'wp-register.php'), |
|
39 | + true |
|
40 | + ) |
|
41 | + && ! filter_var($request->getRequestParam('ee_load_on_login'), FILTER_VALIDATE_BOOLEAN) |
|
42 | + ) { |
|
43 | + $this->response->terminateRequest(); |
|
44 | + } |
|
45 | + $this->response = $this->processRequestStack($this->request, $this->response); |
|
46 | + return $this->response; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | 50 | } |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | { |
60 | 60 | $this->request = $request; |
61 | 61 | $this->response = $response; |
62 | - espresso_load_required('EE_Base', EE_CORE . 'EE_Base.core.php'); |
|
63 | - espresso_load_required('EE_Deprecated', EE_CORE . 'EE_Deprecated.core.php'); |
|
62 | + espresso_load_required('EE_Base', EE_CORE.'EE_Base.core.php'); |
|
63 | + espresso_load_required('EE_Deprecated', EE_CORE.'EE_Deprecated.core.php'); |
|
64 | 64 | // workarounds for PHP < 5.3 |
65 | - espresso_load_required('EEH_Class_Tools', EE_HELPERS . 'EEH_Class_Tools.helper.php'); |
|
65 | + espresso_load_required('EEH_Class_Tools', EE_HELPERS.'EEH_Class_Tools.helper.php'); |
|
66 | 66 | do_action( |
67 | 67 | 'EE_EventEspresso_core_services_request_RequestStackCoreApp__handle_request__initialize_core_loading' |
68 | 68 | ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | { |
87 | 87 | espresso_load_required( |
88 | 88 | 'EE_Bootstrap', |
89 | - EE_CORE . 'EE_Bootstrap.core.php' |
|
89 | + EE_CORE.'EE_Bootstrap.core.php' |
|
90 | 90 | ); |
91 | 91 | add_action('plugins_loaded', array('EE_Bootstrap', 'load_espresso_addons'), 1); |
92 | 92 | add_action('plugins_loaded', array('EE_Bootstrap', 'detect_activations_or_upgrades'), 3); |
@@ -27,91 +27,91 @@ |
||
27 | 27 | class RequestStackCoreApp implements RequestDecoratorInterface, RequestStackCoreAppInterface |
28 | 28 | { |
29 | 29 | |
30 | - /** |
|
31 | - * @var RequestInterface $request |
|
32 | - */ |
|
33 | - protected $request; |
|
34 | - |
|
35 | - /** |
|
36 | - * @var ResponseInterface $response |
|
37 | - */ |
|
38 | - protected $response; |
|
39 | - |
|
40 | - |
|
41 | - |
|
42 | - |
|
43 | - /** |
|
44 | - * handle |
|
45 | - * sets hooks for running rest of system |
|
46 | - * provides "AHEE__EE_System__construct__complete" hook for EE Addons to use as their starting point |
|
47 | - * starting EE Addons from any other point may lead to problems |
|
48 | - * |
|
49 | - * @param RequestInterface $request |
|
50 | - * @param ResponseInterface $response |
|
51 | - * @return ResponseInterface |
|
52 | - * @throws InvalidClassException |
|
53 | - * @throws EE_Error |
|
54 | - * @throws InvalidDataTypeException |
|
55 | - * @throws InvalidInterfaceException |
|
56 | - * @throws InvalidArgumentException |
|
57 | - */ |
|
58 | - public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
59 | - { |
|
60 | - $this->request = $request; |
|
61 | - $this->response = $response; |
|
62 | - espresso_load_required('EE_Base', EE_CORE . 'EE_Base.core.php'); |
|
63 | - espresso_load_required('EE_Deprecated', EE_CORE . 'EE_Deprecated.core.php'); |
|
64 | - // workarounds for PHP < 5.3 |
|
65 | - espresso_load_required('EEH_Class_Tools', EE_HELPERS . 'EEH_Class_Tools.helper.php'); |
|
66 | - do_action( |
|
67 | - 'EE_EventEspresso_core_services_request_RequestStackCoreApp__handle_request__initialize_core_loading' |
|
68 | - ); |
|
69 | - // legacy action for backwards compatibility |
|
70 | - do_action('EE_Load_Espresso_Core__handle_request__initialize_core_loading'); |
|
71 | - $this->setupFramework(); |
|
72 | - $loader = LoaderFactory::getLoader(); |
|
73 | - $loader->getShared( |
|
74 | - 'EventEspresso\core\services\notifications\PersistentAdminNoticeManager' |
|
75 | - ); |
|
76 | - // WP cron jobs |
|
77 | - $loader->getShared('EE_Cron_Tasks'); |
|
78 | - $loader->getShared('EE_System'); |
|
79 | - return $this->response; |
|
80 | - } |
|
81 | - |
|
82 | - |
|
83 | - /** |
|
84 | - * set framework for the rest of EE to hook into when loading |
|
85 | - * |
|
86 | - * @throws EE_Error |
|
87 | - */ |
|
88 | - private function setupFramework() |
|
89 | - { |
|
90 | - espresso_load_required( |
|
91 | - 'EE_Bootstrap', |
|
92 | - EE_CORE . 'EE_Bootstrap.core.php' |
|
93 | - ); |
|
94 | - add_action('plugins_loaded', array('EE_Bootstrap', 'load_espresso_addons'), 1); |
|
95 | - add_action('plugins_loaded', array('EE_Bootstrap', 'detect_activations_or_upgrades'), 3); |
|
96 | - add_action('plugins_loaded', array('EE_Bootstrap', 'load_core_configuration'), 5); |
|
97 | - add_action('plugins_loaded', array('EE_Bootstrap', 'register_shortcodes_modules_and_widgets'), 7); |
|
98 | - add_action('plugins_loaded', array('EE_Bootstrap', 'brew_espresso'), 9); |
|
99 | - } |
|
100 | - |
|
101 | - |
|
102 | - /** |
|
103 | - * called after the request stack has been fully processed |
|
104 | - * if any of the middleware apps has requested the plugin be deactivated, then we do that now |
|
105 | - * |
|
106 | - * @param RequestInterface $request |
|
107 | - * @param ResponseInterface $response |
|
108 | - */ |
|
109 | - public function handleResponse(RequestInterface $request, ResponseInterface $response) |
|
110 | - { |
|
111 | - if ($response->pluginDeactivated()) { |
|
112 | - espresso_deactivate_plugin(EE_PLUGIN_BASENAME); |
|
113 | - } |
|
114 | - } |
|
30 | + /** |
|
31 | + * @var RequestInterface $request |
|
32 | + */ |
|
33 | + protected $request; |
|
34 | + |
|
35 | + /** |
|
36 | + * @var ResponseInterface $response |
|
37 | + */ |
|
38 | + protected $response; |
|
39 | + |
|
40 | + |
|
41 | + |
|
42 | + |
|
43 | + /** |
|
44 | + * handle |
|
45 | + * sets hooks for running rest of system |
|
46 | + * provides "AHEE__EE_System__construct__complete" hook for EE Addons to use as their starting point |
|
47 | + * starting EE Addons from any other point may lead to problems |
|
48 | + * |
|
49 | + * @param RequestInterface $request |
|
50 | + * @param ResponseInterface $response |
|
51 | + * @return ResponseInterface |
|
52 | + * @throws InvalidClassException |
|
53 | + * @throws EE_Error |
|
54 | + * @throws InvalidDataTypeException |
|
55 | + * @throws InvalidInterfaceException |
|
56 | + * @throws InvalidArgumentException |
|
57 | + */ |
|
58 | + public function handleRequest(RequestInterface $request, ResponseInterface $response) |
|
59 | + { |
|
60 | + $this->request = $request; |
|
61 | + $this->response = $response; |
|
62 | + espresso_load_required('EE_Base', EE_CORE . 'EE_Base.core.php'); |
|
63 | + espresso_load_required('EE_Deprecated', EE_CORE . 'EE_Deprecated.core.php'); |
|
64 | + // workarounds for PHP < 5.3 |
|
65 | + espresso_load_required('EEH_Class_Tools', EE_HELPERS . 'EEH_Class_Tools.helper.php'); |
|
66 | + do_action( |
|
67 | + 'EE_EventEspresso_core_services_request_RequestStackCoreApp__handle_request__initialize_core_loading' |
|
68 | + ); |
|
69 | + // legacy action for backwards compatibility |
|
70 | + do_action('EE_Load_Espresso_Core__handle_request__initialize_core_loading'); |
|
71 | + $this->setupFramework(); |
|
72 | + $loader = LoaderFactory::getLoader(); |
|
73 | + $loader->getShared( |
|
74 | + 'EventEspresso\core\services\notifications\PersistentAdminNoticeManager' |
|
75 | + ); |
|
76 | + // WP cron jobs |
|
77 | + $loader->getShared('EE_Cron_Tasks'); |
|
78 | + $loader->getShared('EE_System'); |
|
79 | + return $this->response; |
|
80 | + } |
|
81 | + |
|
82 | + |
|
83 | + /** |
|
84 | + * set framework for the rest of EE to hook into when loading |
|
85 | + * |
|
86 | + * @throws EE_Error |
|
87 | + */ |
|
88 | + private function setupFramework() |
|
89 | + { |
|
90 | + espresso_load_required( |
|
91 | + 'EE_Bootstrap', |
|
92 | + EE_CORE . 'EE_Bootstrap.core.php' |
|
93 | + ); |
|
94 | + add_action('plugins_loaded', array('EE_Bootstrap', 'load_espresso_addons'), 1); |
|
95 | + add_action('plugins_loaded', array('EE_Bootstrap', 'detect_activations_or_upgrades'), 3); |
|
96 | + add_action('plugins_loaded', array('EE_Bootstrap', 'load_core_configuration'), 5); |
|
97 | + add_action('plugins_loaded', array('EE_Bootstrap', 'register_shortcodes_modules_and_widgets'), 7); |
|
98 | + add_action('plugins_loaded', array('EE_Bootstrap', 'brew_espresso'), 9); |
|
99 | + } |
|
100 | + |
|
101 | + |
|
102 | + /** |
|
103 | + * called after the request stack has been fully processed |
|
104 | + * if any of the middleware apps has requested the plugin be deactivated, then we do that now |
|
105 | + * |
|
106 | + * @param RequestInterface $request |
|
107 | + * @param ResponseInterface $response |
|
108 | + */ |
|
109 | + public function handleResponse(RequestInterface $request, ResponseInterface $response) |
|
110 | + { |
|
111 | + if ($response->pluginDeactivated()) { |
|
112 | + espresso_deactivate_plugin(EE_PLUGIN_BASENAME); |
|
113 | + } |
|
114 | + } |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | // Location: RequestStackCoreApp.php |
@@ -19,27 +19,27 @@ |
||
19 | 19 | abstract class EE_Middleware implements EEI_Request_Decorator { |
20 | 20 | |
21 | 21 | /** |
22 | - * @deprecated |
|
22 | + * @deprecated |
|
23 | 23 | * @param EE_Request $request |
24 | 24 | * @param EE_Response $response |
25 | 25 | * @return EE_Response |
26 | 26 | */ |
27 | 27 | protected function process_request_stack( EE_Request $request, EE_Response $response ) { |
28 | - EE_Error::doing_it_wrong( |
|
29 | - __METHOD__, |
|
30 | - sprintf( |
|
31 | - esc_html__( |
|
32 | - 'This class is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
33 | - 'event_espresso' |
|
34 | - ), |
|
35 | - 'EventEspresso\core\services\request\middleware\Middleware', |
|
36 | - '\core\services\request', |
|
37 | - 'EventEspresso\core\services\request' |
|
38 | - ), |
|
39 | - '4.9.52' |
|
40 | - ); |
|
41 | - return $response; |
|
42 | - } |
|
28 | + EE_Error::doing_it_wrong( |
|
29 | + __METHOD__, |
|
30 | + sprintf( |
|
31 | + esc_html__( |
|
32 | + 'This class is deprecated. Please use %1$s instead. All Event Espresso request stack classes have been moved to %2$s and are now under the %3$s namespace', |
|
33 | + 'event_espresso' |
|
34 | + ), |
|
35 | + 'EventEspresso\core\services\request\middleware\Middleware', |
|
36 | + '\core\services\request', |
|
37 | + 'EventEspresso\core\services\request' |
|
38 | + ), |
|
39 | + '4.9.52' |
|
40 | + ); |
|
41 | + return $response; |
|
42 | + } |
|
43 | 43 | |
44 | 44 | |
45 | 45 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * @param EE_Response $response |
25 | 25 | * @return EE_Response |
26 | 26 | */ |
27 | - protected function process_request_stack( EE_Request $request, EE_Response $response ) { |
|
27 | + protected function process_request_stack(EE_Request $request, EE_Response $response) { |
|
28 | 28 | EE_Error::doing_it_wrong( |
29 | 29 | __METHOD__, |
30 | 30 | sprintf( |