@@ -16,171 +16,171 @@ |
||
16 | 16 | class GQLRequests extends Route |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * returns true if the current request matches this route |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - * @since $VID:$ |
|
24 | - */ |
|
25 | - public function matchesCurrentRequest() |
|
26 | - { |
|
27 | - return PHP_VERSION_ID > 70000 |
|
28 | - && ( |
|
29 | - $this->request->isGQL() |
|
30 | - || $this->request->isUnitTesting() |
|
31 | - || ( |
|
32 | - $this->request->isAdmin() |
|
33 | - && $this->request->getRequestParam('page') === 'espresso_events' |
|
34 | - && ( |
|
35 | - $this->request->getRequestParam('action') === 'create_new' |
|
36 | - || $this->request->getRequestParam('action') === 'edit' |
|
37 | - ) |
|
38 | - ) |
|
39 | - ); |
|
40 | - } |
|
19 | + /** |
|
20 | + * returns true if the current request matches this route |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + * @since $VID:$ |
|
24 | + */ |
|
25 | + public function matchesCurrentRequest() |
|
26 | + { |
|
27 | + return PHP_VERSION_ID > 70000 |
|
28 | + && ( |
|
29 | + $this->request->isGQL() |
|
30 | + || $this->request->isUnitTesting() |
|
31 | + || ( |
|
32 | + $this->request->isAdmin() |
|
33 | + && $this->request->getRequestParam('page') === 'espresso_events' |
|
34 | + && ( |
|
35 | + $this->request->getRequestParam('action') === 'create_new' |
|
36 | + || $this->request->getRequestParam('action') === 'edit' |
|
37 | + ) |
|
38 | + ) |
|
39 | + ); |
|
40 | + } |
|
41 | 41 | |
42 | 42 | |
43 | - /** |
|
44 | - * @since $VID:$ |
|
45 | - */ |
|
46 | - protected function registerDependencies() |
|
47 | - { |
|
48 | - $this->dependency_map->registerDependencies( |
|
49 | - 'EventEspresso\core\services\graphql\GraphQLManager', |
|
50 | - [ |
|
51 | - 'EventEspresso\core\services\graphql\ConnectionsManager' => EE_Dependency_Map::load_from_cache, |
|
52 | - 'EventEspresso\core\services\graphql\DataLoaderManager' => EE_Dependency_Map::load_from_cache, |
|
53 | - 'EventEspresso\core\services\graphql\EnumsManager' => EE_Dependency_Map::load_from_cache, |
|
54 | - 'EventEspresso\core\services\graphql\InputsManager' => EE_Dependency_Map::load_from_cache, |
|
55 | - 'EventEspresso\core\services\graphql\TypesManager' => EE_Dependency_Map::load_from_cache, |
|
56 | - ] |
|
57 | - ); |
|
58 | - $this->dependency_map->registerDependencies( |
|
59 | - 'EventEspresso\core\services\graphql\TypesManager', |
|
60 | - [ |
|
61 | - 'EventEspresso\core\services\graphql\types\TypeCollection' => EE_Dependency_Map::load_from_cache, |
|
62 | - ] |
|
63 | - ); |
|
64 | - $this->dependency_map->registerDependencies( |
|
65 | - 'EventEspresso\core\services\graphql\InputsManager', |
|
66 | - [ |
|
67 | - 'EventEspresso\core\services\graphql\inputs\InputCollection' => EE_Dependency_Map::load_from_cache, |
|
68 | - ] |
|
69 | - ); |
|
70 | - $this->dependency_map->registerDependencies( |
|
71 | - 'EventEspresso\core\services\graphql\EnumsManager', |
|
72 | - [ |
|
73 | - 'EventEspresso\core\services\graphql\enums\EnumCollection' => EE_Dependency_Map::load_from_cache, |
|
74 | - ] |
|
75 | - ); |
|
76 | - $this->dependency_map->registerDependencies( |
|
77 | - 'EventEspresso\core\services\graphql\ConnectionsManager', |
|
78 | - [ |
|
79 | - 'EventEspresso\core\services\graphql\connections\ConnectionCollection' => EE_Dependency_Map::load_from_cache, |
|
80 | - ] |
|
81 | - ); |
|
82 | - $this->dependency_map->registerDependencies( |
|
83 | - 'EventEspresso\core\services\graphql\DataLoaderManager', |
|
84 | - [ |
|
85 | - 'EventEspresso\core\services\graphql\loaders\DataLoaderCollection' => EE_Dependency_Map::load_from_cache, |
|
86 | - ] |
|
87 | - ); |
|
88 | - $this->dependency_map->registerDependencies( |
|
89 | - 'EventEspresso\core\domain\services\graphql\types\Datetime', |
|
90 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
91 | - ); |
|
92 | - $this->dependency_map->registerDependencies( |
|
93 | - 'EventEspresso\core\domain\services\graphql\types\Attendee', |
|
94 | - ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
95 | - ); |
|
96 | - $this->dependency_map->registerDependencies( |
|
97 | - 'EventEspresso\core\domain\services\graphql\types\Event', |
|
98 | - ['EEM_Event' => EE_Dependency_Map::load_from_cache] |
|
99 | - ); |
|
100 | - $this->dependency_map->registerDependencies( |
|
101 | - 'EventEspresso\core\domain\services\graphql\types\Ticket', |
|
102 | - ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
103 | - ); |
|
104 | - $this->dependency_map->registerDependencies( |
|
105 | - 'EventEspresso\core\domain\services\graphql\types\Price', |
|
106 | - ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
107 | - ); |
|
108 | - $this->dependency_map->registerDependencies( |
|
109 | - 'EventEspresso\core\domain\services\graphql\types\PriceType', |
|
110 | - ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
111 | - ); |
|
112 | - $this->dependency_map->registerDependencies( |
|
113 | - 'EventEspresso\core\domain\services\graphql\types\Venue', |
|
114 | - ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
115 | - ); |
|
116 | - $this->dependency_map->registerDependencies( |
|
117 | - 'EventEspresso\core\domain\services\graphql\types\State', |
|
118 | - ['EEM_State' => EE_Dependency_Map::load_from_cache] |
|
119 | - ); |
|
120 | - $this->dependency_map->registerDependencies( |
|
121 | - 'EventEspresso\core\domain\services\graphql\types\Country', |
|
122 | - ['EEM_Country' => EE_Dependency_Map::load_from_cache] |
|
123 | - ); |
|
124 | - $this->dependency_map->registerDependencies( |
|
125 | - 'EventEspresso\core\domain\services\graphql\connections\EventDatetimesConnection', |
|
126 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
127 | - ); |
|
128 | - $this->dependency_map->registerDependencies( |
|
129 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryDatetimesConnection', |
|
130 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
131 | - ); |
|
132 | - $this->dependency_map->registerDependencies( |
|
133 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryAttendeesConnection', |
|
134 | - ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
135 | - ); |
|
136 | - $this->dependency_map->registerDependencies( |
|
137 | - 'EventEspresso\core\domain\services\graphql\connections\DatetimeTicketsConnection', |
|
138 | - ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
139 | - ); |
|
140 | - $this->dependency_map->registerDependencies( |
|
141 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryTicketsConnection', |
|
142 | - ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
143 | - ); |
|
144 | - $this->dependency_map->registerDependencies( |
|
145 | - 'EventEspresso\core\domain\services\graphql\connections\TicketPricesConnection', |
|
146 | - ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
147 | - ); |
|
148 | - $this->dependency_map->registerDependencies( |
|
149 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryPricesConnection', |
|
150 | - ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
151 | - ); |
|
152 | - $this->dependency_map->registerDependencies( |
|
153 | - 'EventEspresso\core\domain\services\graphql\connections\RootQueryPriceTypesConnection', |
|
154 | - ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
155 | - ); |
|
156 | - $this->dependency_map->registerDependencies( |
|
157 | - 'EventEspresso\core\domain\services\graphql\connections\TicketDatetimesConnection', |
|
158 | - ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
159 | - ); |
|
160 | - $this->dependency_map->registerDependencies( |
|
161 | - 'EventEspresso\core\domain\services\graphql\connections\EventVenuesConnection', |
|
162 | - ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
163 | - ); |
|
164 | - } |
|
43 | + /** |
|
44 | + * @since $VID:$ |
|
45 | + */ |
|
46 | + protected function registerDependencies() |
|
47 | + { |
|
48 | + $this->dependency_map->registerDependencies( |
|
49 | + 'EventEspresso\core\services\graphql\GraphQLManager', |
|
50 | + [ |
|
51 | + 'EventEspresso\core\services\graphql\ConnectionsManager' => EE_Dependency_Map::load_from_cache, |
|
52 | + 'EventEspresso\core\services\graphql\DataLoaderManager' => EE_Dependency_Map::load_from_cache, |
|
53 | + 'EventEspresso\core\services\graphql\EnumsManager' => EE_Dependency_Map::load_from_cache, |
|
54 | + 'EventEspresso\core\services\graphql\InputsManager' => EE_Dependency_Map::load_from_cache, |
|
55 | + 'EventEspresso\core\services\graphql\TypesManager' => EE_Dependency_Map::load_from_cache, |
|
56 | + ] |
|
57 | + ); |
|
58 | + $this->dependency_map->registerDependencies( |
|
59 | + 'EventEspresso\core\services\graphql\TypesManager', |
|
60 | + [ |
|
61 | + 'EventEspresso\core\services\graphql\types\TypeCollection' => EE_Dependency_Map::load_from_cache, |
|
62 | + ] |
|
63 | + ); |
|
64 | + $this->dependency_map->registerDependencies( |
|
65 | + 'EventEspresso\core\services\graphql\InputsManager', |
|
66 | + [ |
|
67 | + 'EventEspresso\core\services\graphql\inputs\InputCollection' => EE_Dependency_Map::load_from_cache, |
|
68 | + ] |
|
69 | + ); |
|
70 | + $this->dependency_map->registerDependencies( |
|
71 | + 'EventEspresso\core\services\graphql\EnumsManager', |
|
72 | + [ |
|
73 | + 'EventEspresso\core\services\graphql\enums\EnumCollection' => EE_Dependency_Map::load_from_cache, |
|
74 | + ] |
|
75 | + ); |
|
76 | + $this->dependency_map->registerDependencies( |
|
77 | + 'EventEspresso\core\services\graphql\ConnectionsManager', |
|
78 | + [ |
|
79 | + 'EventEspresso\core\services\graphql\connections\ConnectionCollection' => EE_Dependency_Map::load_from_cache, |
|
80 | + ] |
|
81 | + ); |
|
82 | + $this->dependency_map->registerDependencies( |
|
83 | + 'EventEspresso\core\services\graphql\DataLoaderManager', |
|
84 | + [ |
|
85 | + 'EventEspresso\core\services\graphql\loaders\DataLoaderCollection' => EE_Dependency_Map::load_from_cache, |
|
86 | + ] |
|
87 | + ); |
|
88 | + $this->dependency_map->registerDependencies( |
|
89 | + 'EventEspresso\core\domain\services\graphql\types\Datetime', |
|
90 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
91 | + ); |
|
92 | + $this->dependency_map->registerDependencies( |
|
93 | + 'EventEspresso\core\domain\services\graphql\types\Attendee', |
|
94 | + ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
95 | + ); |
|
96 | + $this->dependency_map->registerDependencies( |
|
97 | + 'EventEspresso\core\domain\services\graphql\types\Event', |
|
98 | + ['EEM_Event' => EE_Dependency_Map::load_from_cache] |
|
99 | + ); |
|
100 | + $this->dependency_map->registerDependencies( |
|
101 | + 'EventEspresso\core\domain\services\graphql\types\Ticket', |
|
102 | + ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
103 | + ); |
|
104 | + $this->dependency_map->registerDependencies( |
|
105 | + 'EventEspresso\core\domain\services\graphql\types\Price', |
|
106 | + ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
107 | + ); |
|
108 | + $this->dependency_map->registerDependencies( |
|
109 | + 'EventEspresso\core\domain\services\graphql\types\PriceType', |
|
110 | + ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
111 | + ); |
|
112 | + $this->dependency_map->registerDependencies( |
|
113 | + 'EventEspresso\core\domain\services\graphql\types\Venue', |
|
114 | + ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
115 | + ); |
|
116 | + $this->dependency_map->registerDependencies( |
|
117 | + 'EventEspresso\core\domain\services\graphql\types\State', |
|
118 | + ['EEM_State' => EE_Dependency_Map::load_from_cache] |
|
119 | + ); |
|
120 | + $this->dependency_map->registerDependencies( |
|
121 | + 'EventEspresso\core\domain\services\graphql\types\Country', |
|
122 | + ['EEM_Country' => EE_Dependency_Map::load_from_cache] |
|
123 | + ); |
|
124 | + $this->dependency_map->registerDependencies( |
|
125 | + 'EventEspresso\core\domain\services\graphql\connections\EventDatetimesConnection', |
|
126 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
127 | + ); |
|
128 | + $this->dependency_map->registerDependencies( |
|
129 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryDatetimesConnection', |
|
130 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
131 | + ); |
|
132 | + $this->dependency_map->registerDependencies( |
|
133 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryAttendeesConnection', |
|
134 | + ['EEM_Attendee' => EE_Dependency_Map::load_from_cache] |
|
135 | + ); |
|
136 | + $this->dependency_map->registerDependencies( |
|
137 | + 'EventEspresso\core\domain\services\graphql\connections\DatetimeTicketsConnection', |
|
138 | + ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
139 | + ); |
|
140 | + $this->dependency_map->registerDependencies( |
|
141 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryTicketsConnection', |
|
142 | + ['EEM_Ticket' => EE_Dependency_Map::load_from_cache] |
|
143 | + ); |
|
144 | + $this->dependency_map->registerDependencies( |
|
145 | + 'EventEspresso\core\domain\services\graphql\connections\TicketPricesConnection', |
|
146 | + ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
147 | + ); |
|
148 | + $this->dependency_map->registerDependencies( |
|
149 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryPricesConnection', |
|
150 | + ['EEM_Price' => EE_Dependency_Map::load_from_cache] |
|
151 | + ); |
|
152 | + $this->dependency_map->registerDependencies( |
|
153 | + 'EventEspresso\core\domain\services\graphql\connections\RootQueryPriceTypesConnection', |
|
154 | + ['EEM_Price_Type' => EE_Dependency_Map::load_from_cache] |
|
155 | + ); |
|
156 | + $this->dependency_map->registerDependencies( |
|
157 | + 'EventEspresso\core\domain\services\graphql\connections\TicketDatetimesConnection', |
|
158 | + ['EEM_Datetime' => EE_Dependency_Map::load_from_cache] |
|
159 | + ); |
|
160 | + $this->dependency_map->registerDependencies( |
|
161 | + 'EventEspresso\core\domain\services\graphql\connections\EventVenuesConnection', |
|
162 | + ['EEM_Venue' => EE_Dependency_Map::load_from_cache] |
|
163 | + ); |
|
164 | + } |
|
165 | 165 | |
166 | 166 | |
167 | - /** |
|
168 | - * implements logic required to run during request |
|
169 | - * |
|
170 | - * @return bool |
|
171 | - * @since $VID:$ |
|
172 | - */ |
|
173 | - protected function requestHandler() |
|
174 | - { |
|
167 | + /** |
|
168 | + * implements logic required to run during request |
|
169 | + * |
|
170 | + * @return bool |
|
171 | + * @since $VID:$ |
|
172 | + */ |
|
173 | + protected function requestHandler() |
|
174 | + { |
|
175 | 175 | |
176 | - if (! class_exists('WPGraphQL')) { |
|
177 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
178 | - } |
|
179 | - // load handler for EE GraphQL requests |
|
180 | - $graphQL_manager = $this->loader->getShared( |
|
181 | - 'EventEspresso\core\services\graphql\GraphQLManager' |
|
182 | - ); |
|
183 | - $graphQL_manager->init(); |
|
184 | - return true; |
|
185 | - } |
|
176 | + if (! class_exists('WPGraphQL')) { |
|
177 | + require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
178 | + } |
|
179 | + // load handler for EE GraphQL requests |
|
180 | + $graphQL_manager = $this->loader->getShared( |
|
181 | + 'EventEspresso\core\services\graphql\GraphQLManager' |
|
182 | + ); |
|
183 | + $graphQL_manager->init(); |
|
184 | + return true; |
|
185 | + } |
|
186 | 186 | } |
@@ -173,8 +173,8 @@ |
||
173 | 173 | protected function requestHandler() |
174 | 174 | { |
175 | 175 | |
176 | - if (! class_exists('WPGraphQL')) { |
|
177 | - require_once EE_THIRD_PARTY . 'wp-graphql/wp-graphql.php'; |
|
176 | + if ( ! class_exists('WPGraphQL')) { |
|
177 | + require_once EE_THIRD_PARTY.'wp-graphql/wp-graphql.php'; |
|
178 | 178 | } |
179 | 179 | // load handler for EE GraphQL requests |
180 | 180 | $graphQL_manager = $this->loader->getShared( |
@@ -16,67 +16,67 @@ |
||
16 | 16 | class RestApiRequests extends Route |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * returns true if the current request matches this route |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - * @since $VID:$ |
|
24 | - */ |
|
25 | - public function matchesCurrentRequest() |
|
26 | - { |
|
27 | - return $this->request->isWordPressApi(); |
|
28 | - } |
|
19 | + /** |
|
20 | + * returns true if the current request matches this route |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + * @since $VID:$ |
|
24 | + */ |
|
25 | + public function matchesCurrentRequest() |
|
26 | + { |
|
27 | + return $this->request->isWordPressApi(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * @since $VID:$ |
|
33 | - */ |
|
34 | - protected function registerDependencies() |
|
35 | - { |
|
36 | - $this->dependency_map->registerDependencies( |
|
37 | - 'EventEspresso\core\libraries\rest_api\CalculatedModelFields', |
|
38 | - [ |
|
39 | - 'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => EE_Dependency_Map::load_from_cache |
|
40 | - ] |
|
41 | - ); |
|
42 | - $this->dependency_map->registerDependencies( |
|
43 | - 'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory', |
|
44 | - ['EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache] |
|
45 | - ); |
|
46 | - $this->dependency_map->registerDependencies( |
|
47 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
48 | - ['EventEspresso\core\libraries\rest_api\CalculatedModelFields' => EE_Dependency_Map::load_from_cache] |
|
49 | - ); |
|
50 | - $this->dependency_map->registerDependencies( |
|
51 | - 'EventEspresso\core\libraries\rest_api\calculations\Datetime', |
|
52 | - [ |
|
53 | - 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
54 | - 'EEM_Registration' => EE_Dependency_Map::load_from_cache |
|
55 | - ] |
|
56 | - ); |
|
57 | - $this->dependency_map->registerDependencies( |
|
58 | - 'EventEspresso\core\libraries\rest_api\calculations\Event', |
|
59 | - [ |
|
60 | - 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
61 | - 'EEM_Registration' => EE_Dependency_Map::load_from_cache |
|
62 | - ] |
|
63 | - ); |
|
64 | - $this->dependency_map->registerDependencies( |
|
65 | - 'EventEspresso\core\libraries\rest_api\calculations\Registration', |
|
66 | - ['EEM_Registration' => EE_Dependency_Map::load_from_cache] |
|
67 | - ); |
|
68 | - } |
|
31 | + /** |
|
32 | + * @since $VID:$ |
|
33 | + */ |
|
34 | + protected function registerDependencies() |
|
35 | + { |
|
36 | + $this->dependency_map->registerDependencies( |
|
37 | + 'EventEspresso\core\libraries\rest_api\CalculatedModelFields', |
|
38 | + [ |
|
39 | + 'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => EE_Dependency_Map::load_from_cache |
|
40 | + ] |
|
41 | + ); |
|
42 | + $this->dependency_map->registerDependencies( |
|
43 | + 'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory', |
|
44 | + ['EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache] |
|
45 | + ); |
|
46 | + $this->dependency_map->registerDependencies( |
|
47 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
48 | + ['EventEspresso\core\libraries\rest_api\CalculatedModelFields' => EE_Dependency_Map::load_from_cache] |
|
49 | + ); |
|
50 | + $this->dependency_map->registerDependencies( |
|
51 | + 'EventEspresso\core\libraries\rest_api\calculations\Datetime', |
|
52 | + [ |
|
53 | + 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
54 | + 'EEM_Registration' => EE_Dependency_Map::load_from_cache |
|
55 | + ] |
|
56 | + ); |
|
57 | + $this->dependency_map->registerDependencies( |
|
58 | + 'EventEspresso\core\libraries\rest_api\calculations\Event', |
|
59 | + [ |
|
60 | + 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
61 | + 'EEM_Registration' => EE_Dependency_Map::load_from_cache |
|
62 | + ] |
|
63 | + ); |
|
64 | + $this->dependency_map->registerDependencies( |
|
65 | + 'EventEspresso\core\libraries\rest_api\calculations\Registration', |
|
66 | + ['EEM_Registration' => EE_Dependency_Map::load_from_cache] |
|
67 | + ); |
|
68 | + } |
|
69 | 69 | |
70 | 70 | |
71 | - /** |
|
72 | - * implements logic required to run during request |
|
73 | - * |
|
74 | - * @return bool |
|
75 | - * @since $VID:$ |
|
76 | - */ |
|
77 | - protected function requestHandler() |
|
78 | - { |
|
79 | - // rest api handled by module for now |
|
80 | - return true; |
|
81 | - } |
|
71 | + /** |
|
72 | + * implements logic required to run during request |
|
73 | + * |
|
74 | + * @return bool |
|
75 | + * @since $VID:$ |
|
76 | + */ |
|
77 | + protected function requestHandler() |
|
78 | + { |
|
79 | + // rest api handled by module for now |
|
80 | + return true; |
|
81 | + } |
|
82 | 82 | } |
@@ -16,111 +16,111 @@ |
||
16 | 16 | class AssetRequests extends Route |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * returns true if the current request matches this route |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - * @since $VID:$ |
|
24 | - */ |
|
25 | - public function matchesCurrentRequest() |
|
26 | - { |
|
27 | - return $this->request->isAdmin() |
|
28 | - || $this->request->isFrontend() |
|
29 | - || $this->request->isIframe() |
|
30 | - || $this->request->isWordPressApi(); |
|
31 | - } |
|
19 | + /** |
|
20 | + * returns true if the current request matches this route |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + * @since $VID:$ |
|
24 | + */ |
|
25 | + public function matchesCurrentRequest() |
|
26 | + { |
|
27 | + return $this->request->isAdmin() |
|
28 | + || $this->request->isFrontend() |
|
29 | + || $this->request->isIframe() |
|
30 | + || $this->request->isWordPressApi(); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | - /** |
|
35 | - * @since $VID:$ |
|
36 | - */ |
|
37 | - protected function registerDependencies() |
|
38 | - { |
|
39 | - $default_dependencies = [ |
|
40 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
41 | - 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
42 | - 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
43 | - ]; |
|
44 | - $this->dependency_map->registerDependencies( |
|
45 | - 'EventEspresso\core\domain\services\assets\ReactAssetManager', |
|
46 | - $default_dependencies |
|
47 | - ); |
|
48 | - $this->dependency_map->registerDependencies( |
|
49 | - 'EventEspresso\core\domain\services\assets\CoreAssetManager', |
|
50 | - [ |
|
51 | - 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
52 | - 'EE_Currency_Config' => EE_Dependency_Map::load_from_cache, |
|
53 | - 'EE_Template_Config' => EE_Dependency_Map::load_from_cache, |
|
54 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
55 | - 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
56 | - ] |
|
57 | - ); |
|
58 | - $this->dependency_map->registerDependencies( |
|
59 | - 'EventEspresso\core\services\editor\BlockRegistrationManager', |
|
60 | - [ |
|
61 | - 'EventEspresso\core\services\assets\BlockAssetManagerCollection' => EE_Dependency_Map::load_from_cache, |
|
62 | - 'EventEspresso\core\domain\entities\editor\BlockCollection' => EE_Dependency_Map::load_from_cache, |
|
63 | - 'EventEspresso\core\services\routing\RouteMatchSpecificationManager' => EE_Dependency_Map::load_from_cache, |
|
64 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
65 | - ] |
|
66 | - ); |
|
67 | - $this->dependency_map->registerDependencies( |
|
68 | - 'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager', |
|
69 | - [ |
|
70 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
71 | - 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
72 | - 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
73 | - ] |
|
74 | - ); |
|
75 | - $this->dependency_map->registerDependencies( |
|
76 | - 'EventEspresso\core\domain\services\blocks\EventAttendeesBlockRenderer', |
|
77 | - [ |
|
78 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
79 | - 'EEM_Attendee' => EE_Dependency_Map::load_from_cache, |
|
80 | - ] |
|
81 | - ); |
|
82 | - $this->dependency_map->registerDependencies( |
|
83 | - 'EventEspresso\core\domain\entities\editor\blocks\EventAttendees', |
|
84 | - [ |
|
85 | - 'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => EE_Dependency_Map::load_from_cache, |
|
86 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
87 | - 'EventEspresso\core\domain\services\blocks\EventAttendeesBlockRenderer' => EE_Dependency_Map::load_from_cache, |
|
88 | - ] |
|
89 | - ); |
|
90 | - } |
|
34 | + /** |
|
35 | + * @since $VID:$ |
|
36 | + */ |
|
37 | + protected function registerDependencies() |
|
38 | + { |
|
39 | + $default_dependencies = [ |
|
40 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
41 | + 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
42 | + 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
43 | + ]; |
|
44 | + $this->dependency_map->registerDependencies( |
|
45 | + 'EventEspresso\core\domain\services\assets\ReactAssetManager', |
|
46 | + $default_dependencies |
|
47 | + ); |
|
48 | + $this->dependency_map->registerDependencies( |
|
49 | + 'EventEspresso\core\domain\services\assets\CoreAssetManager', |
|
50 | + [ |
|
51 | + 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
52 | + 'EE_Currency_Config' => EE_Dependency_Map::load_from_cache, |
|
53 | + 'EE_Template_Config' => EE_Dependency_Map::load_from_cache, |
|
54 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
55 | + 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
56 | + ] |
|
57 | + ); |
|
58 | + $this->dependency_map->registerDependencies( |
|
59 | + 'EventEspresso\core\services\editor\BlockRegistrationManager', |
|
60 | + [ |
|
61 | + 'EventEspresso\core\services\assets\BlockAssetManagerCollection' => EE_Dependency_Map::load_from_cache, |
|
62 | + 'EventEspresso\core\domain\entities\editor\BlockCollection' => EE_Dependency_Map::load_from_cache, |
|
63 | + 'EventEspresso\core\services\routing\RouteMatchSpecificationManager' => EE_Dependency_Map::load_from_cache, |
|
64 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
65 | + ] |
|
66 | + ); |
|
67 | + $this->dependency_map->registerDependencies( |
|
68 | + 'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager', |
|
69 | + [ |
|
70 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
71 | + 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
72 | + 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
73 | + ] |
|
74 | + ); |
|
75 | + $this->dependency_map->registerDependencies( |
|
76 | + 'EventEspresso\core\domain\services\blocks\EventAttendeesBlockRenderer', |
|
77 | + [ |
|
78 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
79 | + 'EEM_Attendee' => EE_Dependency_Map::load_from_cache, |
|
80 | + ] |
|
81 | + ); |
|
82 | + $this->dependency_map->registerDependencies( |
|
83 | + 'EventEspresso\core\domain\entities\editor\blocks\EventAttendees', |
|
84 | + [ |
|
85 | + 'EventEspresso\core\domain\entities\editor\CoreBlocksAssetManager' => EE_Dependency_Map::load_from_cache, |
|
86 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
87 | + 'EventEspresso\core\domain\services\blocks\EventAttendeesBlockRenderer' => EE_Dependency_Map::load_from_cache, |
|
88 | + ] |
|
89 | + ); |
|
90 | + } |
|
91 | 91 | |
92 | 92 | |
93 | - /** |
|
94 | - * implements logic required to run during request |
|
95 | - * |
|
96 | - * @return bool |
|
97 | - * @since $VID:$ |
|
98 | - */ |
|
99 | - protected function requestHandler() |
|
100 | - { |
|
101 | - $this->loader->getShared('EventEspresso\core\services\assets\Registry'); |
|
102 | - $this->loader->getShared('EventEspresso\core\domain\services\assets\CoreAssetManager'); |
|
103 | - if ($this->canLoadBlocks()) { |
|
104 | - $this->loader->getShared( |
|
105 | - 'EventEspresso\core\services\editor\BlockRegistrationManager' |
|
106 | - ); |
|
107 | - } |
|
108 | - return true; |
|
109 | - } |
|
93 | + /** |
|
94 | + * implements logic required to run during request |
|
95 | + * |
|
96 | + * @return bool |
|
97 | + * @since $VID:$ |
|
98 | + */ |
|
99 | + protected function requestHandler() |
|
100 | + { |
|
101 | + $this->loader->getShared('EventEspresso\core\services\assets\Registry'); |
|
102 | + $this->loader->getShared('EventEspresso\core\domain\services\assets\CoreAssetManager'); |
|
103 | + if ($this->canLoadBlocks()) { |
|
104 | + $this->loader->getShared( |
|
105 | + 'EventEspresso\core\services\editor\BlockRegistrationManager' |
|
106 | + ); |
|
107 | + } |
|
108 | + return true; |
|
109 | + } |
|
110 | 110 | |
111 | 111 | |
112 | - /** |
|
113 | - * Return whether blocks can be registered/loaded or not. |
|
114 | - * |
|
115 | - * @return bool |
|
116 | - * @since $VID:$ |
|
117 | - */ |
|
118 | - private function canLoadBlocks() |
|
119 | - { |
|
120 | - return apply_filters('FHEE__EE_System__canLoadBlocks', true) |
|
121 | - && function_exists('register_block_type') |
|
122 | - // don't load blocks if in the Divi page builder editor context |
|
123 | - // @see https://github.com/eventespresso/event-espresso-core/issues/814 |
|
124 | - && ! $this->request->getRequestParam('et_fb', false); |
|
125 | - } |
|
112 | + /** |
|
113 | + * Return whether blocks can be registered/loaded or not. |
|
114 | + * |
|
115 | + * @return bool |
|
116 | + * @since $VID:$ |
|
117 | + */ |
|
118 | + private function canLoadBlocks() |
|
119 | + { |
|
120 | + return apply_filters('FHEE__EE_System__canLoadBlocks', true) |
|
121 | + && function_exists('register_block_type') |
|
122 | + // don't load blocks if in the Divi page builder editor context |
|
123 | + // @see https://github.com/eventespresso/event-espresso-core/issues/814 |
|
124 | + && ! $this->request->getRequestParam('et_fb', false); |
|
125 | + } |
|
126 | 126 | } |
@@ -16,49 +16,49 @@ |
||
16 | 16 | class SessionRequests extends Route |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * returns true if the current request matches this route |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - * @since $VID:$ |
|
24 | - */ |
|
25 | - public function matchesCurrentRequest() |
|
26 | - { |
|
27 | - return $this->request->isAdmin() || $this->request->isEeAjax() || $this->request->isFrontend(); |
|
28 | - } |
|
19 | + /** |
|
20 | + * returns true if the current request matches this route |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + * @since $VID:$ |
|
24 | + */ |
|
25 | + public function matchesCurrentRequest() |
|
26 | + { |
|
27 | + return $this->request->isAdmin() || $this->request->isEeAjax() || $this->request->isFrontend(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * @since $VID:$ |
|
33 | - */ |
|
34 | - protected function registerDependencies() |
|
35 | - { |
|
36 | - $this->dependency_map->registerDependencies( |
|
37 | - 'EE_Session', |
|
38 | - [ |
|
39 | - 'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache, |
|
40 | - 'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache, |
|
41 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
42 | - 'EventEspresso\core\services\session\SessionStartHandler' => EE_Dependency_Map::load_from_cache, |
|
43 | - 'EE_Encryption' => EE_Dependency_Map::load_from_cache, |
|
44 | - ] |
|
45 | - ); |
|
46 | - $this->dependency_map->registerDependencies( |
|
47 | - 'EventEspresso\core\services\session\SessionStartHandler', |
|
48 | - ['EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache] |
|
49 | - ); |
|
50 | - } |
|
31 | + /** |
|
32 | + * @since $VID:$ |
|
33 | + */ |
|
34 | + protected function registerDependencies() |
|
35 | + { |
|
36 | + $this->dependency_map->registerDependencies( |
|
37 | + 'EE_Session', |
|
38 | + [ |
|
39 | + 'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache, |
|
40 | + 'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache, |
|
41 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
42 | + 'EventEspresso\core\services\session\SessionStartHandler' => EE_Dependency_Map::load_from_cache, |
|
43 | + 'EE_Encryption' => EE_Dependency_Map::load_from_cache, |
|
44 | + ] |
|
45 | + ); |
|
46 | + $this->dependency_map->registerDependencies( |
|
47 | + 'EventEspresso\core\services\session\SessionStartHandler', |
|
48 | + ['EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache] |
|
49 | + ); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | |
53 | - /** |
|
54 | - * implements logic required to run during request |
|
55 | - * |
|
56 | - * @return bool |
|
57 | - * @since $VID:$ |
|
58 | - */ |
|
59 | - protected function requestHandler() |
|
60 | - { |
|
61 | - $this->loader->getShared('EE_Session'); |
|
62 | - return true; |
|
63 | - } |
|
53 | + /** |
|
54 | + * implements logic required to run during request |
|
55 | + * |
|
56 | + * @return bool |
|
57 | + * @since $VID:$ |
|
58 | + */ |
|
59 | + protected function requestHandler() |
|
60 | + { |
|
61 | + $this->loader->getShared('EE_Session'); |
|
62 | + return true; |
|
63 | + } |
|
64 | 64 | } |
@@ -16,49 +16,49 @@ |
||
16 | 16 | class WordPressHeartbeat extends Route |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * returns true if the current request matches this route |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - * @since $VID:$ |
|
24 | - */ |
|
25 | - public function matchesCurrentRequest() |
|
26 | - { |
|
27 | - return $this->request->isWordPressHeartbeat(); |
|
28 | - } |
|
19 | + /** |
|
20 | + * returns true if the current request matches this route |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + * @since $VID:$ |
|
24 | + */ |
|
25 | + public function matchesCurrentRequest() |
|
26 | + { |
|
27 | + return $this->request->isWordPressHeartbeat(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * @since $VID:$ |
|
33 | - */ |
|
34 | - protected function registerDependencies() |
|
35 | - { |
|
36 | - $this->dependency_map->registerDependencies( |
|
37 | - 'EventEspresso\core\domain\services\admin\ajax\WordpressHeartbeat', |
|
38 | - [ |
|
39 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
40 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
41 | - ] |
|
42 | - ); |
|
43 | - $this->dependency_map->registerDependencies( |
|
44 | - 'EventEspresso\core\domain\services\admin\ajax\EventEditorHeartbeat', |
|
45 | - [ |
|
46 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
47 | - 'EE_Environment_Config' => EE_Dependency_Map::load_from_cache, |
|
48 | - ] |
|
49 | - ); |
|
50 | - } |
|
31 | + /** |
|
32 | + * @since $VID:$ |
|
33 | + */ |
|
34 | + protected function registerDependencies() |
|
35 | + { |
|
36 | + $this->dependency_map->registerDependencies( |
|
37 | + 'EventEspresso\core\domain\services\admin\ajax\WordpressHeartbeat', |
|
38 | + [ |
|
39 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
40 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
41 | + ] |
|
42 | + ); |
|
43 | + $this->dependency_map->registerDependencies( |
|
44 | + 'EventEspresso\core\domain\services\admin\ajax\EventEditorHeartbeat', |
|
45 | + [ |
|
46 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
47 | + 'EE_Environment_Config' => EE_Dependency_Map::load_from_cache, |
|
48 | + ] |
|
49 | + ); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | |
53 | - /** |
|
54 | - * implements logic required to run during request |
|
55 | - * |
|
56 | - * @return bool |
|
57 | - * @since $VID:$ |
|
58 | - */ |
|
59 | - protected function requestHandler() |
|
60 | - { |
|
61 | - $this->loader->getShared('EventEspresso\core\domain\services\admin\ajax\WordpressHeartbeat'); |
|
62 | - return true; |
|
63 | - } |
|
53 | + /** |
|
54 | + * implements logic required to run during request |
|
55 | + * |
|
56 | + * @return bool |
|
57 | + * @since $VID:$ |
|
58 | + */ |
|
59 | + protected function requestHandler() |
|
60 | + { |
|
61 | + $this->loader->getShared('EventEspresso\core\domain\services\admin\ajax\WordpressHeartbeat'); |
|
62 | + return true; |
|
63 | + } |
|
64 | 64 | } |