Completed
Branch dev (f8c12d)
by
unknown
87:36 queued 78:32
created
languages/event_espresso-translations-js.php 1 patch
Spacing   +497 added lines, -497 removed lines patch added patch discarded remove patch
@@ -2,226 +2,226 @@  discard block
 block discarded – undo
2 2
 /* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */
3 3
 $generated_i18n_strings = array(
4 4
 	// Reference: packages/ui-components/src/Pagination/constants.ts:6
5
-	__( '2', 'event_espresso' ),
5
+	__('2', 'event_espresso'),
6 6
 
7 7
 	// Reference: packages/ui-components/src/Pagination/constants.ts:7
8
-	__( '6', 'event_espresso' ),
8
+	__('6', 'event_espresso'),
9 9
 
10 10
 	// Reference: packages/ui-components/src/Pagination/constants.ts:8
11
-	__( '12', 'event_espresso' ),
11
+	__('12', 'event_espresso'),
12 12
 
13 13
 	// Reference: packages/ui-components/src/Pagination/constants.ts:9
14
-	__( '24', 'event_espresso' ),
14
+	__('24', 'event_espresso'),
15 15
 
16 16
 	// Reference: packages/ui-components/src/Pagination/constants.ts:10
17
-	__( '48', 'event_espresso' ),
17
+	__('48', 'event_espresso'),
18 18
 
19 19
 	// Reference: domains/blocks/src/components/AvatarImage.tsx:27
20
-	__( 'contact avatar', 'event_espresso' ),
20
+	__('contact avatar', 'event_espresso'),
21 21
 
22 22
 	// Reference: domains/blocks/src/components/OrderByControl.tsx:12
23
-	__( 'Order by', 'event_espresso' ),
23
+	__('Order by', 'event_espresso'),
24 24
 
25 25
 	// Reference: domains/blocks/src/components/RegStatusControl.tsx:17
26 26
 	// Reference: domains/blocks/src/event-attendees/controls/SelectStatus.tsx:13
27
-	__( 'Select Registration Status', 'event_espresso' ),
27
+	__('Select Registration Status', 'event_espresso'),
28 28
 
29 29
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:14
30
-	__( 'Ascending', 'event_espresso' ),
30
+	__('Ascending', 'event_espresso'),
31 31
 
32 32
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:18
33
-	__( 'Descending', 'event_espresso' ),
33
+	__('Descending', 'event_espresso'),
34 34
 
35 35
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:24
36
-	__( 'Sort order:', 'event_espresso' ),
36
+	__('Sort order:', 'event_espresso'),
37 37
 
38 38
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:41
39
-	__( 'There was some error fetching attendees list', 'event_espresso' ),
39
+	__('There was some error fetching attendees list', 'event_espresso'),
40 40
 
41 41
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:47
42
-	__( 'To get started, select what event you want to show attendees from in the block settings.', 'event_espresso' ),
42
+	__('To get started, select what event you want to show attendees from in the block settings.', 'event_espresso'),
43 43
 
44 44
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:53
45
-	__( 'There are no attendees for selected options.', 'event_espresso' ),
45
+	__('There are no attendees for selected options.', 'event_espresso'),
46 46
 
47 47
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:12
48
-	__( 'Display on Archives', 'event_espresso' ),
48
+	__('Display on Archives', 'event_espresso'),
49 49
 
50 50
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:17
51
-	__( 'Attendees are shown whenever this post is listed in an archive view.', 'event_espresso' ),
51
+	__('Attendees are shown whenever this post is listed in an archive view.', 'event_espresso'),
52 52
 
53 53
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:18
54
-	__( 'Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso' ),
54
+	__('Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso'),
55 55
 
56 56
 	// Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:29
57
-	__( 'Number of Attendees to Display:', 'event_espresso' ),
57
+	__('Number of Attendees to Display:', 'event_espresso'),
58 58
 
59 59
 	// Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:34
60 60
 	/* translators: %d attendees count */
61
-	_n_noop( 'Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso' ),
61
+	_n_noop('Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso'),
62 62
 
63 63
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:27
64
-	__( 'Display Gravatar', 'event_espresso' ),
64
+	__('Display Gravatar', 'event_espresso'),
65 65
 
66 66
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:32
67
-	__( 'Gravatar images are shown for each attendee.', 'event_espresso' ),
67
+	__('Gravatar images are shown for each attendee.', 'event_espresso'),
68 68
 
69 69
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:33
70
-	__( 'No gravatar images are shown for each attendee.', 'event_espresso' ),
70
+	__('No gravatar images are shown for each attendee.', 'event_espresso'),
71 71
 
72 72
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:38
73
-	__( 'Size of Gravatar', 'event_espresso' ),
73
+	__('Size of Gravatar', 'event_espresso'),
74 74
 
75 75
 	// Reference: domains/blocks/src/event-attendees/controls/SelectDatetime.tsx:22
76
-	__( 'Select Datetime', 'event_espresso' ),
76
+	__('Select Datetime', 'event_espresso'),
77 77
 
78 78
 	// Reference: domains/blocks/src/event-attendees/controls/SelectEvent.tsx:22
79
-	__( 'Select Event', 'event_espresso' ),
79
+	__('Select Event', 'event_espresso'),
80 80
 
81 81
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:11
82
-	__( 'Attendee id', 'event_espresso' ),
82
+	__('Attendee id', 'event_espresso'),
83 83
 
84 84
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:15
85
-	__( 'Last name only', 'event_espresso' ),
85
+	__('Last name only', 'event_espresso'),
86 86
 
87 87
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:19
88
-	__( 'First name only', 'event_espresso' ),
88
+	__('First name only', 'event_espresso'),
89 89
 
90 90
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:23
91
-	__( 'First, then Last name', 'event_espresso' ),
91
+	__('First, then Last name', 'event_espresso'),
92 92
 
93 93
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:27
94
-	__( 'Last, then First name', 'event_espresso' ),
94
+	__('Last, then First name', 'event_espresso'),
95 95
 
96 96
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:41
97
-	__( 'Order Attendees by:', 'event_espresso' ),
97
+	__('Order Attendees by:', 'event_espresso'),
98 98
 
99 99
 	// Reference: domains/blocks/src/event-attendees/controls/SelectTicket.tsx:22
100
-	__( 'Select Ticket', 'event_espresso' ),
100
+	__('Select Ticket', 'event_espresso'),
101 101
 
102 102
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:21
103
-	__( 'Filter By Settings', 'event_espresso' ),
103
+	__('Filter By Settings', 'event_espresso'),
104 104
 
105 105
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:36
106
-	__( 'Gravatar Setttings', 'event_espresso' ),
106
+	__('Gravatar Setttings', 'event_espresso'),
107 107
 
108 108
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:39
109
-	__( 'Archive Settings', 'event_espresso' ),
109
+	__('Archive Settings', 'event_espresso'),
110 110
 
111 111
 	// Reference: domains/blocks/src/event-attendees/index.tsx:10
112
-	__( 'Event Attendees', 'event_espresso' ),
112
+	__('Event Attendees', 'event_espresso'),
113 113
 
114 114
 	// Reference: domains/blocks/src/event-attendees/index.tsx:11
115
-	__( 'Displays a list of people that have registered for the specified event', 'event_espresso' ),
115
+	__('Displays a list of people that have registered for the specified event', 'event_espresso'),
116 116
 
117 117
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
118
-	__( 'event', 'event_espresso' ),
118
+	__('event', 'event_espresso'),
119 119
 
120 120
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
121
-	__( 'attendees', 'event_espresso' ),
121
+	__('attendees', 'event_espresso'),
122 122
 
123 123
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
124
-	__( 'list', 'event_espresso' ),
124
+	__('list', 'event_espresso'),
125 125
 
126 126
 	// Reference: domains/blocks/src/services/utils.ts:17
127
-	__( 'Error', 'event_espresso' ),
127
+	__('Error', 'event_espresso'),
128 128
 
129 129
 	// Reference: domains/blocks/src/services/utils.ts:24
130 130
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityTemplate.tsx:16
131
-	__( 'Select…', 'event_espresso' ),
131
+	__('Select…', 'event_espresso'),
132 132
 
133 133
 	// Reference: domains/blocks/src/services/utils.ts:9
134
-	__( 'Loading…', 'event_espresso' ),
134
+	__('Loading…', 'event_espresso'),
135 135
 
136 136
 	// Reference: domains/eventEditor/src/ui/EventDescription.tsx:32
137
-	__( 'Event Description', 'event_espresso' ),
137
+	__('Event Description', 'event_espresso'),
138 138
 
139 139
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/ActiveStatus.tsx:22
140
-	__( 'Active status', 'event_espresso' ),
140
+	__('Active status', 'event_espresso'),
141 141
 
142 142
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/AltRegPage.tsx:14
143
-	__( 'Alternative Registration Page', 'event_espresso' ),
143
+	__('Alternative Registration Page', 'event_espresso'),
144 144
 
145 145
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/DefaultRegistrationStatus.tsx:15
146
-	__( 'Default Registration Status', 'event_espresso' ),
146
+	__('Default Registration Status', 'event_espresso'),
147 147
 
148 148
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:9
149
-	__( 'Donations Enabled', 'event_espresso' ),
149
+	__('Donations Enabled', 'event_espresso'),
150 150
 
151 151
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:9
152
-	__( 'Donations Disabled', 'event_espresso' ),
152
+	__('Donations Disabled', 'event_espresso'),
153 153
 
154 154
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventManager.tsx:16
155
-	__( 'Event Manager', 'event_espresso' ),
155
+	__('Event Manager', 'event_espresso'),
156 156
 
157 157
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventPhoneNumber.tsx:11
158
-	__( 'Event Phone Number', 'event_espresso' ),
158
+	__('Event Phone Number', 'event_espresso'),
159 159
 
160 160
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/MaxRegistrations.tsx:12
161
-	__( 'Max Registrations per Transaction', 'event_espresso' ),
161
+	__('Max Registrations per Transaction', 'event_espresso'),
162 162
 
163 163
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:9
164
-	__( 'Ticket Selector Enabled', 'event_espresso' ),
164
+	__('Ticket Selector Enabled', 'event_espresso'),
165 165
 
166 166
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:9
167
-	__( 'Ticket Selector Disabled', 'event_espresso' ),
167
+	__('Ticket Selector Disabled', 'event_espresso'),
168 168
 
169 169
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/index.tsx:42
170
-	__( 'Registration Options', 'event_espresso' ),
170
+	__('Registration Options', 'event_espresso'),
171 171
 
172 172
 	// Reference: domains/eventEditor/src/ui/datetimes/DateRegistrationsLink.tsx:13
173
-	__( 'view ALL registrations for this date.', 'event_espresso' ),
173
+	__('view ALL registrations for this date.', 'event_espresso'),
174 174
 
175 175
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10
176
-	__( 'primary information about the date', 'event_espresso' ),
176
+	__('primary information about the date', 'event_espresso'),
177 177
 
178 178
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10
179
-	__( 'Date Details', 'event_espresso' ),
179
+	__('Date Details', 'event_espresso'),
180 180
 
181 181
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
182 182
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16
183 183
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16
184
-	__( 'relations between tickets and dates', 'event_espresso' ),
184
+	__('relations between tickets and dates', 'event_espresso'),
185 185
 
186 186
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
187
-	__( 'Assign Tickets', 'event_espresso' ),
187
+	__('Assign Tickets', 'event_espresso'),
188 188
 
189 189
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/FooterButtons.tsx:22
190
-	__( 'Save and assign tickets', 'event_espresso' ),
190
+	__('Save and assign tickets', 'event_espresso'),
191 191
 
192 192
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:27
193 193
 	/* translators: %s datetime id */
194
-	__( 'Edit datetime %s', 'event_espresso' ),
194
+	__('Edit datetime %s', 'event_espresso'),
195 195
 
196 196
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:30
197
-	__( 'New Datetime', 'event_espresso' ),
197
+	__('New Datetime', 'event_espresso'),
198 198
 
199 199
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:104
200 200
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:108
201 201
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:117
202 202
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:108
203
-	__( 'Details', 'event_espresso' ),
203
+	__('Details', 'event_espresso'),
204 204
 
205 205
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:108
206 206
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:112
207 207
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:81
208
-	__( 'Capacity', 'event_espresso' ),
208
+	__('Capacity', 'event_espresso'),
209 209
 
210 210
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:113
211
-	__( 'The maximum number of registrants that can attend the event at this particular date.', 'event_espresso' ),
211
+	__('The maximum number of registrants that can attend the event at this particular date.', 'event_espresso'),
212 212
 
213 213
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:117
214
-	__( 'Set to 0 to close registration or leave blank for no limit.', 'event_espresso' ),
214
+	__('Set to 0 to close registration or leave blank for no limit.', 'event_espresso'),
215 215
 
216 216
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:122
217 217
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:189
218
-	__( 'Trash', 'event_espresso' ),
218
+	__('Trash', 'event_espresso'),
219 219
 
220 220
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:67
221 221
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:45
222 222
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:80
223 223
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:45
224
-	__( 'Basics', 'event_espresso' ),
224
+	__('Basics', 'event_espresso'),
225 225
 
226 226
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:71
227 227
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:49
@@ -229,249 +229,249 @@  discard block
 block discarded – undo
229 229
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:84
230 230
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:49
231 231
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:40
232
-	__( 'Name', 'event_espresso' ),
232
+	__('Name', 'event_espresso'),
233 233
 
234 234
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:76
235 235
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:55
236 236
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:89
237 237
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:55
238 238
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:47
239
-	__( 'Description', 'event_espresso' ),
239
+	__('Description', 'event_espresso'),
240 240
 
241 241
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:84
242 242
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:63
243 243
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:63
244
-	__( 'Dates', 'event_espresso' ),
244
+	__('Dates', 'event_espresso'),
245 245
 
246 246
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:88
247 247
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:51
248 248
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:101
249
-	__( 'Start Date', 'event_espresso' ),
249
+	__('Start Date', 'event_espresso'),
250 250
 
251 251
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:94
252 252
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:65
253 253
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:107
254
-	__( 'End Date', 'event_espresso' ),
254
+	__('End Date', 'event_espresso'),
255 255
 
256 256
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:34
257 257
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/TableView.tsx:33
258
-	__( 'Event Dates', 'event_espresso' ),
258
+	__('Event Dates', 'event_espresso'),
259 259
 
260 260
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:37
261
-	__( 'loading event dates…', 'event_espresso' ),
261
+	__('loading event dates…', 'event_espresso'),
262 262
 
263 263
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:20
264
-	__( 'Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso' ),
264
+	__('Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso'),
265 265
 
266 266
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:30
267
-	__( 'Ticket Assignments', 'event_espresso' ),
267
+	__('Ticket Assignments', 'event_espresso'),
268 268
 
269 269
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:25
270
-	__( 'Number of related tickets', 'event_espresso' ),
270
+	__('Number of related tickets', 'event_espresso'),
271 271
 
272 272
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:26
273
-	__( 'There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso' ),
273
+	__('There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso'),
274 274
 
275 275
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:34
276
-	__( 'assign tickets', 'event_espresso' ),
276
+	__('assign tickets', 'event_espresso'),
277 277
 
278 278
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:25
279
-	__( 'Permanently delete Datetime?', 'event_espresso' ),
279
+	__('Permanently delete Datetime?', 'event_espresso'),
280 280
 
281 281
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:25
282
-	__( 'Move Datetime to Trash?', 'event_espresso' ),
282
+	__('Move Datetime to Trash?', 'event_espresso'),
283 283
 
284 284
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:27
285
-	__( 'Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso' ),
285
+	__('Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso'),
286 286
 
287 287
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:30
288
-	__( 'Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso' ),
288
+	__('Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso'),
289 289
 
290 290
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:39
291 291
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:44
292
-	__( 'delete permanently', 'event_espresso' ),
292
+	__('delete permanently', 'event_espresso'),
293 293
 
294 294
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:39
295
-	__( 'trash datetime', 'event_espresso' ),
295
+	__('trash datetime', 'event_espresso'),
296 296
 
297 297
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:45
298
-	__( 'event date main menu', 'event_espresso' ),
298
+	__('event date main menu', 'event_espresso'),
299 299
 
300 300
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:59
301
-	__( 'edit datetime', 'event_espresso' ),
301
+	__('edit datetime', 'event_espresso'),
302 302
 
303 303
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:60
304
-	__( 'copy datetime', 'event_espresso' ),
304
+	__('copy datetime', 'event_espresso'),
305 305
 
306 306
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:36
307 307
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:39
308 308
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:43
309
-	__( 'bulk actions', 'event_espresso' ),
309
+	__('bulk actions', 'event_espresso'),
310 310
 
311 311
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:40
312
-	__( 'edit datetime details', 'event_espresso' ),
312
+	__('edit datetime details', 'event_espresso'),
313 313
 
314 314
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44
315
-	__( 'delete datetimes', 'event_espresso' ),
315
+	__('delete datetimes', 'event_espresso'),
316 316
 
317 317
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44
318
-	__( 'trash datetimes', 'event_espresso' ),
318
+	__('trash datetimes', 'event_espresso'),
319 319
 
320 320
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:14
321
-	__( 'Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso' ),
321
+	__('Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso'),
322 322
 
323 323
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15
324
-	__( 'Are you sure you want to trash these datetimes?', 'event_espresso' ),
324
+	__('Are you sure you want to trash these datetimes?', 'event_espresso'),
325 325
 
326 326
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16
327
-	__( 'Delete datetimes permanently', 'event_espresso' ),
327
+	__('Delete datetimes permanently', 'event_espresso'),
328 328
 
329 329
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16
330
-	__( 'Trash datetimes', 'event_espresso' ),
330
+	__('Trash datetimes', 'event_espresso'),
331 331
 
332 332
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:21
333
-	__( 'Bulk edit date details', 'event_espresso' ),
333
+	__('Bulk edit date details', 'event_espresso'),
334 334
 
335 335
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:22
336
-	__( 'any changes will be applied to ALL of the selected dates.', 'event_espresso' ),
336
+	__('any changes will be applied to ALL of the selected dates.', 'event_espresso'),
337 337
 
338 338
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/formValidation.ts:12
339 339
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/formValidation.ts:12
340
-	__( 'Name must be at least three characters', 'event_espresso' ),
340
+	__('Name must be at least three characters', 'event_espresso'),
341 341
 
342 342
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:67
343 343
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:67
344
-	__( 'Shift dates', 'event_espresso' ),
344
+	__('Shift dates', 'event_espresso'),
345 345
 
346 346
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:92
347 347
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:92
348
-	__( 'earlier', 'event_espresso' ),
348
+	__('earlier', 'event_espresso'),
349 349
 
350 350
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:96
351 351
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:96
352
-	__( 'later', 'event_espresso' ),
352
+	__('later', 'event_espresso'),
353 353
 
354 354
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCapacity.tsx:37
355
-	__( 'edit capacity (registration limit)…', 'event_espresso' ),
355
+	__('edit capacity (registration limit)…', 'event_espresso'),
356 356
 
357 357
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:38
358
-	__( 'Edit Event Date', 'event_espresso' ),
358
+	__('Edit Event Date', 'event_espresso'),
359 359
 
360 360
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:42
361
-	__( 'edit start and end dates', 'event_espresso' ),
361
+	__('edit start and end dates', 'event_espresso'),
362 362
 
363 363
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:15
364 364
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:15
365
-	__( 'sold', 'event_espresso' ),
365
+	__('sold', 'event_espresso'),
366 366
 
367 367
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:28
368
-	__( 'capacity', 'event_espresso' ),
368
+	__('capacity', 'event_espresso'),
369 369
 
370 370
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:34
371 371
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:33
372
-	__( 'reg list', 'event_espresso' ),
372
+	__('reg list', 'event_espresso'),
373 373
 
374 374
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:46
375 375
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:45
376
-	__( 'Edit description', 'event_espresso' ),
376
+	__('Edit description', 'event_espresso'),
377 377
 
378 378
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:47
379 379
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:46
380
-	__( 'edit description…', 'event_espresso' ),
380
+	__('edit description…', 'event_espresso'),
381 381
 
382 382
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:10
383
-	__( 'Move Date to Trash', 'event_espresso' ),
383
+	__('Move Date to Trash', 'event_espresso'),
384 384
 
385 385
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:13
386 386
 	// Reference: packages/constants/src/datetime.ts:6
387
-	__( 'Active', 'event_espresso' ),
387
+	__('Active', 'event_espresso'),
388 388
 
389 389
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:14
390 390
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:13
391
-	__( 'Trashed', 'event_espresso' ),
391
+	__('Trashed', 'event_espresso'),
392 392
 
393 393
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:15
394 394
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:14
395 395
 	// Reference: packages/constants/src/datetime.ts:8
396
-	__( 'Expired', 'event_espresso' ),
396
+	__('Expired', 'event_espresso'),
397 397
 
398 398
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:16
399 399
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:16
400
-	__( 'Sold Out', 'event_espresso' ),
400
+	__('Sold Out', 'event_espresso'),
401 401
 
402 402
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:17
403 403
 	// Reference: packages/constants/src/datetime.ts:12
404
-	__( 'Upcoming', 'event_espresso' ),
404
+	__('Upcoming', 'event_espresso'),
405 405
 
406 406
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:7
407
-	__( 'Edit Event Date Details', 'event_espresso' ),
407
+	__('Edit Event Date Details', 'event_espresso'),
408 408
 
409 409
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:8
410
-	__( 'View Registrations for this Date', 'event_espresso' ),
410
+	__('View Registrations for this Date', 'event_espresso'),
411 411
 
412 412
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:9
413
-	__( 'Manage Ticket Assignments', 'event_espresso' ),
413
+	__('Manage Ticket Assignments', 'event_espresso'),
414 414
 
415 415
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:23
416 416
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:34
417
-	__( 'edit title…', 'event_espresso' ),
417
+	__('edit title…', 'event_espresso'),
418 418
 
419 419
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/ActiveDatesFilters.tsx:25
420 420
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/ActiveTicketsFilters.tsx:25
421
-	__( 'ON', 'event_espresso' ),
421
+	__('ON', 'event_espresso'),
422 422
 
423 423
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:10
424
-	__( 'end dates only', 'event_espresso' ),
424
+	__('end dates only', 'event_espresso'),
425 425
 
426 426
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:11
427
-	__( 'start and end dates', 'event_espresso' ),
427
+	__('start and end dates', 'event_espresso'),
428 428
 
429 429
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:16
430
-	__( 'dates above 90% capacity', 'event_espresso' ),
430
+	__('dates above 90% capacity', 'event_espresso'),
431 431
 
432 432
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:17
433
-	__( 'dates above 75% capacity', 'event_espresso' ),
433
+	__('dates above 75% capacity', 'event_espresso'),
434 434
 
435 435
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:18
436
-	__( 'dates above 50% capacity', 'event_espresso' ),
436
+	__('dates above 50% capacity', 'event_espresso'),
437 437
 
438 438
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:19
439
-	__( 'dates below 50% capacity', 'event_espresso' ),
439
+	__('dates below 50% capacity', 'event_espresso'),
440 440
 
441 441
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:23
442
-	__( 'all dates', 'event_espresso' ),
442
+	__('all dates', 'event_espresso'),
443 443
 
444 444
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:24
445
-	__( 'all active and upcoming', 'event_espresso' ),
445
+	__('all active and upcoming', 'event_espresso'),
446 446
 
447 447
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:25
448
-	__( 'active dates only', 'event_espresso' ),
448
+	__('active dates only', 'event_espresso'),
449 449
 
450 450
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:26
451
-	__( 'upcoming dates only', 'event_espresso' ),
451
+	__('upcoming dates only', 'event_espresso'),
452 452
 
453 453
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:27
454
-	__( 'next active or upcoming only', 'event_espresso' ),
454
+	__('next active or upcoming only', 'event_espresso'),
455 455
 
456 456
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:28
457
-	__( 'sold out dates only', 'event_espresso' ),
457
+	__('sold out dates only', 'event_espresso'),
458 458
 
459 459
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:29
460
-	__( 'recently expired dates', 'event_espresso' ),
460
+	__('recently expired dates', 'event_espresso'),
461 461
 
462 462
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:30
463
-	__( 'all expired dates', 'event_espresso' ),
463
+	__('all expired dates', 'event_espresso'),
464 464
 
465 465
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:31
466
-	__( 'trashed dates only', 'event_espresso' ),
466
+	__('trashed dates only', 'event_espresso'),
467 467
 
468 468
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:35
469 469
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:9
470 470
 	// Reference: packages/dates/src/components/DateRangePicker/index.tsx:61
471
-	__( 'start date', 'event_espresso' ),
471
+	__('start date', 'event_espresso'),
472 472
 
473 473
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:36
474
-	__( 'name', 'event_espresso' ),
474
+	__('name', 'event_espresso'),
475 475
 
476 476
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:37
477 477
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:31
@@ -479,138 +479,138 @@  discard block
 block discarded – undo
479 479
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/HeaderCell.tsx:27
480 480
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:31
481 481
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:23
482
-	__( 'ID', 'event_espresso' ),
482
+	__('ID', 'event_espresso'),
483 483
 
484 484
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:38
485 485
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:47
486
-	__( 'custom order', 'event_espresso' ),
486
+	__('custom order', 'event_espresso'),
487 487
 
488 488
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:42
489 489
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:51
490
-	__( 'display', 'event_espresso' ),
490
+	__('display', 'event_espresso'),
491 491
 
492 492
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:43
493
-	__( 'recurrence', 'event_espresso' ),
493
+	__('recurrence', 'event_espresso'),
494 494
 
495 495
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:44
496 496
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:53
497
-	__( 'sales', 'event_espresso' ),
497
+	__('sales', 'event_espresso'),
498 498
 
499 499
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:45
500 500
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:55
501
-	__( 'sort by', 'event_espresso' ),
501
+	__('sort by', 'event_espresso'),
502 502
 
503 503
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:46
504 504
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:54
505 505
 	// Reference: packages/ee-components/src/EntityList/EntityListFilterBar.tsx:53
506
-	__( 'search', 'event_espresso' ),
506
+	__('search', 'event_espresso'),
507 507
 
508 508
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:47
509 509
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:56
510
-	__( 'status', 'event_espresso' ),
510
+	__('status', 'event_espresso'),
511 511
 
512 512
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:9
513
-	__( 'start dates only', 'event_espresso' ),
513
+	__('start dates only', 'event_espresso'),
514 514
 
515 515
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26
516 516
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/NewDateModal.tsx:12
517 517
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsModalButton.tsx:16
518
-	__( 'Add New Date', 'event_espresso' ),
518
+	__('Add New Date', 'event_espresso'),
519 519
 
520 520
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26
521
-	__( 'Add Single Date', 'event_espresso' ),
521
+	__('Add Single Date', 'event_espresso'),
522 522
 
523 523
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:43
524
-	__( 'Add a single date that only occurs once', 'event_espresso' ),
524
+	__('Add a single date that only occurs once', 'event_espresso'),
525 525
 
526 526
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:45
527
-	__( 'Single Date', 'event_espresso' ),
527
+	__('Single Date', 'event_espresso'),
528 528
 
529 529
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:106
530
-	__( 'Reg list', 'event_espresso' ),
530
+	__('Reg list', 'event_espresso'),
531 531
 
532 532
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:107
533 533
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:111
534
-	__( 'Regs', 'event_espresso' ),
534
+	__('Regs', 'event_espresso'),
535 535
 
536 536
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:122
537 537
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:126
538 538
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:59
539
-	__( 'Actions', 'event_espresso' ),
539
+	__('Actions', 'event_espresso'),
540 540
 
541 541
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:52
542
-	__( 'Start', 'event_espresso' ),
542
+	__('Start', 'event_espresso'),
543 543
 
544 544
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:66
545
-	__( 'End', 'event_espresso' ),
545
+	__('End', 'event_espresso'),
546 546
 
547 547
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:82
548
-	__( 'Cap', 'event_espresso' ),
548
+	__('Cap', 'event_espresso'),
549 549
 
550 550
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:94
551 551
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:98
552
-	__( 'Sold', 'event_espresso' ),
552
+	__('Sold', 'event_espresso'),
553 553
 
554 554
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:18
555
-	__( 'Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. 
556
-Please correct the assignments for the highlighted cells.', 'event_espresso' ),
555
+	__('Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. 
556
+Please correct the assignments for the highlighted cells.', 'event_espresso'),
557 557
 
558 558
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:22
559
-	__( 'Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. 
560
-Please correct the assignments for the highlighted cells.', 'event_espresso' ),
559
+	__('Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. 
560
+Please correct the assignments for the highlighted cells.', 'event_espresso'),
561 561
 
562 562
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:32
563
-	__( 'Please Update Assignments', 'event_espresso' ),
563
+	__('Please Update Assignments', 'event_espresso'),
564 564
 
565 565
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:26
566
-	__( 'There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso' ),
566
+	__('There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso'),
567 567
 
568 568
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:29
569 569
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:74
570 570
 	// Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:21
571
-	__( 'Alert!', 'event_espresso' ),
571
+	__('Alert!', 'event_espresso'),
572 572
 
573 573
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:42
574 574
 	/* translators: 1 entity id, 2 entity name */
575
-	__( 'Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso' ),
575
+	__('Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso'),
576 576
 
577 577
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:49
578 578
 	/* translators: 1 entity id, 2 entity name */
579
-	__( 'Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso' ),
579
+	__('Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso'),
580 580
 
581 581
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal.tsx:28
582 582
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/Table.tsx:13
583
-	__( 'Ticket Assignment Manager', 'event_espresso' ),
583
+	__('Ticket Assignment Manager', 'event_espresso'),
584 584
 
585 585
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:10
586
-	__( 'existing relation', 'event_espresso' ),
586
+	__('existing relation', 'event_espresso'),
587 587
 
588 588
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:15
589
-	__( 'remove existing relation', 'event_espresso' ),
589
+	__('remove existing relation', 'event_espresso'),
590 590
 
591 591
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:20
592
-	__( 'add new relation', 'event_espresso' ),
592
+	__('add new relation', 'event_espresso'),
593 593
 
594 594
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:25
595
-	__( 'invalid relation', 'event_espresso' ),
595
+	__('invalid relation', 'event_espresso'),
596 596
 
597 597
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:29
598
-	__( 'no relation', 'event_espresso' ),
598
+	__('no relation', 'event_espresso'),
599 599
 
600 600
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/BodyCell.tsx:24
601
-	__( 'assign ticket', 'event_espresso' ),
601
+	__('assign ticket', 'event_espresso'),
602 602
 
603 603
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:15
604
-	__( 'Assignments', 'event_espresso' ),
604
+	__('Assignments', 'event_espresso'),
605 605
 
606 606
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:16
607
-	__( 'Event Dates are listed below', 'event_espresso' ),
607
+	__('Event Dates are listed below', 'event_espresso'),
608 608
 
609 609
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:17
610
-	__( 'Tickets are listed along the top', 'event_espresso' ),
610
+	__('Tickets are listed along the top', 'event_espresso'),
611 611
 
612 612
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:18
613
-	__( 'Click the cell buttons to toggle assigments', 'event_espresso' ),
613
+	__('Click the cell buttons to toggle assigments', 'event_espresso'),
614 614
 
615 615
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/useSubmitButtonProps.ts:29
616 616
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:16
@@ -619,1006 +619,1006 @@  discard block
 block discarded – undo
619 619
 	// Reference: packages/tpc/src/buttons/useSubmitButtonProps.tsx:29
620 620
 	// Reference: packages/ui-components/src/Modal/useSubmitButtonProps.tsx:13
621 621
 	// Reference: packages/ui-components/src/Stepper/buttons/Submit.tsx:7
622
-	__( 'Submit', 'event_espresso' ),
622
+	__('Submit', 'event_espresso'),
623 623
 
624 624
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:19
625
-	__( 'All Dates', 'event_espresso' ),
625
+	__('All Dates', 'event_espresso'),
626 626
 
627 627
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:26
628
-	__( 'dates by month', 'event_espresso' ),
628
+	__('dates by month', 'event_espresso'),
629 629
 
630 630
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowExpiredTicketsControl.tsx:15
631
-	__( 'show expired tickets', 'event_espresso' ),
631
+	__('show expired tickets', 'event_espresso'),
632 632
 
633 633
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedDatesControl.tsx:9
634
-	__( 'show trashed dates', 'event_espresso' ),
634
+	__('show trashed dates', 'event_espresso'),
635 635
 
636 636
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedTicketsControl.tsx:15
637
-	__( 'show trashed tickets', 'event_espresso' ),
637
+	__('show trashed tickets', 'event_espresso'),
638 638
 
639 639
 	// Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:13
640
-	__( 'total registrations.', 'event_espresso' ),
640
+	__('total registrations.', 'event_espresso'),
641 641
 
642 642
 	// Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:14
643
-	__( 'view ALL registrations for this ticket.', 'event_espresso' ),
643
+	__('view ALL registrations for this ticket.', 'event_espresso'),
644 644
 
645 645
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/Container.tsx:38
646 646
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actions/Actions.tsx:21
647
-	__( 'Default tickets', 'event_espresso' ),
647
+	__('Default tickets', 'event_espresso'),
648 648
 
649 649
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:26
650 650
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:33
651
-	__( 'Set ticket prices', 'event_espresso' ),
651
+	__('Set ticket prices', 'event_espresso'),
652 652
 
653 653
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:31
654
-	__( 'Skip prices - Save', 'event_espresso' ),
654
+	__('Skip prices - Save', 'event_espresso'),
655 655
 
656 656
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:37
657 657
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:57
658
-	__( 'Ticket details', 'event_espresso' ),
658
+	__('Ticket details', 'event_espresso'),
659 659
 
660 660
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:38
661
-	__( 'Save', 'event_espresso' ),
661
+	__('Save', 'event_espresso'),
662 662
 
663 663
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:22
664 664
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:26
665 665
 	/* translators: %s ticket id */
666
-	__( 'Edit ticket %s', 'event_espresso' ),
666
+	__('Edit ticket %s', 'event_espresso'),
667 667
 
668 668
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:25
669 669
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:29
670
-	__( 'New Ticket Details', 'event_espresso' ),
670
+	__('New Ticket Details', 'event_espresso'),
671 671
 
672 672
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10
673 673
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10
674
-	__( 'primary information about the ticket', 'event_espresso' ),
674
+	__('primary information about the ticket', 'event_espresso'),
675 675
 
676 676
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10
677 677
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10
678
-	__( 'Ticket Details', 'event_espresso' ),
678
+	__('Ticket Details', 'event_espresso'),
679 679
 
680 680
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:12
681 681
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:12
682
-	__( 'apply ticket price modifiers and taxes', 'event_espresso' ),
682
+	__('apply ticket price modifiers and taxes', 'event_espresso'),
683 683
 
684 684
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:14
685 685
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:14
686
-	__( 'Price Calculator', 'event_espresso' ),
686
+	__('Price Calculator', 'event_espresso'),
687 687
 
688 688
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16
689 689
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16
690
-	__( 'Assign Dates', 'event_espresso' ),
690
+	__('Assign Dates', 'event_espresso'),
691 691
 
692 692
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:39
693
-	__( 'Skip prices - assign dates', 'event_espresso' ),
693
+	__('Skip prices - assign dates', 'event_espresso'),
694 694
 
695 695
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:50
696
-	__( 'Save and assign dates', 'event_espresso' ),
696
+	__('Save and assign dates', 'event_espresso'),
697 697
 
698 698
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:121
699 699
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:112
700
-	__( 'Quantity For Sale', 'event_espresso' ),
700
+	__('Quantity For Sale', 'event_espresso'),
701 701
 
702 702
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:127
703
-	__( 'The maximum number of this ticket available for sale.', 'event_espresso' ),
703
+	__('The maximum number of this ticket available for sale.', 'event_espresso'),
704 704
 
705 705
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:129
706
-	__( 'Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso' ),
706
+	__('Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso'),
707 707
 
708 708
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:134
709 709
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:121
710
-	__( 'Number of Uses', 'event_espresso' ),
710
+	__('Number of Uses', 'event_espresso'),
711 711
 
712 712
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:140
713
-	__( 'Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso' ),
713
+	__('Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso'),
714 714
 
715 715
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:144
716
-	__( 'Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso' ),
716
+	__('Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso'),
717 717
 
718 718
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:151
719 719
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:129
720
-	__( 'Minimum Quantity', 'event_espresso' ),
720
+	__('Minimum Quantity', 'event_espresso'),
721 721
 
722 722
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:156
723
-	__( 'The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
723
+	__('The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
724 724
 
725 725
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:160
726
-	__( 'Leave blank for no minimum.', 'event_espresso' ),
726
+	__('Leave blank for no minimum.', 'event_espresso'),
727 727
 
728 728
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:165
729 729
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:137
730
-	__( 'Maximum Quantity', 'event_espresso' ),
730
+	__('Maximum Quantity', 'event_espresso'),
731 731
 
732 732
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:171
733
-	__( 'The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
733
+	__('The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
734 734
 
735 735
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:175
736
-	__( 'Leave blank for no maximum.', 'event_espresso' ),
736
+	__('Leave blank for no maximum.', 'event_espresso'),
737 737
 
738 738
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:180
739 739
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:146
740
-	__( 'Required Ticket', 'event_espresso' ),
740
+	__('Required Ticket', 'event_espresso'),
741 741
 
742 742
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:182
743
-	__( 'If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso' ),
743
+	__('If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso'),
744 744
 
745 745
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:97
746
-	__( 'Ticket Sales', 'event_espresso' ),
746
+	__('Ticket Sales', 'event_espresso'),
747 747
 
748 748
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:35
749
-	__( 'Available Tickets', 'event_espresso' ),
749
+	__('Available Tickets', 'event_espresso'),
750 750
 
751 751
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:38
752
-	__( 'loading tickets…', 'event_espresso' ),
752
+	__('loading tickets…', 'event_espresso'),
753 753
 
754 754
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:26
755
-	__( 'Number of related dates', 'event_espresso' ),
755
+	__('Number of related dates', 'event_espresso'),
756 756
 
757 757
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:27
758
-	__( 'There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso' ),
758
+	__('There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso'),
759 759
 
760 760
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:37
761
-	__( 'assign dates', 'event_espresso' ),
761
+	__('assign dates', 'event_espresso'),
762 762
 
763 763
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:18
764
-	__( 'Permanently delete Ticket?', 'event_espresso' ),
764
+	__('Permanently delete Ticket?', 'event_espresso'),
765 765
 
766 766
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:18
767
-	__( 'Move Ticket to Trash?', 'event_espresso' ),
767
+	__('Move Ticket to Trash?', 'event_espresso'),
768 768
 
769 769
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:21
770
-	__( 'Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso' ),
770
+	__('Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso'),
771 771
 
772 772
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:22
773
-	__( 'Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso' ),
773
+	__('Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso'),
774 774
 
775 775
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:44
776 776
 	// Reference: packages/ee-components/src/SimpleTicketCard/actions/Trash.tsx:6
777
-	__( 'trash ticket', 'event_espresso' ),
777
+	__('trash ticket', 'event_espresso'),
778 778
 
779 779
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:25
780
-	__( 'ticket main menu', 'event_espresso' ),
780
+	__('ticket main menu', 'event_espresso'),
781 781
 
782 782
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:38
783 783
 	// Reference: packages/ee-components/src/SimpleTicketCard/actions/Edit.tsx:15
784
-	__( 'edit ticket', 'event_espresso' ),
784
+	__('edit ticket', 'event_espresso'),
785 785
 
786 786
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:39
787
-	__( 'copy ticket', 'event_espresso' ),
787
+	__('copy ticket', 'event_espresso'),
788 788
 
789 789
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:43
790
-	__( 'edit ticket details', 'event_espresso' ),
790
+	__('edit ticket details', 'event_espresso'),
791 791
 
792 792
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
793
-	__( 'delete tickets', 'event_espresso' ),
793
+	__('delete tickets', 'event_espresso'),
794 794
 
795 795
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
796
-	__( 'trash tickets', 'event_espresso' ),
796
+	__('trash tickets', 'event_espresso'),
797 797
 
798 798
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:51
799
-	__( 'edit ticket prices', 'event_espresso' ),
799
+	__('edit ticket prices', 'event_espresso'),
800 800
 
801 801
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:14
802
-	__( 'Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso' ),
802
+	__('Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso'),
803 803
 
804 804
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15
805
-	__( 'Are you sure you want to trash these tickets?', 'event_espresso' ),
805
+	__('Are you sure you want to trash these tickets?', 'event_espresso'),
806 806
 
807 807
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16
808
-	__( 'Delete tickets permanently', 'event_espresso' ),
808
+	__('Delete tickets permanently', 'event_espresso'),
809 809
 
810 810
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16
811
-	__( 'Trash tickets', 'event_espresso' ),
811
+	__('Trash tickets', 'event_espresso'),
812 812
 
813 813
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:21
814
-	__( 'Bulk edit ticket details', 'event_espresso' ),
814
+	__('Bulk edit ticket details', 'event_espresso'),
815 815
 
816 816
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:22
817
-	__( 'any changes will be applied to ALL of the selected tickets.', 'event_espresso' ),
817
+	__('any changes will be applied to ALL of the selected tickets.', 'event_espresso'),
818 818
 
819 819
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/EditPrices.tsx:19
820
-	__( 'Bulk edit ticket prices', 'event_espresso' ),
820
+	__('Bulk edit ticket prices', 'event_espresso'),
821 821
 
822 822
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:20
823
-	__( 'Edit all prices together', 'event_espresso' ),
823
+	__('Edit all prices together', 'event_espresso'),
824 824
 
825 825
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:21
826
-	__( 'Edit all the selected ticket prices dynamically', 'event_espresso' ),
826
+	__('Edit all the selected ticket prices dynamically', 'event_espresso'),
827 827
 
828 828
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:25
829
-	__( 'Edit prices individually', 'event_espresso' ),
829
+	__('Edit prices individually', 'event_espresso'),
830 830
 
831 831
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:26
832
-	__( 'Edit prices for each ticket individually', 'event_espresso' ),
832
+	__('Edit prices for each ticket individually', 'event_espresso'),
833 833
 
834 834
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:14
835 835
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:34
836 836
 	// Reference: packages/form/src/ResetButton.tsx:18
837 837
 	// Reference: packages/tpc/src/buttons/useResetButtonProps.tsx:12
838
-	__( 'Reset', 'event_espresso' ),
838
+	__('Reset', 'event_espresso'),
839 839
 
840 840
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:15
841 841
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:76
842 842
 	// Reference: packages/ui-components/src/Modal/useCancelButtonProps.tsx:10
843
-	__( 'Cancel', 'event_espresso' ),
843
+	__('Cancel', 'event_espresso'),
844 844
 
845 845
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/editSeparately/TPCInstance.tsx:26
846 846
 	/* translators: %s ticket name */
847
-	__( 'Edit prices for Ticket: %s', 'event_espresso' ),
847
+	__('Edit prices for Ticket: %s', 'event_espresso'),
848 848
 
849 849
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:37
850
-	__( 'Edit Ticket Sale Dates', 'event_espresso' ),
850
+	__('Edit Ticket Sale Dates', 'event_espresso'),
851 851
 
852 852
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:41
853
-	__( 'edit ticket sales start and end dates', 'event_espresso' ),
853
+	__('edit ticket sales start and end dates', 'event_espresso'),
854 854
 
855 855
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:28
856
-	__( 'quantity', 'event_espresso' ),
856
+	__('quantity', 'event_espresso'),
857 857
 
858 858
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:27
859
-	__( 'edit quantity of tickets available…', 'event_espresso' ),
859
+	__('edit quantity of tickets available…', 'event_espresso'),
860 860
 
861 861
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:10
862
-	__( 'Move Ticket to Trash', 'event_espresso' ),
862
+	__('Move Ticket to Trash', 'event_espresso'),
863 863
 
864 864
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:15
865 865
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:52
866
-	__( 'On Sale', 'event_espresso' ),
866
+	__('On Sale', 'event_espresso'),
867 867
 
868 868
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:17
869
-	__( 'Pending', 'event_espresso' ),
869
+	__('Pending', 'event_espresso'),
870 870
 
871 871
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:7
872
-	__( 'Edit Ticket Details', 'event_espresso' ),
872
+	__('Edit Ticket Details', 'event_espresso'),
873 873
 
874 874
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:8
875
-	__( 'Manage Date Assignments', 'event_espresso' ),
875
+	__('Manage Date Assignments', 'event_espresso'),
876 876
 
877 877
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:9
878 878
 	// Reference: packages/tpc/src/components/table/Table.tsx:44
879
-	__( 'Ticket Price Calculator', 'event_espresso' ),
879
+	__('Ticket Price Calculator', 'event_espresso'),
880 880
 
881 881
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:39
882
-	__( 'edit ticket total…', 'event_espresso' ),
882
+	__('edit ticket total…', 'event_espresso'),
883 883
 
884 884
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:53
885
-	__( 'set price…', 'event_espresso' ),
885
+	__('set price…', 'event_espresso'),
886 886
 
887 887
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:23
888
-	__( 'tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso' ),
888
+	__('tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso'),
889 889
 
890 890
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:24
891
-	__( 'tickets list is unlinked and is showing tickets for all event dates', 'event_espresso' ),
891
+	__('tickets list is unlinked and is showing tickets for all event dates', 'event_espresso'),
892 892
 
893 893
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:10
894
-	__( 'ticket sales start and end dates', 'event_espresso' ),
894
+	__('ticket sales start and end dates', 'event_espresso'),
895 895
 
896 896
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:15
897
-	__( 'tickets with 90% or more sold', 'event_espresso' ),
897
+	__('tickets with 90% or more sold', 'event_espresso'),
898 898
 
899 899
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:16
900
-	__( 'tickets with 75% or more sold', 'event_espresso' ),
900
+	__('tickets with 75% or more sold', 'event_espresso'),
901 901
 
902 902
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:17
903
-	__( 'tickets with 50% or more sold', 'event_espresso' ),
903
+	__('tickets with 50% or more sold', 'event_espresso'),
904 904
 
905 905
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:19
906
-	__( 'tickets with less than 50% sold', 'event_espresso' ),
906
+	__('tickets with less than 50% sold', 'event_espresso'),
907 907
 
908 908
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:28
909
-	__( 'all tickets for all dates', 'event_espresso' ),
909
+	__('all tickets for all dates', 'event_espresso'),
910 910
 
911 911
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:29
912
-	__( 'all on sale and sale pending', 'event_espresso' ),
912
+	__('all on sale and sale pending', 'event_espresso'),
913 913
 
914 914
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:30
915
-	__( 'on sale tickets only', 'event_espresso' ),
915
+	__('on sale tickets only', 'event_espresso'),
916 916
 
917 917
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:31
918
-	__( 'sale pending tickets only', 'event_espresso' ),
918
+	__('sale pending tickets only', 'event_espresso'),
919 919
 
920 920
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:32
921
-	__( 'next on sale or sale pending only', 'event_espresso' ),
921
+	__('next on sale or sale pending only', 'event_espresso'),
922 922
 
923 923
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:33
924
-	__( 'sold out tickets only', 'event_espresso' ),
924
+	__('sold out tickets only', 'event_espresso'),
925 925
 
926 926
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:34
927
-	__( 'expired tickets only', 'event_espresso' ),
927
+	__('expired tickets only', 'event_espresso'),
928 928
 
929 929
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:35
930
-	__( 'trashed tickets only', 'event_espresso' ),
930
+	__('trashed tickets only', 'event_espresso'),
931 931
 
932 932
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:40
933
-	__( 'all tickets for above dates', 'event_espresso' ),
933
+	__('all tickets for above dates', 'event_espresso'),
934 934
 
935 935
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:44
936
-	__( 'ticket sale date', 'event_espresso' ),
936
+	__('ticket sale date', 'event_espresso'),
937 937
 
938 938
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:45
939
-	__( 'ticket name', 'event_espresso' ),
939
+	__('ticket name', 'event_espresso'),
940 940
 
941 941
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:46
942
-	__( 'ticket ID', 'event_espresso' ),
942
+	__('ticket ID', 'event_espresso'),
943 943
 
944 944
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:52
945
-	__( 'link', 'event_espresso' ),
945
+	__('link', 'event_espresso'),
946 946
 
947 947
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:8
948
-	__( 'ticket sales start date only', 'event_espresso' ),
948
+	__('ticket sales start date only', 'event_espresso'),
949 949
 
950 950
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:9
951
-	__( 'ticket sales end date only', 'event_espresso' ),
951
+	__('ticket sales end date only', 'event_espresso'),
952 952
 
953 953
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:18
954
-	__( 'Add New Ticket', 'event_espresso' ),
954
+	__('Add New Ticket', 'event_espresso'),
955 955
 
956 956
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:32
957
-	__( 'Add a single ticket and assign the dates to it', 'event_espresso' ),
957
+	__('Add a single ticket and assign the dates to it', 'event_espresso'),
958 958
 
959 959
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:34
960
-	__( 'Single Ticket', 'event_espresso' ),
960
+	__('Single Ticket', 'event_espresso'),
961 961
 
962 962
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/TableView.tsx:39
963
-	__( 'Tickets', 'event_espresso' ),
963
+	__('Tickets', 'event_espresso'),
964 964
 
965 965
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:110
966
-	__( 'Registrations', 'event_espresso' ),
966
+	__('Registrations', 'event_espresso'),
967 967
 
968 968
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:51
969
-	__( 'Goes on Sale', 'event_espresso' ),
969
+	__('Goes on Sale', 'event_espresso'),
970 970
 
971 971
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:65
972
-	__( 'Sale Ends', 'event_espresso' ),
972
+	__('Sale Ends', 'event_espresso'),
973 973
 
974 974
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:66
975
-	__( 'Ends', 'event_espresso' ),
975
+	__('Ends', 'event_espresso'),
976 976
 
977 977
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:78
978
-	__( 'Price', 'event_espresso' ),
978
+	__('Price', 'event_espresso'),
979 979
 
980 980
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:88
981
-	__( 'Quantity', 'event_espresso' ),
981
+	__('Quantity', 'event_espresso'),
982 982
 
983 983
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:29
984
-	__( 'Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso' ),
984
+	__('Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso'),
985 985
 
986 986
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:40
987
-	__( 'Skip', 'event_espresso' ),
987
+	__('Skip', 'event_espresso'),
988 988
 
989 989
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:42
990
-	__( 'Sure I\'ll help', 'event_espresso' ),
990
+	__('Sure I\'ll help', 'event_espresso'),
991 991
 
992 992
 	// Reference: packages/adapters/src/Pagination/Pagination.tsx:23
993
-	__( 'pagination', 'event_espresso' ),
993
+	__('pagination', 'event_espresso'),
994 994
 
995 995
 	// Reference: packages/adapters/src/TagSelector/TagSelector.tsx:117
996
-	__( 'toggle menu', 'event_espresso' ),
996
+	__('toggle menu', 'event_espresso'),
997 997
 
998 998
 	// Reference: packages/constants/src/datetime.ts:10
999
-	__( 'Postponed', 'event_espresso' ),
999
+	__('Postponed', 'event_espresso'),
1000 1000
 
1001 1001
 	// Reference: packages/constants/src/datetime.ts:11
1002
-	__( 'SoldOut', 'event_espresso' ),
1002
+	__('SoldOut', 'event_espresso'),
1003 1003
 
1004 1004
 	// Reference: packages/constants/src/datetime.ts:7
1005 1005
 	// Reference: packages/predicates/src/registration/statusOptions.ts:10
1006
-	__( 'Cancelled', 'event_espresso' ),
1006
+	__('Cancelled', 'event_espresso'),
1007 1007
 
1008 1008
 	// Reference: packages/constants/src/datetime.ts:9
1009
-	__( 'Inactive', 'event_espresso' ),
1009
+	__('Inactive', 'event_espresso'),
1010 1010
 
1011 1011
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:13
1012
-	__( 'day in range', 'event_espresso' ),
1012
+	__('day in range', 'event_espresso'),
1013 1013
 
1014 1014
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:17
1015 1015
 	// Reference: packages/dates/src/components/DateRangePicker/index.tsx:79
1016
-	__( 'end date', 'event_espresso' ),
1016
+	__('end date', 'event_espresso'),
1017 1017
 
1018 1018
 	// Reference: packages/dates/src/components/DateTimePicker.tsx:13
1019 1019
 	// Reference: packages/dates/src/components/TimePicker.tsx:13
1020
-	__( 'time', 'event_espresso' ),
1020
+	__('time', 'event_espresso'),
1021 1021
 
1022 1022
 	// Reference: packages/dates/src/constants.ts:5
1023
-	__( 'End Date & Time must be set later than the Start Date & Time', 'event_espresso' ),
1023
+	__('End Date & Time must be set later than the Start Date & Time', 'event_espresso'),
1024 1024
 
1025 1025
 	// Reference: packages/dates/src/constants.ts:7
1026
-	__( 'Start Date & Time must be set before the End Date & Time', 'event_espresso' ),
1026
+	__('Start Date & Time must be set before the End Date & Time', 'event_espresso'),
1027 1027
 
1028 1028
 	// Reference: packages/dates/src/utils/misc.ts:15
1029
-	__( 'month(s)', 'event_espresso' ),
1029
+	__('month(s)', 'event_espresso'),
1030 1030
 
1031 1031
 	// Reference: packages/dates/src/utils/misc.ts:16
1032
-	__( 'week(s)', 'event_espresso' ),
1032
+	__('week(s)', 'event_espresso'),
1033 1033
 
1034 1034
 	// Reference: packages/dates/src/utils/misc.ts:17
1035
-	__( 'day(s)', 'event_espresso' ),
1035
+	__('day(s)', 'event_espresso'),
1036 1036
 
1037 1037
 	// Reference: packages/dates/src/utils/misc.ts:18
1038
-	__( 'hour(s)', 'event_espresso' ),
1038
+	__('hour(s)', 'event_espresso'),
1039 1039
 
1040 1040
 	// Reference: packages/dates/src/utils/misc.ts:19
1041
-	__( 'minute(s)', 'event_espresso' ),
1041
+	__('minute(s)', 'event_espresso'),
1042 1042
 
1043 1043
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:105
1044
-	__( 'datetimes initialized', 'event_espresso' ),
1044
+	__('datetimes initialized', 'event_espresso'),
1045 1045
 
1046 1046
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:115
1047
-	__( 'tickets initialized', 'event_espresso' ),
1047
+	__('tickets initialized', 'event_espresso'),
1048 1048
 
1049 1049
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:125
1050
-	__( 'prices initialized', 'event_espresso' ),
1050
+	__('prices initialized', 'event_espresso'),
1051 1051
 
1052 1052
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:95
1053
-	__( 'price types initialized', 'event_espresso' ),
1053
+	__('price types initialized', 'event_espresso'),
1054 1054
 
1055 1055
 	// Reference: packages/edtr-services/src/apollo/mutations/useReorderEntities.ts:72
1056
-	__( 'reordering has been applied', 'event_espresso' ),
1056
+	__('reordering has been applied', 'event_espresso'),
1057 1057
 
1058 1058
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:38
1059 1059
 	// Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:39
1060
-	__( 'End date has been adjusted', 'event_espresso' ),
1060
+	__('End date has been adjusted', 'event_espresso'),
1061 1061
 
1062 1062
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:59
1063
-	__( 'Required', 'event_espresso' ),
1063
+	__('Required', 'event_espresso'),
1064 1064
 
1065 1065
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:64
1066
-	__( 'Start Date is required', 'event_espresso' ),
1066
+	__('Start Date is required', 'event_espresso'),
1067 1067
 
1068 1068
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:68
1069
-	__( 'End Date is required', 'event_espresso' ),
1069
+	__('End Date is required', 'event_espresso'),
1070 1070
 
1071 1071
 	// Reference: packages/ee-components/src/EntityList/EntityList.tsx:31
1072
-	__( 'no results found', 'event_espresso' ),
1072
+	__('no results found', 'event_espresso'),
1073 1073
 
1074 1074
 	// Reference: packages/ee-components/src/EntityList/EntityList.tsx:32
1075
-	__( 'try changing filter settings', 'event_espresso' ),
1075
+	__('try changing filter settings', 'event_espresso'),
1076 1076
 
1077 1077
 	// Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:27
1078 1078
 	// Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:34
1079
-	__( 'starts', 'event_espresso' ),
1079
+	__('starts', 'event_espresso'),
1080 1080
 
1081 1081
 	// Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:34
1082 1082
 	// Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:47
1083
-	__( 'ends', 'event_espresso' ),
1083
+	__('ends', 'event_espresso'),
1084 1084
 
1085 1085
 	// Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:38
1086 1086
 	/* translators: %d entity id */
1087
-	__( 'select entity with id %d', 'event_espresso' ),
1087
+	__('select entity with id %d', 'event_espresso'),
1088 1088
 
1089 1089
 	// Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:41
1090
-	__( 'select all entities', 'event_espresso' ),
1090
+	__('select all entities', 'event_espresso'),
1091 1091
 
1092 1092
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20
1093
-	__( 'Note: ', 'event_espresso' ),
1093
+	__('Note: ', 'event_espresso'),
1094 1094
 
1095 1095
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20
1096
-	__( 'any changes will be applied to ALL of the selected entities.', 'event_espresso' ),
1096
+	__('any changes will be applied to ALL of the selected entities.', 'event_espresso'),
1097 1097
 
1098 1098
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:26
1099
-	__( 'Bulk edit details', 'event_espresso' ),
1099
+	__('Bulk edit details', 'event_espresso'),
1100 1100
 
1101 1101
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:17
1102
-	__( 'Are you sure you want to bulk update the details?', 'event_espresso' ),
1102
+	__('Are you sure you want to bulk update the details?', 'event_espresso'),
1103 1103
 
1104 1104
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:18
1105
-	__( 'Bulk update details', 'event_espresso' ),
1105
+	__('Bulk update details', 'event_espresso'),
1106 1106
 
1107 1107
 	// Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:26
1108
-	__( 'reorder dates', 'event_espresso' ),
1108
+	__('reorder dates', 'event_espresso'),
1109 1109
 
1110 1110
 	// Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:26
1111
-	__( 'reorder tickets', 'event_espresso' ),
1111
+	__('reorder tickets', 'event_espresso'),
1112 1112
 
1113 1113
 	// Reference: packages/form/src/adapters/WPMediaImage.tsx:12
1114
-	__( 'Select Image', 'event_espresso' ),
1114
+	__('Select Image', 'event_espresso'),
1115 1115
 
1116 1116
 	// Reference: packages/form/src/adapters/WPMediaImage.tsx:44
1117 1117
 	// Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:10
1118 1118
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:12
1119
-	__( 'Select', 'event_espresso' ),
1119
+	__('Select', 'event_espresso'),
1120 1120
 
1121 1121
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:36
1122 1122
 	/* translators: %d the entry number */
1123
-	__( 'Entry %d', 'event_espresso' ),
1123
+	__('Entry %d', 'event_espresso'),
1124 1124
 
1125 1125
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:52
1126 1126
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityTemplate.tsx:27
1127
-	__( 'Add', 'event_espresso' ),
1127
+	__('Add', 'event_espresso'),
1128 1128
 
1129 1129
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:11
1130 1130
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:17
1131
-	__( 'sold out', 'event_espresso' ),
1131
+	__('sold out', 'event_espresso'),
1132 1132
 
1133 1133
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:14
1134 1134
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:14
1135
-	__( 'expired', 'event_espresso' ),
1135
+	__('expired', 'event_espresso'),
1136 1136
 
1137 1137
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:17
1138
-	__( 'upcoming', 'event_espresso' ),
1138
+	__('upcoming', 'event_espresso'),
1139 1139
 
1140 1140
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:20
1141
-	__( 'active', 'event_espresso' ),
1141
+	__('active', 'event_espresso'),
1142 1142
 
1143 1143
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:23
1144 1144
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:11
1145
-	__( 'trashed', 'event_espresso' ),
1145
+	__('trashed', 'event_espresso'),
1146 1146
 
1147 1147
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:26
1148
-	__( 'cancelled', 'event_espresso' ),
1148
+	__('cancelled', 'event_espresso'),
1149 1149
 
1150 1150
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:29
1151
-	__( 'postponed', 'event_espresso' ),
1151
+	__('postponed', 'event_espresso'),
1152 1152
 
1153 1153
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:33
1154
-	__( 'inactive', 'event_espresso' ),
1154
+	__('inactive', 'event_espresso'),
1155 1155
 
1156 1156
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:20
1157
-	__( 'pending', 'event_espresso' ),
1157
+	__('pending', 'event_espresso'),
1158 1158
 
1159 1159
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:23
1160
-	__( 'on sale', 'event_espresso' ),
1160
+	__('on sale', 'event_espresso'),
1161 1161
 
1162 1162
 	// Reference: packages/predicates/src/registration/statusOptions.ts:14
1163
-	__( 'Declined', 'event_espresso' ),
1163
+	__('Declined', 'event_espresso'),
1164 1164
 
1165 1165
 	// Reference: packages/predicates/src/registration/statusOptions.ts:18
1166
-	__( 'Incomplete', 'event_espresso' ),
1166
+	__('Incomplete', 'event_espresso'),
1167 1167
 
1168 1168
 	// Reference: packages/predicates/src/registration/statusOptions.ts:22
1169
-	__( 'Not Approved', 'event_espresso' ),
1169
+	__('Not Approved', 'event_espresso'),
1170 1170
 
1171 1171
 	// Reference: packages/predicates/src/registration/statusOptions.ts:26
1172
-	__( 'Pending Payment', 'event_espresso' ),
1172
+	__('Pending Payment', 'event_espresso'),
1173 1173
 
1174 1174
 	// Reference: packages/predicates/src/registration/statusOptions.ts:30
1175
-	__( 'Wait List', 'event_espresso' ),
1175
+	__('Wait List', 'event_espresso'),
1176 1176
 
1177 1177
 	// Reference: packages/predicates/src/registration/statusOptions.ts:6
1178
-	__( 'Approved', 'event_espresso' ),
1178
+	__('Approved', 'event_espresso'),
1179 1179
 
1180 1180
 	// Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:8
1181 1181
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:10
1182
-	__( 'Select media', 'event_espresso' ),
1182
+	__('Select media', 'event_espresso'),
1183 1183
 
1184 1184
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/RichTextEditor.tsx:84
1185
-	__( 'Write something…', 'event_espresso' ),
1185
+	__('Write something…', 'event_espresso'),
1186 1186
 
1187 1187
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/Toolbar.tsx:20
1188
-	__( 'RTE Toolbar', 'event_espresso' ),
1188
+	__('RTE Toolbar', 'event_espresso'),
1189 1189
 
1190 1190
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:11
1191
-	__( 'Normal', 'event_espresso' ),
1191
+	__('Normal', 'event_espresso'),
1192 1192
 
1193 1193
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:12
1194
-	__( 'H1', 'event_espresso' ),
1194
+	__('H1', 'event_espresso'),
1195 1195
 
1196 1196
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:13
1197
-	__( 'H2', 'event_espresso' ),
1197
+	__('H2', 'event_espresso'),
1198 1198
 
1199 1199
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:14
1200
-	__( 'H3', 'event_espresso' ),
1200
+	__('H3', 'event_espresso'),
1201 1201
 
1202 1202
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:15
1203
-	__( 'H4', 'event_espresso' ),
1203
+	__('H4', 'event_espresso'),
1204 1204
 
1205 1205
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:16
1206
-	__( 'H5', 'event_espresso' ),
1206
+	__('H5', 'event_espresso'),
1207 1207
 
1208 1208
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:17
1209
-	__( 'H6', 'event_espresso' ),
1209
+	__('H6', 'event_espresso'),
1210 1210
 
1211 1211
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:18
1212
-	__( 'Block quote', 'event_espresso' ),
1212
+	__('Block quote', 'event_espresso'),
1213 1213
 
1214 1214
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:19
1215
-	__( 'Code', 'event_espresso' ),
1215
+	__('Code', 'event_espresso'),
1216 1216
 
1217 1217
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:34
1218
-	__( 'Set color', 'event_espresso' ),
1218
+	__('Set color', 'event_espresso'),
1219 1219
 
1220 1220
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:40
1221
-	__( 'Text color', 'event_espresso' ),
1221
+	__('Text color', 'event_espresso'),
1222 1222
 
1223 1223
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:42
1224
-	__( 'Background color', 'event_espresso' ),
1224
+	__('Background color', 'event_espresso'),
1225 1225
 
1226 1226
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:33
1227
-	__( 'Add image', 'event_espresso' ),
1227
+	__('Add image', 'event_espresso'),
1228 1228
 
1229 1229
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:42
1230
-	__( 'Image URL', 'event_espresso' ),
1230
+	__('Image URL', 'event_espresso'),
1231 1231
 
1232 1232
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:46
1233
-	__( 'Alt text', 'event_espresso' ),
1233
+	__('Alt text', 'event_espresso'),
1234 1234
 
1235 1235
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:47
1236
-	__( 'Width', 'event_espresso' ),
1236
+	__('Width', 'event_espresso'),
1237 1237
 
1238 1238
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:51
1239
-	__( 'Height', 'event_espresso' ),
1239
+	__('Height', 'event_espresso'),
1240 1240
 
1241 1241
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:48
1242
-	__( 'Edit link', 'event_espresso' ),
1242
+	__('Edit link', 'event_espresso'),
1243 1243
 
1244 1244
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:54
1245
-	__( 'URL title', 'event_espresso' ),
1245
+	__('URL title', 'event_espresso'),
1246 1246
 
1247 1247
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:11
1248
-	__( 'Unordered list', 'event_espresso' ),
1248
+	__('Unordered list', 'event_espresso'),
1249 1249
 
1250 1250
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:12
1251
-	__( 'Ordered list', 'event_espresso' ),
1251
+	__('Ordered list', 'event_espresso'),
1252 1252
 
1253 1253
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:13
1254 1254
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:13
1255
-	__( 'Indent', 'event_espresso' ),
1255
+	__('Indent', 'event_espresso'),
1256 1256
 
1257 1257
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:14
1258 1258
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:14
1259
-	__( 'Outdent', 'event_espresso' ),
1259
+	__('Outdent', 'event_espresso'),
1260 1260
 
1261 1261
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:11
1262
-	__( 'Unordered textalign', 'event_espresso' ),
1262
+	__('Unordered textalign', 'event_espresso'),
1263 1263
 
1264 1264
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:12
1265
-	__( 'Ordered textalign', 'event_espresso' ),
1265
+	__('Ordered textalign', 'event_espresso'),
1266 1266
 
1267 1267
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/render/Image/Toolbar.tsx:30
1268
-	__( 'Image toolbar', 'event_espresso' ),
1268
+	__('Image toolbar', 'event_espresso'),
1269 1269
 
1270 1270
 	// Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:60
1271 1271
 	// Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:33
1272
-	__( 'Visual editor', 'event_espresso' ),
1272
+	__('Visual editor', 'event_espresso'),
1273 1273
 
1274 1274
 	// Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:61
1275 1275
 	// Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:34
1276
-	__( 'HTML editor', 'event_espresso' ),
1276
+	__('HTML editor', 'event_espresso'),
1277 1277
 
1278 1278
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:68
1279
-	__( 'Add Media', 'event_espresso' ),
1279
+	__('Add Media', 'event_espresso'),
1280 1280
 
1281 1281
 	// Reference: packages/tpc/src/buttons/AddPriceModifierButton.tsx:14
1282
-	__( 'add new price modifier after this row', 'event_espresso' ),
1282
+	__('add new price modifier after this row', 'event_espresso'),
1283 1283
 
1284 1284
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:14
1285
-	__( 'Delete all prices', 'event_espresso' ),
1285
+	__('Delete all prices', 'event_espresso'),
1286 1286
 
1287 1287
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:27
1288
-	__( 'Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso' ),
1288
+	__('Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso'),
1289 1289
 
1290 1290
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:31
1291
-	__( 'Delete all prices?', 'event_espresso' ),
1291
+	__('Delete all prices?', 'event_espresso'),
1292 1292
 
1293 1293
 	// Reference: packages/tpc/src/buttons/DeletePriceModifierButton.tsx:12
1294
-	__( 'delete price modifier', 'event_espresso' ),
1294
+	__('delete price modifier', 'event_espresso'),
1295 1295
 
1296 1296
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:14
1297
-	__( 'Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso' ),
1297
+	__('Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso'),
1298 1298
 
1299 1299
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:17
1300
-	__( 'Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso' ),
1300
+	__('Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso'),
1301 1301
 
1302 1302
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21
1303
-	__( 'Disable reverse calculate', 'event_espresso' ),
1303
+	__('Disable reverse calculate', 'event_espresso'),
1304 1304
 
1305 1305
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21
1306
-	__( 'Enable reverse calculate', 'event_espresso' ),
1306
+	__('Enable reverse calculate', 'event_espresso'),
1307 1307
 
1308 1308
 	// Reference: packages/tpc/src/buttons/TicketPriceCalculatorButton.tsx:28
1309
-	__( 'ticket price calculator', 'event_espresso' ),
1309
+	__('ticket price calculator', 'event_espresso'),
1310 1310
 
1311 1311
 	// Reference: packages/tpc/src/buttons/taxes/AddDefaultTaxesButton.tsx:9
1312
-	__( 'Add default taxes', 'event_espresso' ),
1312
+	__('Add default taxes', 'event_espresso'),
1313 1313
 
1314 1314
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:10
1315
-	__( 'Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso' ),
1315
+	__('Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso'),
1316 1316
 
1317 1317
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:14
1318
-	__( 'Remove all taxes?', 'event_espresso' ),
1318
+	__('Remove all taxes?', 'event_espresso'),
1319 1319
 
1320 1320
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:7
1321
-	__( 'Remove taxes', 'event_espresso' ),
1321
+	__('Remove taxes', 'event_espresso'),
1322 1322
 
1323 1323
 	// Reference: packages/tpc/src/components/DefaultPricesInfo.tsx:29
1324
-	__( 'Modify default prices.', 'event_espresso' ),
1324
+	__('Modify default prices.', 'event_espresso'),
1325 1325
 
1326 1326
 	// Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:29
1327
-	__( 'New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso' ),
1327
+	__('New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso'),
1328 1328
 
1329 1329
 	// Reference: packages/tpc/src/components/LockedTicketsBanner.tsx:12
1330
-	__( 'Editing of prices is disabled', 'event_espresso' ),
1330
+	__('Editing of prices is disabled', 'event_espresso'),
1331 1331
 
1332 1332
 	// Reference: packages/tpc/src/components/NoPricesBanner/AddDefaultPricesButton.tsx:9
1333
-	__( 'Add default prices', 'event_espresso' ),
1333
+	__('Add default prices', 'event_espresso'),
1334 1334
 
1335 1335
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:13
1336
-	__( 'This Ticket is Currently Free', 'event_espresso' ),
1336
+	__('This Ticket is Currently Free', 'event_espresso'),
1337 1337
 
1338 1338
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:21
1339 1339
 	/* translators: %s default prices */
1340
-	__( 'Click the button below to load your %s into the calculator.', 'event_espresso' ),
1340
+	__('Click the button below to load your %s into the calculator.', 'event_espresso'),
1341 1341
 
1342 1342
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:22
1343
-	__( 'default prices', 'event_espresso' ),
1343
+	__('default prices', 'event_espresso'),
1344 1344
 
1345 1345
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:29
1346
-	__( 'Additional ticket price modifiers can be added or removed.', 'event_espresso' ),
1346
+	__('Additional ticket price modifiers can be added or removed.', 'event_espresso'),
1347 1347
 
1348 1348
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:32
1349
-	__( 'Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso' ),
1349
+	__('Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso'),
1350 1350
 
1351 1351
 	// Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:32
1352 1352
 	/* translators: %s ticket name */
1353
-	__( 'Price Calculator for Ticket: %s', 'event_espresso' ),
1353
+	__('Price Calculator for Ticket: %s', 'event_espresso'),
1354 1354
 
1355 1355
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:48
1356
-	__( 'Total', 'event_espresso' ),
1356
+	__('Total', 'event_espresso'),
1357 1357
 
1358 1358
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:57
1359
-	__( 'ticket total', 'event_espresso' ),
1359
+	__('ticket total', 'event_espresso'),
1360 1360
 
1361 1361
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:29
1362
-	__( 'Order', 'event_espresso' ),
1362
+	__('Order', 'event_espresso'),
1363 1363
 
1364 1364
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:35
1365
-	__( 'Price Type', 'event_espresso' ),
1365
+	__('Price Type', 'event_espresso'),
1366 1366
 
1367 1367
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:41
1368
-	__( 'Label', 'event_espresso' ),
1368
+	__('Label', 'event_espresso'),
1369 1369
 
1370 1370
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:53
1371
-	__( 'Amount', 'event_espresso' ),
1371
+	__('Amount', 'event_espresso'),
1372 1372
 
1373 1373
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:22
1374
-	__( 'Copy ticket', 'event_espresso' ),
1374
+	__('Copy ticket', 'event_espresso'),
1375 1375
 
1376 1376
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:26
1377
-	__( 'Copy and archive this ticket', 'event_espresso' ),
1377
+	__('Copy and archive this ticket', 'event_espresso'),
1378 1378
 
1379 1379
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:29
1380
-	__( 'OK', 'event_espresso' ),
1380
+	__('OK', 'event_espresso'),
1381 1381
 
1382 1382
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:30
1383
-	__( 'amount', 'event_espresso' ),
1383
+	__('amount', 'event_espresso'),
1384 1384
 
1385 1385
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:42
1386
-	__( 'amount…', 'event_espresso' ),
1386
+	__('amount…', 'event_espresso'),
1387 1387
 
1388 1388
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:14
1389
-	__( 'description…', 'event_espresso' ),
1389
+	__('description…', 'event_espresso'),
1390 1390
 
1391 1391
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:9
1392
-	__( 'price description', 'event_espresso' ),
1392
+	__('price description', 'event_espresso'),
1393 1393
 
1394 1394
 	// Reference: packages/tpc/src/inputs/PriceIdInput.tsx:5
1395
-	__( 'price id', 'event_espresso' ),
1395
+	__('price id', 'event_espresso'),
1396 1396
 
1397 1397
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:13
1398
-	__( 'label…', 'event_espresso' ),
1398
+	__('label…', 'event_espresso'),
1399 1399
 
1400 1400
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:8
1401
-	__( 'price name', 'event_espresso' ),
1401
+	__('price name', 'event_espresso'),
1402 1402
 
1403 1403
 	// Reference: packages/tpc/src/inputs/PriceOrderInput.tsx:14
1404
-	__( 'price order', 'event_espresso' ),
1404
+	__('price order', 'event_espresso'),
1405 1405
 
1406 1406
 	// Reference: packages/tpc/src/inputs/PriceTypeInput.tsx:19
1407
-	__( 'price type', 'event_espresso' ),
1407
+	__('price type', 'event_espresso'),
1408 1408
 
1409 1409
 	// Reference: packages/tpc/src/utils/constants.ts:8
1410
-	__( 'Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then trash the old tickets.', 'event_espresso' ),
1410
+	__('Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then trash the old tickets.', 'event_espresso'),
1411 1411
 
1412 1412
 	// Reference: packages/ui-components/src/ActiveFilters/ActiveFilters.tsx:8
1413
-	__( 'active filters:', 'event_espresso' ),
1413
+	__('active filters:', 'event_espresso'),
1414 1414
 
1415 1415
 	// Reference: packages/ui-components/src/ActiveFilters/FilterTag/index.tsx:15
1416 1416
 	/* translators: %s filter name */
1417
-	__( 'remove filter - %s', 'event_espresso' ),
1417
+	__('remove filter - %s', 'event_espresso'),
1418 1418
 
1419 1419
 	// Reference: packages/ui-components/src/CalendarDateRange/CalendarDateRange.tsx:37
1420
-	__( 'to', 'event_espresso' ),
1420
+	__('to', 'event_espresso'),
1421 1421
 
1422 1422
 	// Reference: packages/ui-components/src/CalendarPageDate/CalendarPageDate.tsx:54
1423
-	__( 'TO', 'event_espresso' ),
1423
+	__('TO', 'event_espresso'),
1424 1424
 
1425 1425
 	// Reference: packages/ui-components/src/ColorPicker/ColorPicker.tsx:60
1426
-	__( 'Custom color', 'event_espresso' ),
1426
+	__('Custom color', 'event_espresso'),
1427 1427
 
1428 1428
 	// Reference: packages/ui-components/src/ColorPicker/Swatch.tsx:23
1429 1429
 	/* translators: color name */
1430
-	__( 'Color: %s', 'event_espresso' ),
1430
+	__('Color: %s', 'event_espresso'),
1431 1431
 
1432 1432
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:13
1433
-	__( 'Cyan bluish gray', 'event_espresso' ),
1433
+	__('Cyan bluish gray', 'event_espresso'),
1434 1434
 
1435 1435
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:17
1436
-	__( 'White', 'event_espresso' ),
1436
+	__('White', 'event_espresso'),
1437 1437
 
1438 1438
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:21
1439
-	__( 'Pale pink', 'event_espresso' ),
1439
+	__('Pale pink', 'event_espresso'),
1440 1440
 
1441 1441
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:25
1442
-	__( 'Vivid red', 'event_espresso' ),
1442
+	__('Vivid red', 'event_espresso'),
1443 1443
 
1444 1444
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:29
1445
-	__( 'Luminous vivid orange', 'event_espresso' ),
1445
+	__('Luminous vivid orange', 'event_espresso'),
1446 1446
 
1447 1447
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:33
1448
-	__( 'Luminous vivid amber', 'event_espresso' ),
1448
+	__('Luminous vivid amber', 'event_espresso'),
1449 1449
 
1450 1450
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:37
1451
-	__( 'Light green cyan', 'event_espresso' ),
1451
+	__('Light green cyan', 'event_espresso'),
1452 1452
 
1453 1453
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:41
1454
-	__( 'Vivid green cyan', 'event_espresso' ),
1454
+	__('Vivid green cyan', 'event_espresso'),
1455 1455
 
1456 1456
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:45
1457
-	__( 'Pale cyan blue', 'event_espresso' ),
1457
+	__('Pale cyan blue', 'event_espresso'),
1458 1458
 
1459 1459
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:49
1460
-	__( 'Vivid cyan blue', 'event_espresso' ),
1460
+	__('Vivid cyan blue', 'event_espresso'),
1461 1461
 
1462 1462
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:53
1463
-	__( 'Vivid purple', 'event_espresso' ),
1463
+	__('Vivid purple', 'event_espresso'),
1464 1464
 
1465 1465
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:9
1466
-	__( 'Black', 'event_espresso' ),
1466
+	__('Black', 'event_espresso'),
1467 1467
 
1468 1468
 	// Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:7
1469 1469
 	// Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:22
1470
-	__( 'Are you sure you want to close this?', 'event_espresso' ),
1470
+	__('Are you sure you want to close this?', 'event_espresso'),
1471 1471
 
1472 1472
 	// Reference: packages/ui-components/src/Confirm/ConfirmDelete.tsx:7
1473
-	__( 'Are you sure you want to delete this?', 'event_espresso' ),
1473
+	__('Are you sure you want to delete this?', 'event_espresso'),
1474 1474
 
1475 1475
 	// Reference: packages/ui-components/src/Confirm/useConfirmWithButton.tsx:10
1476
-	__( 'Please confirm this action.', 'event_espresso' ),
1476
+	__('Please confirm this action.', 'event_espresso'),
1477 1477
 
1478 1478
 	// Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:32
1479
-	__( 'No', 'event_espresso' ),
1479
+	__('No', 'event_espresso'),
1480 1480
 
1481 1481
 	// Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:33
1482
-	__( 'Yes', 'event_espresso' ),
1482
+	__('Yes', 'event_espresso'),
1483 1483
 
1484 1484
 	// Reference: packages/ui-components/src/CurrencyDisplay/CurrencyDisplay.tsx:34
1485
-	__( 'free', 'event_espresso' ),
1485
+	__('free', 'event_espresso'),
1486 1486
 
1487 1487
 	// Reference: packages/ui-components/src/DateTimeRangePicker/DateTimeRangePicker.tsx:117
1488 1488
 	// Reference: packages/ui-components/src/Popover/PopoverForm/PopoverForm.tsx:43
1489
-	__( 'save', 'event_espresso' ),
1489
+	__('save', 'event_espresso'),
1490 1490
 
1491 1491
 	// Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36
1492
-	__( 'Hide Debug Info', 'event_espresso' ),
1492
+	__('Hide Debug Info', 'event_espresso'),
1493 1493
 
1494 1494
 	// Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36
1495
-	__( 'Show Debug Info', 'event_espresso' ),
1495
+	__('Show Debug Info', 'event_espresso'),
1496 1496
 
1497 1497
 	// Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:49
1498
-	__( 'Edit Start and End Dates and Times', 'event_espresso' ),
1498
+	__('Edit Start and End Dates and Times', 'event_espresso'),
1499 1499
 
1500 1500
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Copy.tsx:8
1501
-	__( 'copy', 'event_espresso' ),
1501
+	__('copy', 'event_espresso'),
1502 1502
 
1503 1503
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Edit.tsx:8
1504
-	__( 'edit', 'event_espresso' ),
1504
+	__('edit', 'event_espresso'),
1505 1505
 
1506 1506
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Trash.tsx:8
1507
-	__( 'trash', 'event_espresso' ),
1507
+	__('trash', 'event_espresso'),
1508 1508
 
1509 1509
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Untrash.tsx:8
1510
-	__( 'untrash', 'event_espresso' ),
1510
+	__('untrash', 'event_espresso'),
1511 1511
 
1512 1512
 	// Reference: packages/ui-components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:37
1513
-	__( 'view approved registrations for this date.', 'event_espresso' ),
1513
+	__('view approved registrations for this date.', 'event_espresso'),
1514 1514
 
1515 1515
 	// Reference: packages/ui-components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:38
1516
-	__( 'view approved registrations for this ticket.', 'event_espresso' ),
1516
+	__('view approved registrations for this ticket.', 'event_espresso'),
1517 1517
 
1518 1518
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/CardViewFilterButton.tsx:21
1519
-	__( 'card view', 'event_espresso' ),
1519
+	__('card view', 'event_espresso'),
1520 1520
 
1521 1521
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/TableViewFilterButton.tsx:20
1522
-	__( 'table view', 'event_espresso' ),
1522
+	__('table view', 'event_espresso'),
1523 1523
 
1524 1524
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8
1525
-	__( 'hide bulk actions', 'event_espresso' ),
1525
+	__('hide bulk actions', 'event_espresso'),
1526 1526
 
1527 1527
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8
1528
-	__( 'show bulk actions', 'event_espresso' ),
1528
+	__('show bulk actions', 'event_espresso'),
1529 1529
 
1530 1530
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9
1531
-	__( 'hide filters', 'event_espresso' ),
1531
+	__('hide filters', 'event_espresso'),
1532 1532
 
1533 1533
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9
1534
-	__( 'show filters', 'event_espresso' ),
1534
+	__('show filters', 'event_espresso'),
1535 1535
 
1536 1536
 	// Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26
1537
-	__( 'hide legend', 'event_espresso' ),
1537
+	__('hide legend', 'event_espresso'),
1538 1538
 
1539 1539
 	// Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26
1540
-	__( 'show legend', 'event_espresso' ),
1540
+	__('show legend', 'event_espresso'),
1541 1541
 
1542 1542
 	// Reference: packages/ui-components/src/LoadingNotice/LoadingNotice.tsx:11
1543
-	__( 'loading…', 'event_espresso' ),
1543
+	__('loading…', 'event_espresso'),
1544 1544
 
1545 1545
 	// Reference: packages/ui-components/src/Modal/Modal.tsx:58
1546
-	__( 'close modal', 'event_espresso' ),
1546
+	__('close modal', 'event_espresso'),
1547 1547
 
1548 1548
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:10
1549
-	__( 'jump to previous', 'event_espresso' ),
1549
+	__('jump to previous', 'event_espresso'),
1550 1550
 
1551 1551
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:11
1552
-	__( 'jump to next', 'event_espresso' ),
1552
+	__('jump to next', 'event_espresso'),
1553 1553
 
1554 1554
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:12
1555
-	__( 'page', 'event_espresso' ),
1555
+	__('page', 'event_espresso'),
1556 1556
 
1557 1557
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:8
1558
-	__( 'previous', 'event_espresso' ),
1558
+	__('previous', 'event_espresso'),
1559 1559
 
1560 1560
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:9
1561
-	__( 'next', 'event_espresso' ),
1561
+	__('next', 'event_espresso'),
1562 1562
 
1563 1563
 	// Reference: packages/ui-components/src/Pagination/PerPage.tsx:37
1564
-	__( 'items per page', 'event_espresso' ),
1564
+	__('items per page', 'event_espresso'),
1565 1565
 
1566 1566
 	// Reference: packages/ui-components/src/Pagination/constants.ts:10
1567 1567
 	/* translators: %s is per page value */
1568
-	__( '%s / page', 'event_espresso' ),
1568
+	__('%s / page', 'event_espresso'),
1569 1569
 
1570 1570
 	// Reference: packages/ui-components/src/Pagination/constants.ts:13
1571
-	__( 'Next Page', 'event_espresso' ),
1571
+	__('Next Page', 'event_espresso'),
1572 1572
 
1573 1573
 	// Reference: packages/ui-components/src/Pagination/constants.ts:14
1574
-	__( 'Previous Page', 'event_espresso' ),
1574
+	__('Previous Page', 'event_espresso'),
1575 1575
 
1576 1576
 	// Reference: packages/ui-components/src/PercentSign/index.tsx:10
1577
-	__( '%', 'event_espresso' ),
1577
+	__('%', 'event_espresso'),
1578 1578
 
1579 1579
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:23
1580
-	__( 'Select an existing one to use as a template.', 'event_espresso' ),
1580
+	__('Select an existing one to use as a template.', 'event_espresso'),
1581 1581
 
1582 1582
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:27
1583
-	__( 'or', 'event_espresso' ),
1583
+	__('or', 'event_espresso'),
1584 1584
 
1585 1585
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:30
1586
-	__( 'Add new and insert details manually', 'event_espresso' ),
1586
+	__('Add new and insert details manually', 'event_espresso'),
1587 1587
 
1588 1588
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:34
1589
-	__( 'Add New', 'event_espresso' ),
1589
+	__('Add New', 'event_espresso'),
1590 1590
 
1591 1591
 	// Reference: packages/ui-components/src/Stepper/buttons/Next.tsx:8
1592
-	__( 'Next', 'event_espresso' ),
1592
+	__('Next', 'event_espresso'),
1593 1593
 
1594 1594
 	// Reference: packages/ui-components/src/Stepper/buttons/Previous.tsx:8
1595
-	__( 'Previous', 'event_espresso' ),
1595
+	__('Previous', 'event_espresso'),
1596 1596
 
1597 1597
 	// Reference: packages/ui-components/src/Steps/Steps.tsx:31
1598
-	__( 'Steps', 'event_espresso' ),
1598
+	__('Steps', 'event_espresso'),
1599 1599
 
1600 1600
 	// Reference: packages/ui-components/src/TabbableText/index.tsx:19
1601
-	__( 'Click to edit…', 'event_espresso' ),
1601
+	__('Click to edit…', 'event_espresso'),
1602 1602
 
1603 1603
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:14
1604
-	__( 'The Website\'s Time Zone', 'event_espresso' ),
1604
+	__('The Website\'s Time Zone', 'event_espresso'),
1605 1605
 
1606 1606
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:19
1607
-	__( 'UTC (Greenwich Mean Time)', 'event_espresso' ),
1607
+	__('UTC (Greenwich Mean Time)', 'event_espresso'),
1608 1608
 
1609 1609
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:9
1610
-	__( 'Your Local Time Zone', 'event_espresso' ),
1610
+	__('Your Local Time Zone', 'event_espresso'),
1611 1611
 
1612 1612
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:27
1613
-	__( 'click for timezone information', 'event_espresso' ),
1613
+	__('click for timezone information', 'event_espresso'),
1614 1614
 
1615 1615
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:32
1616
-	__( 'This Date Converted To:', 'event_espresso' ),
1616
+	__('This Date Converted To:', 'event_espresso'),
1617 1617
 
1618 1618
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:51
1619
-	__( 'select all', 'event_espresso' ),
1619
+	__('select all', 'event_espresso'),
1620 1620
 
1621 1621
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:54
1622
-	__( 'apply', 'event_espresso' )
1622
+	__('apply', 'event_espresso')
1623 1623
 );
1624 1624
 /* THIS IS THE END OF THE GENERATED FILE */
Please login to merge, or discard this patch.
core/services/routing/RouteHandler.php 1 patch
Indentation   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -21,172 +21,172 @@
 block discarded – undo
21 21
 class RouteHandler
22 22
 {
23 23
 
24
-    /**
25
-     * @var JsonDataNodeHandler $data_node_handler
26
-     */
27
-    private $data_node_handler;
28
-
29
-    /**
30
-     * @var LoaderInterface $loader
31
-     */
32
-    private $loader;
33
-
34
-    /**
35
-     * @var RequestInterface $request
36
-     */
37
-    protected $request;
38
-
39
-    /**
40
-     * @var RouteCollection $routes
41
-     */
42
-    private $routes;
43
-
44
-    /**
45
-     * @var boolean $print_data_nodes
46
-     */
47
-    private $print_data_nodes = true;
48
-
49
-    /**
50
-     * @var string $route_request_type
51
-     */
52
-    protected $route_request_type = '';
53
-
54
-
55
-    /**
56
-     * RouteHandler constructor.
57
-     *
58
-     * @param JsonDataNodeHandler $data_node_handler
59
-     * @param LoaderInterface     $loader
60
-     * @param RequestInterface    $request
61
-     * @param RouteCollection     $routes
62
-     */
63
-    public function __construct(
64
-        JsonDataNodeHandler $data_node_handler,
65
-        LoaderInterface $loader,
66
-        RequestInterface $request,
67
-        RouteCollection $routes
68
-    ) {
69
-        $this->data_node_handler = $data_node_handler;
70
-        $this->loader            = $loader;
71
-        $this->request           = $request;
72
-        $this->routes            = $routes;
73
-    }
74
-
75
-
76
-    /**
77
-     * @param string $fqcn   Fully Qualified Class Name for Route
78
-     * @param bool   $handle if true [default] will immediately call RouteInterface::handleRequest() after adding
79
-     * @throws Exception
80
-     */
81
-    public function addRoute(string $fqcn, bool $handle = true)
82
-    {
83
-        try {
84
-            $route = $this->loader->getShared($fqcn);
85
-            $this->validateRoute($route, $fqcn);
86
-            $this->routes->add($route);
87
-            $this->handle($route, $handle);
88
-        } catch (Exception $exception) {
89
-            new ExceptionStackTraceDisplay(
90
-                new DomainException(
91
-                    sprintf(
92
-                        esc_html__(
93
-                            'The following error occurred while trying to handle the "%1$s" route:%2$s%3$s',
94
-                            'event_espresso'
95
-                        ),
96
-                        $fqcn,
97
-                        '<br />',
98
-                        $exception->getMessage()
99
-                    )
100
-                )
101
-            );
102
-        }
103
-    }
104
-
105
-
106
-    /**
107
-     * @return string
108
-     */
109
-    public function getRouteRequestType(): string
110
-    {
111
-        return $this->route_request_type;
112
-    }
113
-
114
-
115
-    /**
116
-     * @param string $route_request_type
117
-     */
118
-    public function setRouteRequestType(string $route_request_type = '')
119
-    {
120
-        $this->route_request_type = ! empty($route_request_type) ? $route_request_type : $this->route_request_type;
121
-    }
122
-
123
-
124
-    /**
125
-     * @param RouteInterface $route
126
-     * @param bool           $handle if true [default] will immediately call RouteInterface::handleRequest()
127
-     */
128
-    public function handle(RouteInterface $route, bool $handle = true)
129
-    {
130
-        if ($handle && $route->isNotHandled()) {
131
-            $route->handleRequest();
132
-            if ($route instanceof PrimaryRoute) {
133
-                $this->setRouteRequestType($route->getRouteRequestType());
134
-            }
135
-            $data_node = $route->dataNode();
136
-            if ($data_node instanceof JsonDataNode) {
137
-                $this->data_node_handler->addDataNode($data_node);
138
-                $this->printDataNodes();
139
-            }
140
-        }
141
-    }
142
-
143
-
144
-    /**
145
-     * calls RouteInterface::handleRequest() on all Routes that
146
-     *      - match current request
147
-     *      - have yet to be handled
148
-     *
149
-     * @return void
150
-     */
151
-    public function handleRoutesForCurrentRequest()
152
-    {
153
-        $this->routes->handleRoutesForCurrentRequest();
154
-    }
155
-
156
-
157
-    /**
158
-     * @return void
159
-     */
160
-    private function printDataNodes()
161
-    {
162
-        if ($this->print_data_nodes) {
163
-            add_action('admin_footer', [$this->data_node_handler, 'printDataNode'], 0);
164
-            add_action('wp_footer', [$this->data_node_handler, 'printDataNode'], 0);
165
-            $this->print_data_nodes = false;
166
-        }
167
-    }
168
-
169
-
170
-    /**
171
-     * @param RouteInterface $route
172
-     * @param string         $fqcn
173
-     */
174
-    private function validateRoute(RouteInterface $route, string $fqcn)
175
-    {
176
-        if (! $route instanceof RouteInterface) {
177
-            throw new InvalidClassException(
178
-                sprintf(
179
-                    /*
24
+	/**
25
+	 * @var JsonDataNodeHandler $data_node_handler
26
+	 */
27
+	private $data_node_handler;
28
+
29
+	/**
30
+	 * @var LoaderInterface $loader
31
+	 */
32
+	private $loader;
33
+
34
+	/**
35
+	 * @var RequestInterface $request
36
+	 */
37
+	protected $request;
38
+
39
+	/**
40
+	 * @var RouteCollection $routes
41
+	 */
42
+	private $routes;
43
+
44
+	/**
45
+	 * @var boolean $print_data_nodes
46
+	 */
47
+	private $print_data_nodes = true;
48
+
49
+	/**
50
+	 * @var string $route_request_type
51
+	 */
52
+	protected $route_request_type = '';
53
+
54
+
55
+	/**
56
+	 * RouteHandler constructor.
57
+	 *
58
+	 * @param JsonDataNodeHandler $data_node_handler
59
+	 * @param LoaderInterface     $loader
60
+	 * @param RequestInterface    $request
61
+	 * @param RouteCollection     $routes
62
+	 */
63
+	public function __construct(
64
+		JsonDataNodeHandler $data_node_handler,
65
+		LoaderInterface $loader,
66
+		RequestInterface $request,
67
+		RouteCollection $routes
68
+	) {
69
+		$this->data_node_handler = $data_node_handler;
70
+		$this->loader            = $loader;
71
+		$this->request           = $request;
72
+		$this->routes            = $routes;
73
+	}
74
+
75
+
76
+	/**
77
+	 * @param string $fqcn   Fully Qualified Class Name for Route
78
+	 * @param bool   $handle if true [default] will immediately call RouteInterface::handleRequest() after adding
79
+	 * @throws Exception
80
+	 */
81
+	public function addRoute(string $fqcn, bool $handle = true)
82
+	{
83
+		try {
84
+			$route = $this->loader->getShared($fqcn);
85
+			$this->validateRoute($route, $fqcn);
86
+			$this->routes->add($route);
87
+			$this->handle($route, $handle);
88
+		} catch (Exception $exception) {
89
+			new ExceptionStackTraceDisplay(
90
+				new DomainException(
91
+					sprintf(
92
+						esc_html__(
93
+							'The following error occurred while trying to handle the "%1$s" route:%2$s%3$s',
94
+							'event_espresso'
95
+						),
96
+						$fqcn,
97
+						'<br />',
98
+						$exception->getMessage()
99
+					)
100
+				)
101
+			);
102
+		}
103
+	}
104
+
105
+
106
+	/**
107
+	 * @return string
108
+	 */
109
+	public function getRouteRequestType(): string
110
+	{
111
+		return $this->route_request_type;
112
+	}
113
+
114
+
115
+	/**
116
+	 * @param string $route_request_type
117
+	 */
118
+	public function setRouteRequestType(string $route_request_type = '')
119
+	{
120
+		$this->route_request_type = ! empty($route_request_type) ? $route_request_type : $this->route_request_type;
121
+	}
122
+
123
+
124
+	/**
125
+	 * @param RouteInterface $route
126
+	 * @param bool           $handle if true [default] will immediately call RouteInterface::handleRequest()
127
+	 */
128
+	public function handle(RouteInterface $route, bool $handle = true)
129
+	{
130
+		if ($handle && $route->isNotHandled()) {
131
+			$route->handleRequest();
132
+			if ($route instanceof PrimaryRoute) {
133
+				$this->setRouteRequestType($route->getRouteRequestType());
134
+			}
135
+			$data_node = $route->dataNode();
136
+			if ($data_node instanceof JsonDataNode) {
137
+				$this->data_node_handler->addDataNode($data_node);
138
+				$this->printDataNodes();
139
+			}
140
+		}
141
+	}
142
+
143
+
144
+	/**
145
+	 * calls RouteInterface::handleRequest() on all Routes that
146
+	 *      - match current request
147
+	 *      - have yet to be handled
148
+	 *
149
+	 * @return void
150
+	 */
151
+	public function handleRoutesForCurrentRequest()
152
+	{
153
+		$this->routes->handleRoutesForCurrentRequest();
154
+	}
155
+
156
+
157
+	/**
158
+	 * @return void
159
+	 */
160
+	private function printDataNodes()
161
+	{
162
+		if ($this->print_data_nodes) {
163
+			add_action('admin_footer', [$this->data_node_handler, 'printDataNode'], 0);
164
+			add_action('wp_footer', [$this->data_node_handler, 'printDataNode'], 0);
165
+			$this->print_data_nodes = false;
166
+		}
167
+	}
168
+
169
+
170
+	/**
171
+	 * @param RouteInterface $route
172
+	 * @param string         $fqcn
173
+	 */
174
+	private function validateRoute(RouteInterface $route, string $fqcn)
175
+	{
176
+		if (! $route instanceof RouteInterface) {
177
+			throw new InvalidClassException(
178
+				sprintf(
179
+					/*
180 180
                      * translators:
181 181
                      * The supplied FQCN (Fully\Qualified\Class\Name) must be an instance of RouteInterface.
182 182
                      */
183
-                    esc_html__(
184
-                        'The supplied FQCN (%1$s) must be an instance of RouteInterface.',
185
-                        'event_espresso'
186
-                    ),
187
-                    $fqcn
188
-                )
189
-            );
190
-        }
191
-    }
183
+					esc_html__(
184
+						'The supplied FQCN (%1$s) must be an instance of RouteInterface.',
185
+						'event_espresso'
186
+					),
187
+					$fqcn
188
+				)
189
+			);
190
+		}
191
+	}
192 192
 }
Please login to merge, or discard this patch.
core/services/request/Request.php 2 patches
Indentation   +701 added lines, -701 removed lines patch added patch discarded remove patch
@@ -17,705 +17,705 @@
 block discarded – undo
17 17
 class Request implements InterminableInterface, RequestInterface, ReservedInstanceInterface
18 18
 {
19 19
 
20
-    /**
21
-     * $_GET parameters
22
-     *
23
-     * @var array $get
24
-     */
25
-    private $get;
26
-
27
-    /**
28
-     * $_POST parameters
29
-     *
30
-     * @var array $post
31
-     */
32
-    private $post;
33
-
34
-    /**
35
-     * $_COOKIE parameters
36
-     *
37
-     * @var array $cookie
38
-     */
39
-    private $cookie;
40
-
41
-    /**
42
-     * $_SERVER parameters
43
-     *
44
-     * @var array $server
45
-     */
46
-    private $server;
47
-
48
-    /**
49
-     * $_FILES parameters
50
-     *
51
-     * @var array $files
52
-     */
53
-    private $files;
54
-
55
-    /**
56
-     * $_REQUEST parameters
57
-     *
58
-     * @var array $request
59
-     */
60
-    private $request;
61
-
62
-    /**
63
-     * @var RequestTypeContextCheckerInterface
64
-     */
65
-    private $request_type;
66
-
67
-    /**
68
-     * IP address for request
69
-     *
70
-     * @var string $ip_address
71
-     */
72
-    private $ip_address;
73
-
74
-    /**
75
-     * @var string $user_agent
76
-     */
77
-    private $user_agent;
78
-
79
-    /**
80
-     * true if current user appears to be some kind of bot
81
-     *
82
-     * @var bool $is_bot
83
-     */
84
-    private $is_bot;
85
-
86
-
87
-    /**
88
-     * @param array $get
89
-     * @param array $post
90
-     * @param array $cookie
91
-     * @param array $server
92
-     * @param array $files
93
-     */
94
-    public function __construct(array $get, array $post, array $cookie, array $server, array $files = array())
95
-    {
96
-        // grab request vars
97
-        $this->get = $get;
98
-        $this->post = $post;
99
-        $this->cookie = $cookie;
100
-        $this->server = $server;
101
-        $this->files = $files;
102
-        $this->request = array_merge($this->get, $this->post);
103
-        $this->ip_address = $this->visitorIp();
104
-    }
105
-
106
-
107
-    /**
108
-     * @param RequestTypeContextCheckerInterface $type
109
-     */
110
-    public function setRequestTypeContextChecker(RequestTypeContextCheckerInterface $type)
111
-    {
112
-        $this->request_type = $type;
113
-    }
114
-
115
-
116
-    /**
117
-     * @return array
118
-     */
119
-    public function getParams()
120
-    {
121
-        return $this->get;
122
-    }
123
-
124
-
125
-    /**
126
-     * @return array
127
-     */
128
-    public function postParams()
129
-    {
130
-        return $this->post;
131
-    }
132
-
133
-
134
-    /**
135
-     * @return array
136
-     */
137
-    public function cookieParams()
138
-    {
139
-        return $this->cookie;
140
-    }
141
-
142
-
143
-    /**
144
-     * @return array
145
-     */
146
-    public function serverParams()
147
-    {
148
-        return $this->server;
149
-    }
150
-
151
-
152
-    /**
153
-     * @return array
154
-     */
155
-    public function filesParams()
156
-    {
157
-        return $this->files;
158
-    }
159
-
160
-
161
-    /**
162
-     * returns contents of $_REQUEST
163
-     *
164
-     * @return array
165
-     */
166
-    public function requestParams()
167
-    {
168
-        return $this->request;
169
-    }
170
-
171
-
172
-    /**
173
-     * @param      $key
174
-     * @param      $value
175
-     * @param bool $override_ee
176
-     * @return    void
177
-     */
178
-    public function setRequestParam($key, $value, $override_ee = false)
179
-    {
180
-        // don't allow "ee" to be overwritten unless explicitly instructed to do so
181
-        if ($key !== 'ee' || empty($this->request['ee']) || $override_ee) {
182
-            $this->request[ $key ] = $value;
183
-        }
184
-    }
185
-
186
-
187
-    /**
188
-     * returns   the value for a request param if the given key exists
189
-     *
190
-     * @param       $key
191
-     * @param null  $default
192
-     * @return mixed
193
-     */
194
-    public function getRequestParam($key, $default = null)
195
-    {
196
-        return $this->requestParameterDrillDown($key, $default, 'get');
197
-    }
198
-
199
-
200
-    /**
201
-     * check if param exists
202
-     *
203
-     * @param       $key
204
-     * @return bool
205
-     */
206
-    public function requestParamIsSet($key)
207
-    {
208
-        return $this->requestParameterDrillDown($key);
209
-    }
210
-
211
-
212
-    /**
213
-     * check if a request parameter exists whose key that matches the supplied wildcard pattern
214
-     * and return the value for the first match found
215
-     * wildcards can be either of the following:
216
-     *      ? to represent a single character of any type
217
-     *      * to represent one or more characters of any type
218
-     *
219
-     * @param string     $pattern
220
-     * @param null|mixed $default
221
-     * @return mixed
222
-     */
223
-    public function getMatch($pattern, $default = null)
224
-    {
225
-        return $this->requestParameterDrillDown($pattern, $default, 'match');
226
-    }
227
-
228
-
229
-    /**
230
-     * check if a request parameter exists whose key matches the supplied wildcard pattern
231
-     * wildcards can be either of the following:
232
-     *      ? to represent a single character of any type
233
-     *      * to represent one or more characters of any type
234
-     * returns true if a match is found or false if not
235
-     *
236
-     * @param string $pattern
237
-     * @return bool
238
-     */
239
-    public function matches($pattern)
240
-    {
241
-        return $this->requestParameterDrillDown($pattern, null, 'match') !== null;
242
-    }
243
-
244
-
245
-    /**
246
-     * @see https://stackoverflow.com/questions/6163055/php-string-matching-with-wildcard
247
-     * @param string $pattern               A string including wildcards to be converted to a regex pattern
248
-     *                                      and used to search through the current request's parameter keys
249
-     * @param array  $request_params        The array of request parameters to search through
250
-     * @param mixed  $default               [optional] The value to be returned if no match is found.
251
-     *                                      Default is null
252
-     * @param string $return                [optional] Controls what kind of value is returned.
253
-     *                                      Options are:
254
-     *                                      'bool' will return true or false if match is found or not
255
-     *                                      'key' will return the first key found that matches the supplied pattern
256
-     *                                      'value' will return the value for the first request parameter
257
-     *                                      whose key matches the supplied pattern
258
-     *                                      Default is 'value'
259
-     * @return boolean|string
260
-     */
261
-    private function match($pattern, array $request_params, $default = null, $return = 'value')
262
-    {
263
-        $return = in_array($return, array('bool', 'key', 'value'), true)
264
-            ? $return
265
-            : 'is_set';
266
-        // replace wildcard chars with regex chars
267
-        $pattern = str_replace(
268
-            array("\*", "\?"),
269
-            array('.*', '.'),
270
-            preg_quote($pattern, '/')
271
-        );
272
-        foreach ($request_params as $key => $request_param) {
273
-            if (preg_match('/^' . $pattern . '$/is', $key)) {
274
-                // return value for request param
275
-                if ($return === 'value') {
276
-                    return $request_params[ $key ];
277
-                }
278
-                // or actual key or true just to indicate it was found
279
-                return $return === 'key' ? $key : true;
280
-            }
281
-        }
282
-        // match not found so return default value or false
283
-        return $return === 'value' ? $default : false;
284
-    }
285
-
286
-
287
-    /**
288
-     * the supplied key can be a simple string to represent a "top-level" request parameter
289
-     * or represent a key for a request parameter that is nested deeper within the request parameter array,
290
-     * by using square brackets to surround keys for deeper array elements.
291
-     * For example :
292
-     * if the supplied $key was: "first[second][third]"
293
-     * then this will attempt to drill down into the request parameter array to find a value.
294
-     * Given the following request parameters:
295
-     *  array(
296
-     *      'first' => array(
297
-     *          'second' => array(
298
-     *              'third' => 'has a value'
299
-     *          )
300
-     *      )
301
-     *  )
302
-     * would return true if default parameters were set
303
-     *
304
-     * @param string $callback
305
-     * @param        $key
306
-     * @param null   $default
307
-     * @param array  $request_params
308
-     * @return bool|mixed|null
309
-     */
310
-    private function requestParameterDrillDown(
311
-        $key,
312
-        $default = null,
313
-        $callback = 'is_set',
314
-        array $request_params = array()
315
-    ) {
316
-        $callback = in_array($callback, array('is_set', 'get', 'match'), true)
317
-            ? $callback
318
-            : 'is_set';
319
-        $request_params = ! empty($request_params)
320
-            ? $request_params
321
-            : $this->request;
322
-        // does incoming key represent an array like 'first[second][third]'  ?
323
-        if (strpos($key, '[') !== false) {
324
-            // turn it into an actual array
325
-            $key = str_replace(']', '', $key);
326
-            $keys = explode('[', $key);
327
-            $key = array_shift($keys);
328
-            if ($callback === 'match') {
329
-                $real_key = $this->match($key, $request_params, $default, 'key');
330
-                $key = $real_key ? $real_key : $key;
331
-            }
332
-            // check if top level key exists
333
-            if (isset($request_params[ $key ])) {
334
-                // build a new key to pass along like: 'second[third]'
335
-                // or just 'second' depending on depth of keys
336
-                $key_string = array_shift($keys);
337
-                if (! empty($keys)) {
338
-                    $key_string .= '[' . implode('][', $keys) . ']';
339
-                }
340
-                return $this->requestParameterDrillDown(
341
-                    $key_string,
342
-                    $default,
343
-                    $callback,
344
-                    $request_params[ $key ]
345
-                );
346
-            }
347
-        }
348
-        if ($callback === 'is_set') {
349
-            return isset($request_params[ $key ]);
350
-        }
351
-        if ($callback === 'match') {
352
-            return $this->match($key, $request_params, $default);
353
-        }
354
-        return isset($request_params[ $key ])
355
-            ? $request_params[ $key ]
356
-            : $default;
357
-    }
358
-
359
-
360
-    /**
361
-     * remove param
362
-     *
363
-     * @param      $key
364
-     * @param bool $unset_from_global_too
365
-     */
366
-    public function unSetRequestParam($key, $unset_from_global_too = false)
367
-    {
368
-        // because unset may not actually remove var
369
-        $this->request[ $key ] = null;
370
-        unset($this->request[ $key ]);
371
-        if ($unset_from_global_too) {
372
-            unset($_REQUEST[ $key ]);
373
-        }
374
-    }
375
-
376
-
377
-    /**
378
-     * remove params
379
-     *
380
-     * @param array $keys
381
-     * @param bool  $unset_from_global_too
382
-     */
383
-    public function unSetRequestParams(array $keys, $unset_from_global_too = false)
384
-    {
385
-        foreach ($keys as $key) {
386
-            $this->unSetRequestParam($key, $unset_from_global_too);
387
-        }
388
-    }
389
-
390
-
391
-    /**
392
-     * @return string
393
-     */
394
-    public function ipAddress()
395
-    {
396
-        return $this->ip_address;
397
-    }
398
-
399
-
400
-    /**
401
-     * attempt to get IP address of current visitor from server
402
-     * plz see: http://stackoverflow.com/a/2031935/1475279
403
-     *
404
-     * @access public
405
-     * @return string
406
-     */
407
-    private function visitorIp()
408
-    {
409
-        $visitor_ip = '0.0.0.0';
410
-        $server_keys = array(
411
-            'HTTP_CLIENT_IP',
412
-            'HTTP_X_FORWARDED_FOR',
413
-            'HTTP_X_FORWARDED',
414
-            'HTTP_X_CLUSTER_CLIENT_IP',
415
-            'HTTP_FORWARDED_FOR',
416
-            'HTTP_FORWARDED',
417
-            'REMOTE_ADDR',
418
-        );
419
-        foreach ($server_keys as $key) {
420
-            if (isset($this->server[ $key ])) {
421
-                foreach (array_map('trim', explode(',', $this->server[ $key ])) as $ip) {
422
-                    if ($ip === '127.0.0.1' || filter_var($ip, FILTER_VALIDATE_IP) !== false) {
423
-                        $visitor_ip = $ip;
424
-                    }
425
-                }
426
-            }
427
-        }
428
-        return $visitor_ip;
429
-    }
430
-
431
-
432
-    /**
433
-     * Gets the request's literal URI. Related to `requestUriAfterSiteHomeUri`, see its description for a comparison.
434
-     *
435
-     * @param boolean $relativeToWpRoot    If home_url() is "http://mysite.com/wp/", and a request comes to
436
-     *                                     "http://mysite.com/wp/wp-json", setting $relativeToWpRoot=true will return
437
-     *                                     "/wp-json", whereas $relativeToWpRoot=false will return "/wp/wp-json/".
438
-     * @param boolean $remove_query_params whether or not to return the uri with all query params removed.
439
-     * @return string
440
-     */
441
-    public function requestUri($relativeToWpRoot = false, $remove_query_params = false)
442
-    {
443
-        $request_uri = filter_input(
444
-            INPUT_SERVER,
445
-            'REQUEST_URI',
446
-            FILTER_SANITIZE_URL,
447
-            FILTER_NULL_ON_FAILURE
448
-        );
449
-        if (empty($request_uri)) {
450
-            // fallback sanitization if the above fails
451
-            $request_uri = wp_sanitize_redirect($this->server['REQUEST_URI']);
452
-        }
453
-        if ($remove_query_params) {
454
-            $request_uri_parts = explode('?', $request_uri);
455
-            $request_uri = reset($request_uri_parts);
456
-        }
457
-        if ($relativeToWpRoot) {
458
-            $home_path = untrailingslashit(
459
-                parse_url(
460
-                    home_url(),
461
-                    PHP_URL_PATH
462
-                )
463
-            );
464
-            $request_uri = str_replace(
465
-                $home_path,
466
-                '',
467
-                $request_uri
468
-            );
469
-        }
470
-        return $request_uri;
471
-    }
472
-
473
-    /**
474
-     * @return string
475
-     */
476
-    public function userAgent()
477
-    {
478
-        return $this->user_agent;
479
-    }
480
-
481
-
482
-    /**
483
-     * @param string $user_agent
484
-     */
485
-    public function setUserAgent($user_agent = '')
486
-    {
487
-        if ($user_agent === '' || ! is_string($user_agent)) {
488
-            $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? (string) esc_attr($_SERVER['HTTP_USER_AGENT']) : '';
489
-        }
490
-        $this->user_agent = $user_agent;
491
-    }
492
-
493
-
494
-    /**
495
-     * @return bool
496
-     */
497
-    public function isBot()
498
-    {
499
-        return $this->is_bot;
500
-    }
501
-
502
-
503
-    /**
504
-     * @param bool $is_bot
505
-     */
506
-    public function setIsBot($is_bot)
507
-    {
508
-        $this->is_bot = filter_var($is_bot, FILTER_VALIDATE_BOOLEAN);
509
-    }
510
-
511
-
512
-    /**
513
-     * @return bool
514
-     */
515
-    public function isActivation()
516
-    {
517
-        return $this->request_type->isActivation();
518
-    }
519
-
520
-
521
-    /**
522
-     * @param $is_activation
523
-     * @return bool
524
-     */
525
-    public function setIsActivation($is_activation)
526
-    {
527
-        return $this->request_type->setIsActivation($is_activation);
528
-    }
529
-
530
-
531
-    /**
532
-     * @return bool
533
-     */
534
-    public function isAdmin()
535
-    {
536
-        return $this->request_type->isAdmin();
537
-    }
538
-
539
-
540
-    /**
541
-     * @return bool
542
-     */
543
-    public function isAdminAjax()
544
-    {
545
-        return $this->request_type->isAdminAjax();
546
-    }
547
-
548
-
549
-    /**
550
-     * @return bool
551
-     */
552
-    public function isAjax()
553
-    {
554
-        return $this->request_type->isAjax();
555
-    }
556
-
557
-
558
-    /**
559
-     * @return bool
560
-     */
561
-    public function isEeAjax()
562
-    {
563
-        return $this->request_type->isEeAjax();
564
-    }
565
-
566
-
567
-    /**
568
-     * @return bool
569
-     */
570
-    public function isOtherAjax()
571
-    {
572
-        return $this->request_type->isOtherAjax();
573
-    }
574
-
575
-
576
-    /**
577
-     * @return bool
578
-     */
579
-    public function isApi()
580
-    {
581
-        return $this->request_type->isApi();
582
-    }
583
-
584
-
585
-    /**
586
-     * @return bool
587
-     */
588
-    public function isCli()
589
-    {
590
-        return $this->request_type->isCli();
591
-    }
592
-
593
-
594
-    /**
595
-     * @return bool
596
-     */
597
-    public function isCron()
598
-    {
599
-        return $this->request_type->isCron();
600
-    }
601
-
602
-
603
-    /**
604
-     * @return bool
605
-     */
606
-    public function isFeed()
607
-    {
608
-        return $this->request_type->isFeed();
609
-    }
610
-
611
-
612
-    /**
613
-     * @return bool
614
-     */
615
-    public function isFrontend()
616
-    {
617
-        return $this->request_type->isFrontend();
618
-    }
619
-
620
-
621
-    /**
622
-     * @return bool
623
-     */
624
-    public function isFrontAjax()
625
-    {
626
-        return $this->request_type->isFrontAjax();
627
-    }
628
-
629
-
630
-    /**
631
-     * @return bool
632
-     */
633
-    public function isGQL()
634
-    {
635
-        return $this->request_type->isGQL();
636
-    }
637
-
638
-
639
-    /**
640
-     * @return bool
641
-     */
642
-    public function isIframe()
643
-    {
644
-        return $this->request_type->isIframe();
645
-    }
646
-
647
-
648
-
649
-    /**
650
-     * @return bool
651
-     */
652
-    public function isUnitTesting()
653
-    {
654
-        return $this->request_type->isUnitTesting();
655
-    }
656
-
657
-
658
-    /**
659
-     * @return bool
660
-     */
661
-    public function isWordPressApi()
662
-    {
663
-        return $this->request_type->isWordPressApi();
664
-    }
665
-
666
-
667
-
668
-    /**
669
-     * @return bool
670
-     */
671
-    public function isWordPressHeartbeat()
672
-    {
673
-        return $this->request_type->isWordPressHeartbeat();
674
-    }
675
-
676
-
677
-
678
-    /**
679
-     * @return bool
680
-     */
681
-    public function isWordPressScrape()
682
-    {
683
-        return $this->request_type->isWordPressScrape();
684
-    }
685
-
686
-
687
-    /**
688
-     * @return string
689
-     */
690
-    public function slug()
691
-    {
692
-        return $this->request_type->slug();
693
-    }
694
-
695
-
696
-    /**
697
-     * returns the path portion of the current request URI with both the WP Root (home_url()) and query params removed
698
-     *
699
-     * @return string
700
-     * @since   $VID:$
701
-     */
702
-    public function requestPath()
703
-    {
704
-        return $this->requestUri(true, true);
705
-    }
706
-
707
-
708
-    /**
709
-     * returns true if the last segment of the current request path (without params) matches the provided string
710
-     *
711
-     * @param string $uri_segment
712
-     * @return bool
713
-     * @since   $VID:$
714
-     */
715
-    public function currentPageIs($uri_segment)
716
-    {
717
-        $request_path = $this->requestPath();
718
-        $current_page = explode('/', $request_path);
719
-        return end($current_page) === $uri_segment;
720
-    }
20
+	/**
21
+	 * $_GET parameters
22
+	 *
23
+	 * @var array $get
24
+	 */
25
+	private $get;
26
+
27
+	/**
28
+	 * $_POST parameters
29
+	 *
30
+	 * @var array $post
31
+	 */
32
+	private $post;
33
+
34
+	/**
35
+	 * $_COOKIE parameters
36
+	 *
37
+	 * @var array $cookie
38
+	 */
39
+	private $cookie;
40
+
41
+	/**
42
+	 * $_SERVER parameters
43
+	 *
44
+	 * @var array $server
45
+	 */
46
+	private $server;
47
+
48
+	/**
49
+	 * $_FILES parameters
50
+	 *
51
+	 * @var array $files
52
+	 */
53
+	private $files;
54
+
55
+	/**
56
+	 * $_REQUEST parameters
57
+	 *
58
+	 * @var array $request
59
+	 */
60
+	private $request;
61
+
62
+	/**
63
+	 * @var RequestTypeContextCheckerInterface
64
+	 */
65
+	private $request_type;
66
+
67
+	/**
68
+	 * IP address for request
69
+	 *
70
+	 * @var string $ip_address
71
+	 */
72
+	private $ip_address;
73
+
74
+	/**
75
+	 * @var string $user_agent
76
+	 */
77
+	private $user_agent;
78
+
79
+	/**
80
+	 * true if current user appears to be some kind of bot
81
+	 *
82
+	 * @var bool $is_bot
83
+	 */
84
+	private $is_bot;
85
+
86
+
87
+	/**
88
+	 * @param array $get
89
+	 * @param array $post
90
+	 * @param array $cookie
91
+	 * @param array $server
92
+	 * @param array $files
93
+	 */
94
+	public function __construct(array $get, array $post, array $cookie, array $server, array $files = array())
95
+	{
96
+		// grab request vars
97
+		$this->get = $get;
98
+		$this->post = $post;
99
+		$this->cookie = $cookie;
100
+		$this->server = $server;
101
+		$this->files = $files;
102
+		$this->request = array_merge($this->get, $this->post);
103
+		$this->ip_address = $this->visitorIp();
104
+	}
105
+
106
+
107
+	/**
108
+	 * @param RequestTypeContextCheckerInterface $type
109
+	 */
110
+	public function setRequestTypeContextChecker(RequestTypeContextCheckerInterface $type)
111
+	{
112
+		$this->request_type = $type;
113
+	}
114
+
115
+
116
+	/**
117
+	 * @return array
118
+	 */
119
+	public function getParams()
120
+	{
121
+		return $this->get;
122
+	}
123
+
124
+
125
+	/**
126
+	 * @return array
127
+	 */
128
+	public function postParams()
129
+	{
130
+		return $this->post;
131
+	}
132
+
133
+
134
+	/**
135
+	 * @return array
136
+	 */
137
+	public function cookieParams()
138
+	{
139
+		return $this->cookie;
140
+	}
141
+
142
+
143
+	/**
144
+	 * @return array
145
+	 */
146
+	public function serverParams()
147
+	{
148
+		return $this->server;
149
+	}
150
+
151
+
152
+	/**
153
+	 * @return array
154
+	 */
155
+	public function filesParams()
156
+	{
157
+		return $this->files;
158
+	}
159
+
160
+
161
+	/**
162
+	 * returns contents of $_REQUEST
163
+	 *
164
+	 * @return array
165
+	 */
166
+	public function requestParams()
167
+	{
168
+		return $this->request;
169
+	}
170
+
171
+
172
+	/**
173
+	 * @param      $key
174
+	 * @param      $value
175
+	 * @param bool $override_ee
176
+	 * @return    void
177
+	 */
178
+	public function setRequestParam($key, $value, $override_ee = false)
179
+	{
180
+		// don't allow "ee" to be overwritten unless explicitly instructed to do so
181
+		if ($key !== 'ee' || empty($this->request['ee']) || $override_ee) {
182
+			$this->request[ $key ] = $value;
183
+		}
184
+	}
185
+
186
+
187
+	/**
188
+	 * returns   the value for a request param if the given key exists
189
+	 *
190
+	 * @param       $key
191
+	 * @param null  $default
192
+	 * @return mixed
193
+	 */
194
+	public function getRequestParam($key, $default = null)
195
+	{
196
+		return $this->requestParameterDrillDown($key, $default, 'get');
197
+	}
198
+
199
+
200
+	/**
201
+	 * check if param exists
202
+	 *
203
+	 * @param       $key
204
+	 * @return bool
205
+	 */
206
+	public function requestParamIsSet($key)
207
+	{
208
+		return $this->requestParameterDrillDown($key);
209
+	}
210
+
211
+
212
+	/**
213
+	 * check if a request parameter exists whose key that matches the supplied wildcard pattern
214
+	 * and return the value for the first match found
215
+	 * wildcards can be either of the following:
216
+	 *      ? to represent a single character of any type
217
+	 *      * to represent one or more characters of any type
218
+	 *
219
+	 * @param string     $pattern
220
+	 * @param null|mixed $default
221
+	 * @return mixed
222
+	 */
223
+	public function getMatch($pattern, $default = null)
224
+	{
225
+		return $this->requestParameterDrillDown($pattern, $default, 'match');
226
+	}
227
+
228
+
229
+	/**
230
+	 * check if a request parameter exists whose key matches the supplied wildcard pattern
231
+	 * wildcards can be either of the following:
232
+	 *      ? to represent a single character of any type
233
+	 *      * to represent one or more characters of any type
234
+	 * returns true if a match is found or false if not
235
+	 *
236
+	 * @param string $pattern
237
+	 * @return bool
238
+	 */
239
+	public function matches($pattern)
240
+	{
241
+		return $this->requestParameterDrillDown($pattern, null, 'match') !== null;
242
+	}
243
+
244
+
245
+	/**
246
+	 * @see https://stackoverflow.com/questions/6163055/php-string-matching-with-wildcard
247
+	 * @param string $pattern               A string including wildcards to be converted to a regex pattern
248
+	 *                                      and used to search through the current request's parameter keys
249
+	 * @param array  $request_params        The array of request parameters to search through
250
+	 * @param mixed  $default               [optional] The value to be returned if no match is found.
251
+	 *                                      Default is null
252
+	 * @param string $return                [optional] Controls what kind of value is returned.
253
+	 *                                      Options are:
254
+	 *                                      'bool' will return true or false if match is found or not
255
+	 *                                      'key' will return the first key found that matches the supplied pattern
256
+	 *                                      'value' will return the value for the first request parameter
257
+	 *                                      whose key matches the supplied pattern
258
+	 *                                      Default is 'value'
259
+	 * @return boolean|string
260
+	 */
261
+	private function match($pattern, array $request_params, $default = null, $return = 'value')
262
+	{
263
+		$return = in_array($return, array('bool', 'key', 'value'), true)
264
+			? $return
265
+			: 'is_set';
266
+		// replace wildcard chars with regex chars
267
+		$pattern = str_replace(
268
+			array("\*", "\?"),
269
+			array('.*', '.'),
270
+			preg_quote($pattern, '/')
271
+		);
272
+		foreach ($request_params as $key => $request_param) {
273
+			if (preg_match('/^' . $pattern . '$/is', $key)) {
274
+				// return value for request param
275
+				if ($return === 'value') {
276
+					return $request_params[ $key ];
277
+				}
278
+				// or actual key or true just to indicate it was found
279
+				return $return === 'key' ? $key : true;
280
+			}
281
+		}
282
+		// match not found so return default value or false
283
+		return $return === 'value' ? $default : false;
284
+	}
285
+
286
+
287
+	/**
288
+	 * the supplied key can be a simple string to represent a "top-level" request parameter
289
+	 * or represent a key for a request parameter that is nested deeper within the request parameter array,
290
+	 * by using square brackets to surround keys for deeper array elements.
291
+	 * For example :
292
+	 * if the supplied $key was: "first[second][third]"
293
+	 * then this will attempt to drill down into the request parameter array to find a value.
294
+	 * Given the following request parameters:
295
+	 *  array(
296
+	 *      'first' => array(
297
+	 *          'second' => array(
298
+	 *              'third' => 'has a value'
299
+	 *          )
300
+	 *      )
301
+	 *  )
302
+	 * would return true if default parameters were set
303
+	 *
304
+	 * @param string $callback
305
+	 * @param        $key
306
+	 * @param null   $default
307
+	 * @param array  $request_params
308
+	 * @return bool|mixed|null
309
+	 */
310
+	private function requestParameterDrillDown(
311
+		$key,
312
+		$default = null,
313
+		$callback = 'is_set',
314
+		array $request_params = array()
315
+	) {
316
+		$callback = in_array($callback, array('is_set', 'get', 'match'), true)
317
+			? $callback
318
+			: 'is_set';
319
+		$request_params = ! empty($request_params)
320
+			? $request_params
321
+			: $this->request;
322
+		// does incoming key represent an array like 'first[second][third]'  ?
323
+		if (strpos($key, '[') !== false) {
324
+			// turn it into an actual array
325
+			$key = str_replace(']', '', $key);
326
+			$keys = explode('[', $key);
327
+			$key = array_shift($keys);
328
+			if ($callback === 'match') {
329
+				$real_key = $this->match($key, $request_params, $default, 'key');
330
+				$key = $real_key ? $real_key : $key;
331
+			}
332
+			// check if top level key exists
333
+			if (isset($request_params[ $key ])) {
334
+				// build a new key to pass along like: 'second[third]'
335
+				// or just 'second' depending on depth of keys
336
+				$key_string = array_shift($keys);
337
+				if (! empty($keys)) {
338
+					$key_string .= '[' . implode('][', $keys) . ']';
339
+				}
340
+				return $this->requestParameterDrillDown(
341
+					$key_string,
342
+					$default,
343
+					$callback,
344
+					$request_params[ $key ]
345
+				);
346
+			}
347
+		}
348
+		if ($callback === 'is_set') {
349
+			return isset($request_params[ $key ]);
350
+		}
351
+		if ($callback === 'match') {
352
+			return $this->match($key, $request_params, $default);
353
+		}
354
+		return isset($request_params[ $key ])
355
+			? $request_params[ $key ]
356
+			: $default;
357
+	}
358
+
359
+
360
+	/**
361
+	 * remove param
362
+	 *
363
+	 * @param      $key
364
+	 * @param bool $unset_from_global_too
365
+	 */
366
+	public function unSetRequestParam($key, $unset_from_global_too = false)
367
+	{
368
+		// because unset may not actually remove var
369
+		$this->request[ $key ] = null;
370
+		unset($this->request[ $key ]);
371
+		if ($unset_from_global_too) {
372
+			unset($_REQUEST[ $key ]);
373
+		}
374
+	}
375
+
376
+
377
+	/**
378
+	 * remove params
379
+	 *
380
+	 * @param array $keys
381
+	 * @param bool  $unset_from_global_too
382
+	 */
383
+	public function unSetRequestParams(array $keys, $unset_from_global_too = false)
384
+	{
385
+		foreach ($keys as $key) {
386
+			$this->unSetRequestParam($key, $unset_from_global_too);
387
+		}
388
+	}
389
+
390
+
391
+	/**
392
+	 * @return string
393
+	 */
394
+	public function ipAddress()
395
+	{
396
+		return $this->ip_address;
397
+	}
398
+
399
+
400
+	/**
401
+	 * attempt to get IP address of current visitor from server
402
+	 * plz see: http://stackoverflow.com/a/2031935/1475279
403
+	 *
404
+	 * @access public
405
+	 * @return string
406
+	 */
407
+	private function visitorIp()
408
+	{
409
+		$visitor_ip = '0.0.0.0';
410
+		$server_keys = array(
411
+			'HTTP_CLIENT_IP',
412
+			'HTTP_X_FORWARDED_FOR',
413
+			'HTTP_X_FORWARDED',
414
+			'HTTP_X_CLUSTER_CLIENT_IP',
415
+			'HTTP_FORWARDED_FOR',
416
+			'HTTP_FORWARDED',
417
+			'REMOTE_ADDR',
418
+		);
419
+		foreach ($server_keys as $key) {
420
+			if (isset($this->server[ $key ])) {
421
+				foreach (array_map('trim', explode(',', $this->server[ $key ])) as $ip) {
422
+					if ($ip === '127.0.0.1' || filter_var($ip, FILTER_VALIDATE_IP) !== false) {
423
+						$visitor_ip = $ip;
424
+					}
425
+				}
426
+			}
427
+		}
428
+		return $visitor_ip;
429
+	}
430
+
431
+
432
+	/**
433
+	 * Gets the request's literal URI. Related to `requestUriAfterSiteHomeUri`, see its description for a comparison.
434
+	 *
435
+	 * @param boolean $relativeToWpRoot    If home_url() is "http://mysite.com/wp/", and a request comes to
436
+	 *                                     "http://mysite.com/wp/wp-json", setting $relativeToWpRoot=true will return
437
+	 *                                     "/wp-json", whereas $relativeToWpRoot=false will return "/wp/wp-json/".
438
+	 * @param boolean $remove_query_params whether or not to return the uri with all query params removed.
439
+	 * @return string
440
+	 */
441
+	public function requestUri($relativeToWpRoot = false, $remove_query_params = false)
442
+	{
443
+		$request_uri = filter_input(
444
+			INPUT_SERVER,
445
+			'REQUEST_URI',
446
+			FILTER_SANITIZE_URL,
447
+			FILTER_NULL_ON_FAILURE
448
+		);
449
+		if (empty($request_uri)) {
450
+			// fallback sanitization if the above fails
451
+			$request_uri = wp_sanitize_redirect($this->server['REQUEST_URI']);
452
+		}
453
+		if ($remove_query_params) {
454
+			$request_uri_parts = explode('?', $request_uri);
455
+			$request_uri = reset($request_uri_parts);
456
+		}
457
+		if ($relativeToWpRoot) {
458
+			$home_path = untrailingslashit(
459
+				parse_url(
460
+					home_url(),
461
+					PHP_URL_PATH
462
+				)
463
+			);
464
+			$request_uri = str_replace(
465
+				$home_path,
466
+				'',
467
+				$request_uri
468
+			);
469
+		}
470
+		return $request_uri;
471
+	}
472
+
473
+	/**
474
+	 * @return string
475
+	 */
476
+	public function userAgent()
477
+	{
478
+		return $this->user_agent;
479
+	}
480
+
481
+
482
+	/**
483
+	 * @param string $user_agent
484
+	 */
485
+	public function setUserAgent($user_agent = '')
486
+	{
487
+		if ($user_agent === '' || ! is_string($user_agent)) {
488
+			$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? (string) esc_attr($_SERVER['HTTP_USER_AGENT']) : '';
489
+		}
490
+		$this->user_agent = $user_agent;
491
+	}
492
+
493
+
494
+	/**
495
+	 * @return bool
496
+	 */
497
+	public function isBot()
498
+	{
499
+		return $this->is_bot;
500
+	}
501
+
502
+
503
+	/**
504
+	 * @param bool $is_bot
505
+	 */
506
+	public function setIsBot($is_bot)
507
+	{
508
+		$this->is_bot = filter_var($is_bot, FILTER_VALIDATE_BOOLEAN);
509
+	}
510
+
511
+
512
+	/**
513
+	 * @return bool
514
+	 */
515
+	public function isActivation()
516
+	{
517
+		return $this->request_type->isActivation();
518
+	}
519
+
520
+
521
+	/**
522
+	 * @param $is_activation
523
+	 * @return bool
524
+	 */
525
+	public function setIsActivation($is_activation)
526
+	{
527
+		return $this->request_type->setIsActivation($is_activation);
528
+	}
529
+
530
+
531
+	/**
532
+	 * @return bool
533
+	 */
534
+	public function isAdmin()
535
+	{
536
+		return $this->request_type->isAdmin();
537
+	}
538
+
539
+
540
+	/**
541
+	 * @return bool
542
+	 */
543
+	public function isAdminAjax()
544
+	{
545
+		return $this->request_type->isAdminAjax();
546
+	}
547
+
548
+
549
+	/**
550
+	 * @return bool
551
+	 */
552
+	public function isAjax()
553
+	{
554
+		return $this->request_type->isAjax();
555
+	}
556
+
557
+
558
+	/**
559
+	 * @return bool
560
+	 */
561
+	public function isEeAjax()
562
+	{
563
+		return $this->request_type->isEeAjax();
564
+	}
565
+
566
+
567
+	/**
568
+	 * @return bool
569
+	 */
570
+	public function isOtherAjax()
571
+	{
572
+		return $this->request_type->isOtherAjax();
573
+	}
574
+
575
+
576
+	/**
577
+	 * @return bool
578
+	 */
579
+	public function isApi()
580
+	{
581
+		return $this->request_type->isApi();
582
+	}
583
+
584
+
585
+	/**
586
+	 * @return bool
587
+	 */
588
+	public function isCli()
589
+	{
590
+		return $this->request_type->isCli();
591
+	}
592
+
593
+
594
+	/**
595
+	 * @return bool
596
+	 */
597
+	public function isCron()
598
+	{
599
+		return $this->request_type->isCron();
600
+	}
601
+
602
+
603
+	/**
604
+	 * @return bool
605
+	 */
606
+	public function isFeed()
607
+	{
608
+		return $this->request_type->isFeed();
609
+	}
610
+
611
+
612
+	/**
613
+	 * @return bool
614
+	 */
615
+	public function isFrontend()
616
+	{
617
+		return $this->request_type->isFrontend();
618
+	}
619
+
620
+
621
+	/**
622
+	 * @return bool
623
+	 */
624
+	public function isFrontAjax()
625
+	{
626
+		return $this->request_type->isFrontAjax();
627
+	}
628
+
629
+
630
+	/**
631
+	 * @return bool
632
+	 */
633
+	public function isGQL()
634
+	{
635
+		return $this->request_type->isGQL();
636
+	}
637
+
638
+
639
+	/**
640
+	 * @return bool
641
+	 */
642
+	public function isIframe()
643
+	{
644
+		return $this->request_type->isIframe();
645
+	}
646
+
647
+
648
+
649
+	/**
650
+	 * @return bool
651
+	 */
652
+	public function isUnitTesting()
653
+	{
654
+		return $this->request_type->isUnitTesting();
655
+	}
656
+
657
+
658
+	/**
659
+	 * @return bool
660
+	 */
661
+	public function isWordPressApi()
662
+	{
663
+		return $this->request_type->isWordPressApi();
664
+	}
665
+
666
+
667
+
668
+	/**
669
+	 * @return bool
670
+	 */
671
+	public function isWordPressHeartbeat()
672
+	{
673
+		return $this->request_type->isWordPressHeartbeat();
674
+	}
675
+
676
+
677
+
678
+	/**
679
+	 * @return bool
680
+	 */
681
+	public function isWordPressScrape()
682
+	{
683
+		return $this->request_type->isWordPressScrape();
684
+	}
685
+
686
+
687
+	/**
688
+	 * @return string
689
+	 */
690
+	public function slug()
691
+	{
692
+		return $this->request_type->slug();
693
+	}
694
+
695
+
696
+	/**
697
+	 * returns the path portion of the current request URI with both the WP Root (home_url()) and query params removed
698
+	 *
699
+	 * @return string
700
+	 * @since   $VID:$
701
+	 */
702
+	public function requestPath()
703
+	{
704
+		return $this->requestUri(true, true);
705
+	}
706
+
707
+
708
+	/**
709
+	 * returns true if the last segment of the current request path (without params) matches the provided string
710
+	 *
711
+	 * @param string $uri_segment
712
+	 * @return bool
713
+	 * @since   $VID:$
714
+	 */
715
+	public function currentPageIs($uri_segment)
716
+	{
717
+		$request_path = $this->requestPath();
718
+		$current_page = explode('/', $request_path);
719
+		return end($current_page) === $uri_segment;
720
+	}
721 721
 }
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     {
180 180
         // don't allow "ee" to be overwritten unless explicitly instructed to do so
181 181
         if ($key !== 'ee' || empty($this->request['ee']) || $override_ee) {
182
-            $this->request[ $key ] = $value;
182
+            $this->request[$key] = $value;
183 183
         }
184 184
     }
185 185
 
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
             preg_quote($pattern, '/')
271 271
         );
272 272
         foreach ($request_params as $key => $request_param) {
273
-            if (preg_match('/^' . $pattern . '$/is', $key)) {
273
+            if (preg_match('/^'.$pattern.'$/is', $key)) {
274 274
                 // return value for request param
275 275
                 if ($return === 'value') {
276
-                    return $request_params[ $key ];
276
+                    return $request_params[$key];
277 277
                 }
278 278
                 // or actual key or true just to indicate it was found
279 279
                 return $return === 'key' ? $key : true;
@@ -330,29 +330,29 @@  discard block
 block discarded – undo
330 330
                 $key = $real_key ? $real_key : $key;
331 331
             }
332 332
             // check if top level key exists
333
-            if (isset($request_params[ $key ])) {
333
+            if (isset($request_params[$key])) {
334 334
                 // build a new key to pass along like: 'second[third]'
335 335
                 // or just 'second' depending on depth of keys
336 336
                 $key_string = array_shift($keys);
337
-                if (! empty($keys)) {
338
-                    $key_string .= '[' . implode('][', $keys) . ']';
337
+                if ( ! empty($keys)) {
338
+                    $key_string .= '['.implode('][', $keys).']';
339 339
                 }
340 340
                 return $this->requestParameterDrillDown(
341 341
                     $key_string,
342 342
                     $default,
343 343
                     $callback,
344
-                    $request_params[ $key ]
344
+                    $request_params[$key]
345 345
                 );
346 346
             }
347 347
         }
348 348
         if ($callback === 'is_set') {
349
-            return isset($request_params[ $key ]);
349
+            return isset($request_params[$key]);
350 350
         }
351 351
         if ($callback === 'match') {
352 352
             return $this->match($key, $request_params, $default);
353 353
         }
354
-        return isset($request_params[ $key ])
355
-            ? $request_params[ $key ]
354
+        return isset($request_params[$key])
355
+            ? $request_params[$key]
356 356
             : $default;
357 357
     }
358 358
 
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
     public function unSetRequestParam($key, $unset_from_global_too = false)
367 367
     {
368 368
         // because unset may not actually remove var
369
-        $this->request[ $key ] = null;
370
-        unset($this->request[ $key ]);
369
+        $this->request[$key] = null;
370
+        unset($this->request[$key]);
371 371
         if ($unset_from_global_too) {
372
-            unset($_REQUEST[ $key ]);
372
+            unset($_REQUEST[$key]);
373 373
         }
374 374
     }
375 375
 
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
             'REMOTE_ADDR',
418 418
         );
419 419
         foreach ($server_keys as $key) {
420
-            if (isset($this->server[ $key ])) {
421
-                foreach (array_map('trim', explode(',', $this->server[ $key ])) as $ip) {
420
+            if (isset($this->server[$key])) {
421
+                foreach (array_map('trim', explode(',', $this->server[$key])) as $ip) {
422 422
                     if ($ip === '127.0.0.1' || filter_var($ip, FILTER_VALIDATE_IP) !== false) {
423 423
                         $visitor_ip = $ip;
424 424
                     }
Please login to merge, or discard this patch.
core/services/request/RequestInterface.php 1 patch
Indentation   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -16,175 +16,175 @@
 block discarded – undo
16 16
 interface RequestInterface extends RequestTypeContextCheckerInterface
17 17
 {
18 18
 
19
-    /**
20
-     * @param RequestTypeContextCheckerInterface $type
21
-     */
22
-    public function setRequestTypeContextChecker(RequestTypeContextCheckerInterface $type);
23
-
24
-    /**
25
-     * @return array
26
-     */
27
-    public function getParams();
28
-
29
-
30
-    /**
31
-     * @return array
32
-     */
33
-    public function postParams();
34
-
35
-
36
-    /**
37
-     * @return array
38
-     */
39
-    public function cookieParams();
40
-
41
-
42
-    /**
43
-     * @return array
44
-     */
45
-    public function serverParams();
46
-
47
-
48
-    /**
49
-     * @return array
50
-     */
51
-    public function filesParams();
52
-
53
-
54
-    /**
55
-     * returns contents of $_REQUEST
56
-     *
57
-     * @return array
58
-     */
59
-    public function requestParams();
19
+	/**
20
+	 * @param RequestTypeContextCheckerInterface $type
21
+	 */
22
+	public function setRequestTypeContextChecker(RequestTypeContextCheckerInterface $type);
23
+
24
+	/**
25
+	 * @return array
26
+	 */
27
+	public function getParams();
28
+
29
+
30
+	/**
31
+	 * @return array
32
+	 */
33
+	public function postParams();
34
+
35
+
36
+	/**
37
+	 * @return array
38
+	 */
39
+	public function cookieParams();
40
+
41
+
42
+	/**
43
+	 * @return array
44
+	 */
45
+	public function serverParams();
46
+
47
+
48
+	/**
49
+	 * @return array
50
+	 */
51
+	public function filesParams();
52
+
53
+
54
+	/**
55
+	 * returns contents of $_REQUEST
56
+	 *
57
+	 * @return array
58
+	 */
59
+	public function requestParams();
60 60
 
61 61
 
62
-    /**
63
-     * @param string $key
64
-     * @param string $value
65
-     * @param bool   $override_ee
66
-     * @return    void
67
-     */
68
-    public function setRequestParam($key, $value, $override_ee = false);
69
-
70
-
71
-    /**
72
-     * returns the value for a request param if the given key exists
73
-     *
74
-     * @param string $key
75
-     * @param null   $default
76
-     * @return mixed
77
-     */
78
-    public function getRequestParam($key, $default = null);
62
+	/**
63
+	 * @param string $key
64
+	 * @param string $value
65
+	 * @param bool   $override_ee
66
+	 * @return    void
67
+	 */
68
+	public function setRequestParam($key, $value, $override_ee = false);
69
+
70
+
71
+	/**
72
+	 * returns the value for a request param if the given key exists
73
+	 *
74
+	 * @param string $key
75
+	 * @param null   $default
76
+	 * @return mixed
77
+	 */
78
+	public function getRequestParam($key, $default = null);
79 79
 
80 80
 
81
-    /**
82
-     * check if param exists
83
-     *
84
-     * @param string $key
85
-     * @return bool
86
-     */
87
-    public function requestParamIsSet($key);
88
-
89
-
90
-    /**
91
-     * check if a request parameter exists whose key that matches the supplied wildcard pattern
92
-     * and return the value for the first match found
93
-     * wildcards can be either of the following:
94
-     *      ? to represent a single character of any type
95
-     *      * to represent one or more characters of any type
96
-     *
97
-     * @param string     $pattern
98
-     * @param null|mixed $default
99
-     * @return false|int
100
-     */
101
-    public function getMatch($pattern, $default = null);
102
-
103
-
104
-    /**
105
-     * check if a request parameter exists whose key matches the supplied wildcard pattern
106
-     * wildcards can be either of the following:
107
-     *      ? to represent a single character of any type
108
-     *      * to represent one or more characters of any type
109
-     * returns true if a match is found or false if not
110
-     *
111
-     * @param string $pattern
112
-     * @return false|int
113
-     */
114
-    public function matches($pattern);
115
-
116
-
117
-    /**
118
-     * remove param
119
-     *
120
-     * @param string $key
121
-     * @param bool   $unset_from_global_too
122
-     */
123
-    public function unSetRequestParam($key, $unset_from_global_too = false);
124
-
125
-
126
-    /**
127
-     * remove params
128
-     *
129
-     * @param array $keys
130
-     * @param bool   $unset_from_global_too
131
-     */
132
-    public function unSetRequestParams(array $keys, $unset_from_global_too = false);
133
-
134
-
135
-    /**
136
-     * @return string
137
-     */
138
-    public function ipAddress();
139
-
140
-
141
-    /**
142
-     * @param boolean $relativeToWpRoot    whether or not to return the uri relative to WordPress' home URL.
143
-     * @param boolean $remove_query_params whether or not to return the uri with all query params removed.
144
-     * @return string
145
-     */
146
-    public function requestUri($relativeToWpRoot = false, $remove_query_params = false);
147
-
148
-
149
-    /**
150
-     * @return string
151
-     */
152
-    public function userAgent();
153
-
154
-
155
-    /**
156
-     * @param string $user_agent
157
-     */
158
-    public function setUserAgent($user_agent = '');
159
-
160
-
161
-    /**
162
-     * @return bool
163
-     */
164
-    public function isBot();
165
-
166
-
167
-    /**
168
-     * @param bool $is_bot
169
-     */
170
-    public function setIsBot($is_bot);
171
-
172
-
173
-    /**
174
-     * returns the path portion of the current request URI with both the WP Root (home_url()) and query params removed
175
-     *
176
-     * @return string
177
-     * @since   $VID:$
178
-     */
179
-    public function requestPath();
180
-
181
-
182
-    /**
183
-     * returns true if the last segment of the current request path (without params) matches the provided string
184
-     *
185
-     * @param string $uri_segment
186
-     * @return bool
187
-     * @since   $VID:$
188
-     */
189
-    public function currentPageIs($uri_segment);
81
+	/**
82
+	 * check if param exists
83
+	 *
84
+	 * @param string $key
85
+	 * @return bool
86
+	 */
87
+	public function requestParamIsSet($key);
88
+
89
+
90
+	/**
91
+	 * check if a request parameter exists whose key that matches the supplied wildcard pattern
92
+	 * and return the value for the first match found
93
+	 * wildcards can be either of the following:
94
+	 *      ? to represent a single character of any type
95
+	 *      * to represent one or more characters of any type
96
+	 *
97
+	 * @param string     $pattern
98
+	 * @param null|mixed $default
99
+	 * @return false|int
100
+	 */
101
+	public function getMatch($pattern, $default = null);
102
+
103
+
104
+	/**
105
+	 * check if a request parameter exists whose key matches the supplied wildcard pattern
106
+	 * wildcards can be either of the following:
107
+	 *      ? to represent a single character of any type
108
+	 *      * to represent one or more characters of any type
109
+	 * returns true if a match is found or false if not
110
+	 *
111
+	 * @param string $pattern
112
+	 * @return false|int
113
+	 */
114
+	public function matches($pattern);
115
+
116
+
117
+	/**
118
+	 * remove param
119
+	 *
120
+	 * @param string $key
121
+	 * @param bool   $unset_from_global_too
122
+	 */
123
+	public function unSetRequestParam($key, $unset_from_global_too = false);
124
+
125
+
126
+	/**
127
+	 * remove params
128
+	 *
129
+	 * @param array $keys
130
+	 * @param bool   $unset_from_global_too
131
+	 */
132
+	public function unSetRequestParams(array $keys, $unset_from_global_too = false);
133
+
134
+
135
+	/**
136
+	 * @return string
137
+	 */
138
+	public function ipAddress();
139
+
140
+
141
+	/**
142
+	 * @param boolean $relativeToWpRoot    whether or not to return the uri relative to WordPress' home URL.
143
+	 * @param boolean $remove_query_params whether or not to return the uri with all query params removed.
144
+	 * @return string
145
+	 */
146
+	public function requestUri($relativeToWpRoot = false, $remove_query_params = false);
147
+
148
+
149
+	/**
150
+	 * @return string
151
+	 */
152
+	public function userAgent();
153
+
154
+
155
+	/**
156
+	 * @param string $user_agent
157
+	 */
158
+	public function setUserAgent($user_agent = '');
159
+
160
+
161
+	/**
162
+	 * @return bool
163
+	 */
164
+	public function isBot();
165
+
166
+
167
+	/**
168
+	 * @param bool $is_bot
169
+	 */
170
+	public function setIsBot($is_bot);
171
+
172
+
173
+	/**
174
+	 * returns the path portion of the current request URI with both the WP Root (home_url()) and query params removed
175
+	 *
176
+	 * @return string
177
+	 * @since   $VID:$
178
+	 */
179
+	public function requestPath();
180
+
181
+
182
+	/**
183
+	 * returns true if the last segment of the current request path (without params) matches the provided string
184
+	 *
185
+	 * @param string $uri_segment
186
+	 * @return bool
187
+	 * @since   $VID:$
188
+	 */
189
+	public function currentPageIs($uri_segment);
190 190
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/specifications/admin/WordPressPluginsPage.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@
 block discarded – undo
15 15
 class WordPressPluginsPage extends RouteMatchSpecification
16 16
 {
17 17
 
18
-    /**
19
-     * @inheritDoc
20
-     */
21
-    public function isMatchingRoute()
22
-    {
23
-        return $this->request->isAdmin() && $this->request->currentPageIs('plugins.php');
24
-    }
18
+	/**
19
+	 * @inheritDoc
20
+	 */
21
+	public function isMatchingRoute()
22
+	{
23
+		return $this->request->isAdmin() && $this->request->currentPageIs('plugins.php');
24
+	}
25 25
 }
Please login to merge, or discard this patch.
core/domain/entities/routing/handlers/shared/RestApiRequests.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -17,65 +17,65 @@
 block discarded – undo
17 17
 class RestApiRequests extends Route
18 18
 {
19 19
 
20
-    /**
21
-     * returns true if the current request matches this route
22
-     *
23
-     * @return bool
24
-     * @since   $VID:$
25
-     */
26
-    public function matchesCurrentRequest(): bool
27
-    {
28
-        return $this->request->isAdmin() || $this->request->isApi() || $this->request->isWordPressApi();
29
-    }
20
+	/**
21
+	 * returns true if the current request matches this route
22
+	 *
23
+	 * @return bool
24
+	 * @since   $VID:$
25
+	 */
26
+	public function matchesCurrentRequest(): bool
27
+	{
28
+		return $this->request->isAdmin() || $this->request->isApi() || $this->request->isWordPressApi();
29
+	}
30 30
 
31 31
 
32
-    /**
33
-     * @since $VID:$
34
-     */
35
-    protected function registerDependencies()
36
-    {
37
-        $this->dependency_map->registerDependencies(
38
-            'EventEspresso\core\libraries\rest_api\CalculatedModelFields',
39
-            ['EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => EE_Dependency_Map::load_from_cache]
40
-        );
41
-        $this->dependency_map->registerDependencies(
42
-            'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory',
43
-            ['EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache]
44
-        );
45
-        $this->dependency_map->registerDependencies(
46
-            'EventEspresso\core\libraries\rest_api\controllers\model\Read',
47
-            ['EventEspresso\core\libraries\rest_api\CalculatedModelFields' => EE_Dependency_Map::load_from_cache]
48
-        );
49
-        $this->dependency_map->registerDependencies(
50
-            'EventEspresso\core\libraries\rest_api\calculations\Datetime',
51
-            [
52
-                'EEM_Datetime'     => EE_Dependency_Map::load_from_cache,
53
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache
54
-            ]
55
-        );
56
-        $this->dependency_map->registerDependencies(
57
-            'EventEspresso\core\libraries\rest_api\calculations\Event',
58
-            [
59
-                'EEM_Event'        => EE_Dependency_Map::load_from_cache,
60
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache
61
-            ]
62
-        );
63
-        $this->dependency_map->registerDependencies(
64
-            'EventEspresso\core\libraries\rest_api\calculations\Registration',
65
-            ['EEM_Registration' => EE_Dependency_Map::load_from_cache]
66
-        );
67
-    }
32
+	/**
33
+	 * @since $VID:$
34
+	 */
35
+	protected function registerDependencies()
36
+	{
37
+		$this->dependency_map->registerDependencies(
38
+			'EventEspresso\core\libraries\rest_api\CalculatedModelFields',
39
+			['EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory' => EE_Dependency_Map::load_from_cache]
40
+		);
41
+		$this->dependency_map->registerDependencies(
42
+			'EventEspresso\core\libraries\rest_api\calculations\CalculatedModelFieldsFactory',
43
+			['EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache]
44
+		);
45
+		$this->dependency_map->registerDependencies(
46
+			'EventEspresso\core\libraries\rest_api\controllers\model\Read',
47
+			['EventEspresso\core\libraries\rest_api\CalculatedModelFields' => EE_Dependency_Map::load_from_cache]
48
+		);
49
+		$this->dependency_map->registerDependencies(
50
+			'EventEspresso\core\libraries\rest_api\calculations\Datetime',
51
+			[
52
+				'EEM_Datetime'     => EE_Dependency_Map::load_from_cache,
53
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache
54
+			]
55
+		);
56
+		$this->dependency_map->registerDependencies(
57
+			'EventEspresso\core\libraries\rest_api\calculations\Event',
58
+			[
59
+				'EEM_Event'        => EE_Dependency_Map::load_from_cache,
60
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache
61
+			]
62
+		);
63
+		$this->dependency_map->registerDependencies(
64
+			'EventEspresso\core\libraries\rest_api\calculations\Registration',
65
+			['EEM_Registration' => EE_Dependency_Map::load_from_cache]
66
+		);
67
+	}
68 68
 
69 69
 
70
-    /**
71
-     * implements logic required to run during request
72
-     *
73
-     * @return bool
74
-     * @since   $VID:$
75
-     */
76
-    protected function requestHandler(): bool
77
-    {
78
-        EED_Core_Rest_Api::set_hooks_both();
79
-        return true;
80
-    }
70
+	/**
71
+	 * implements logic required to run during request
72
+	 *
73
+	 * @return bool
74
+	 * @since   $VID:$
75
+	 */
76
+	protected function requestHandler(): bool
77
+	{
78
+		EED_Core_Rest_Api::set_hooks_both();
79
+		return true;
80
+	}
81 81
 }
Please login to merge, or discard this patch.
core/EE_Dependency_Map.core.php 2 patches
Indentation   +1017 added lines, -1017 removed lines patch added patch discarded remove patch
@@ -21,1021 +21,1021 @@
 block discarded – undo
21 21
 class EE_Dependency_Map
22 22
 {
23 23
 
24
-    /**
25
-     * This means that the requested class dependency is not present in the dependency map
26
-     */
27
-    const not_registered = 0;
28
-
29
-    /**
30
-     * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
31
-     */
32
-    const load_new_object = 1;
33
-
34
-    /**
35
-     * This instructs class loaders to return a previously instantiated and cached object for the requested class.
36
-     * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
37
-     */
38
-    const load_from_cache = 2;
39
-
40
-    /**
41
-     * When registering a dependency,
42
-     * this indicates to keep any existing dependencies that already exist,
43
-     * and simply discard any new dependencies declared in the incoming data
44
-     */
45
-    const KEEP_EXISTING_DEPENDENCIES = 0;
46
-
47
-    /**
48
-     * When registering a dependency,
49
-     * this indicates to overwrite any existing dependencies that already exist using the incoming data
50
-     */
51
-    const OVERWRITE_DEPENDENCIES = 1;
52
-
53
-    /**
54
-     * @type EE_Dependency_Map $_instance
55
-     */
56
-    protected static $_instance;
57
-
58
-    /**
59
-     * @var ClassInterfaceCache $class_cache
60
-     */
61
-    private $class_cache;
62
-
63
-    /**
64
-     * @type RequestInterface $request
65
-     */
66
-    protected $request;
67
-
68
-    /**
69
-     * @type LegacyRequestInterface $legacy_request
70
-     */
71
-    protected $legacy_request;
72
-
73
-    /**
74
-     * @type ResponseInterface $response
75
-     */
76
-    protected $response;
77
-
78
-    /**
79
-     * @type LoaderInterface $loader
80
-     */
81
-    protected $loader;
82
-
83
-    /**
84
-     * @type array $_dependency_map
85
-     */
86
-    protected $_dependency_map = [];
87
-
88
-    /**
89
-     * @type array $_class_loaders
90
-     */
91
-    protected $_class_loaders = [];
92
-
93
-
94
-    /**
95
-     * EE_Dependency_Map constructor.
96
-     *
97
-     * @param ClassInterfaceCache $class_cache
98
-     */
99
-    protected function __construct(ClassInterfaceCache $class_cache)
100
-    {
101
-        $this->class_cache = $class_cache;
102
-        do_action('EE_Dependency_Map____construct', $this);
103
-    }
104
-
105
-
106
-    /**
107
-     * @return void
108
-     * @throws InvalidAliasException
109
-     */
110
-    public function initialize()
111
-    {
112
-        $this->_register_core_dependencies();
113
-        $this->_register_core_class_loaders();
114
-        $this->_register_core_aliases();
115
-    }
116
-
117
-
118
-    /**
119
-     * @singleton method used to instantiate class object
120
-     * @param ClassInterfaceCache|null $class_cache
121
-     * @return EE_Dependency_Map
122
-     */
123
-    public static function instance(ClassInterfaceCache $class_cache = null)
124
-    {
125
-        // check if class object is instantiated, and instantiated properly
126
-        if (
127
-            ! EE_Dependency_Map::$_instance instanceof EE_Dependency_Map
128
-            && $class_cache instanceof ClassInterfaceCache
129
-        ) {
130
-            EE_Dependency_Map::$_instance = new EE_Dependency_Map($class_cache);
131
-        }
132
-        return EE_Dependency_Map::$_instance;
133
-    }
134
-
135
-
136
-    /**
137
-     * @param RequestInterface $request
138
-     */
139
-    public function setRequest(RequestInterface $request)
140
-    {
141
-        $this->request = $request;
142
-    }
143
-
144
-
145
-    /**
146
-     * @param LegacyRequestInterface $legacy_request
147
-     */
148
-    public function setLegacyRequest(LegacyRequestInterface $legacy_request)
149
-    {
150
-        $this->legacy_request = $legacy_request;
151
-    }
152
-
153
-
154
-    /**
155
-     * @param ResponseInterface $response
156
-     */
157
-    public function setResponse(ResponseInterface $response)
158
-    {
159
-        $this->response = $response;
160
-    }
161
-
162
-
163
-    /**
164
-     * @param LoaderInterface $loader
165
-     */
166
-    public function setLoader(LoaderInterface $loader)
167
-    {
168
-        $this->loader = $loader;
169
-    }
170
-
171
-
172
-    /**
173
-     * @param string $class
174
-     * @param array  $dependencies
175
-     * @param int    $overwrite
176
-     * @return bool
177
-     */
178
-    public static function register_dependencies(
179
-        $class,
180
-        array $dependencies,
181
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
182
-    ) {
183
-        return EE_Dependency_Map::$_instance->registerDependencies($class, $dependencies, $overwrite);
184
-    }
185
-
186
-
187
-    /**
188
-     * Assigns an array of class names and corresponding load sources (new or cached)
189
-     * to the class specified by the first parameter.
190
-     * IMPORTANT !!!
191
-     * The order of elements in the incoming $dependencies array MUST match
192
-     * the order of the constructor parameters for the class in question.
193
-     * This is especially important when overriding any existing dependencies that are registered.
194
-     * the third parameter controls whether any duplicate dependencies are overwritten or not.
195
-     *
196
-     * @param string $class
197
-     * @param array  $dependencies
198
-     * @param int    $overwrite
199
-     * @return bool
200
-     */
201
-    public function registerDependencies(
202
-        $class,
203
-        array $dependencies,
204
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
205
-    ) {
206
-        $class      = trim($class, '\\');
207
-        $registered = false;
208
-        if (empty(EE_Dependency_Map::$_instance->_dependency_map[ $class ])) {
209
-            EE_Dependency_Map::$_instance->_dependency_map[ $class ] = [];
210
-        }
211
-        // we need to make sure that any aliases used when registering a dependency
212
-        // get resolved to the correct class name
213
-        foreach ($dependencies as $dependency => $load_source) {
214
-            $alias = EE_Dependency_Map::$_instance->getFqnForAlias($dependency);
215
-            if (
216
-                $overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
217
-                || ! isset(EE_Dependency_Map::$_instance->_dependency_map[ $class ][ $alias ])
218
-            ) {
219
-                unset($dependencies[ $dependency ]);
220
-                $dependencies[ $alias ] = $load_source;
221
-                $registered             = true;
222
-            }
223
-        }
224
-        // now add our two lists of dependencies together.
225
-        // using Union (+=) favours the arrays in precedence from left to right,
226
-        // so $dependencies is NOT overwritten because it is listed first
227
-        // ie: with A = B + C, entries in B take precedence over duplicate entries in C
228
-        // Union is way faster than array_merge() but should be used with caution...
229
-        // especially with numerically indexed arrays
230
-        $dependencies += EE_Dependency_Map::$_instance->_dependency_map[ $class ];
231
-        // now we need to ensure that the resulting dependencies
232
-        // array only has the entries that are required for the class
233
-        // so first count how many dependencies were originally registered for the class
234
-        $dependency_count = count(EE_Dependency_Map::$_instance->_dependency_map[ $class ]);
235
-        // if that count is non-zero (meaning dependencies were already registered)
236
-        EE_Dependency_Map::$_instance->_dependency_map[ $class ] = $dependency_count
237
-            // then truncate the  final array to match that count
238
-            ? array_slice($dependencies, 0, $dependency_count)
239
-            // otherwise just take the incoming array because nothing previously existed
240
-            : $dependencies;
241
-        return $registered;
242
-    }
243
-
244
-
245
-    /**
246
-     * @param string $class_name
247
-     * @param string $loader
248
-     * @return bool
249
-     * @throws DomainException
250
-     */
251
-    public static function register_class_loader($class_name, $loader = 'load_core')
252
-    {
253
-        return EE_Dependency_Map::$_instance->registerClassLoader($class_name, $loader);
254
-    }
255
-
256
-
257
-    /**
258
-     * @param string $class_name
259
-     * @param string $loader
260
-     * @return bool
261
-     * @throws DomainException
262
-     */
263
-    public function registerClassLoader($class_name, $loader = 'load_core')
264
-    {
265
-        if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
266
-            throw new DomainException(
267
-                esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
268
-            );
269
-        }
270
-        // check that loader is callable or method starts with "load_" and exists in EE_Registry
271
-        if (
272
-            ! is_callable($loader)
273
-            && (
274
-                strpos($loader, 'load_') !== 0
275
-                || ! method_exists('EE_Registry', $loader)
276
-            )
277
-        ) {
278
-            throw new DomainException(
279
-                sprintf(
280
-                    esc_html__(
281
-                        '"%1$s" is not a valid loader method on EE_Registry.',
282
-                        'event_espresso'
283
-                    ),
284
-                    $loader
285
-                )
286
-            );
287
-        }
288
-        $class_name = EE_Dependency_Map::$_instance->getFqnForAlias($class_name);
289
-        if (! isset(EE_Dependency_Map::$_instance->_class_loaders[ $class_name ])) {
290
-            EE_Dependency_Map::$_instance->_class_loaders[ $class_name ] = $loader;
291
-            return true;
292
-        }
293
-        return false;
294
-    }
295
-
296
-
297
-    /**
298
-     * @return array
299
-     */
300
-    public function dependency_map()
301
-    {
302
-        return $this->_dependency_map;
303
-    }
304
-
305
-
306
-    /**
307
-     * returns TRUE if dependency map contains a listing for the provided class name
308
-     *
309
-     * @param string $class_name
310
-     * @return boolean
311
-     */
312
-    public function has($class_name = '')
313
-    {
314
-        // all legacy models have the same dependencies
315
-        if (strpos($class_name, 'EEM_') === 0) {
316
-            $class_name = 'LEGACY_MODELS';
317
-        }
318
-        return isset($this->_dependency_map[ $class_name ]);
319
-    }
320
-
321
-
322
-    /**
323
-     * returns TRUE if dependency map contains a listing for the provided class name AND dependency
324
-     *
325
-     * @param string $class_name
326
-     * @param string $dependency
327
-     * @return bool
328
-     */
329
-    public function has_dependency_for_class($class_name = '', $dependency = '')
330
-    {
331
-        // all legacy models have the same dependencies
332
-        if (strpos($class_name, 'EEM_') === 0) {
333
-            $class_name = 'LEGACY_MODELS';
334
-        }
335
-        $dependency = $this->getFqnForAlias($dependency, $class_name);
336
-        return isset($this->_dependency_map[ $class_name ][ $dependency ]);
337
-    }
338
-
339
-
340
-    /**
341
-     * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
342
-     *
343
-     * @param string $class_name
344
-     * @param string $dependency
345
-     * @return int
346
-     */
347
-    public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
348
-    {
349
-        // all legacy models have the same dependencies
350
-        if (strpos($class_name, 'EEM_') === 0) {
351
-            $class_name = 'LEGACY_MODELS';
352
-        }
353
-        $dependency = $this->getFqnForAlias($dependency);
354
-        return $this->has_dependency_for_class($class_name, $dependency)
355
-            ? $this->_dependency_map[ $class_name ][ $dependency ]
356
-            : EE_Dependency_Map::not_registered;
357
-    }
358
-
359
-
360
-    /**
361
-     * @param string $class_name
362
-     * @return string | Closure
363
-     */
364
-    public function class_loader($class_name)
365
-    {
366
-        // all legacy models use load_model()
367
-        if (strpos($class_name, 'EEM_') === 0) {
368
-            return 'load_model';
369
-        }
370
-        // EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc
371
-        // perform strpos() first to avoid loading regex every time we load a class
372
-        if (
373
-            strpos($class_name, 'EE_CPT_') === 0
374
-            && preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name)
375
-        ) {
376
-            return 'load_core';
377
-        }
378
-        $class_name = $this->getFqnForAlias($class_name);
379
-        return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
380
-    }
381
-
382
-
383
-    /**
384
-     * @return array
385
-     */
386
-    public function class_loaders()
387
-    {
388
-        return $this->_class_loaders;
389
-    }
390
-
391
-
392
-    /**
393
-     * adds an alias for a classname
394
-     *
395
-     * @param string $fqcn      the class name that should be used (concrete class to replace interface)
396
-     * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
397
-     * @param string $for_class the class that has the dependency (is type hinting for the interface)
398
-     * @throws InvalidAliasException
399
-     */
400
-    public function add_alias($fqcn, $alias, $for_class = '')
401
-    {
402
-        $this->class_cache->addAlias($fqcn, $alias, $for_class);
403
-    }
404
-
405
-
406
-    /**
407
-     * Returns TRUE if the provided fully qualified name IS an alias
408
-     * WHY?
409
-     * Because if a class is type hinting for a concretion,
410
-     * then why would we need to find another class to supply it?
411
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
412
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
413
-     * Don't go looking for some substitute.
414
-     * Whereas if a class is type hinting for an interface...
415
-     * then we need to find an actual class to use.
416
-     * So the interface IS the alias for some other FQN,
417
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
418
-     * represents some other class.
419
-     *
420
-     * @param string $fqn
421
-     * @param string $for_class
422
-     * @return bool
423
-     */
424
-    public function isAlias($fqn = '', $for_class = '')
425
-    {
426
-        return $this->class_cache->isAlias($fqn, $for_class);
427
-    }
428
-
429
-
430
-    /**
431
-     * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
432
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
433
-     *  for example:
434
-     *      if the following two entries were added to the _aliases array:
435
-     *          array(
436
-     *              'interface_alias'           => 'some\namespace\interface'
437
-     *              'some\namespace\interface'  => 'some\namespace\classname'
438
-     *          )
439
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
440
-     *      to load an instance of 'some\namespace\classname'
441
-     *
442
-     * @param string $alias
443
-     * @param string $for_class
444
-     * @return string
445
-     */
446
-    public function getFqnForAlias($alias = '', $for_class = '')
447
-    {
448
-        return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
449
-    }
450
-
451
-
452
-    /**
453
-     * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
454
-     * if one exists, or whether a new object should be generated every time the requested class is loaded.
455
-     * This is done by using the following class constants:
456
-     *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
457
-     *        EE_Dependency_Map::load_new_object - generates a new object every time
458
-     */
459
-    protected function _register_core_dependencies()
460
-    {
461
-        $this->_dependency_map = [
462
-            'EE_Request_Handler'                                                                                          => [
463
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
464
-            ],
465
-            'EE_System'                                                                                                   => [
466
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
467
-                'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
468
-                'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
469
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
470
-                'EventEspresso\core\services\routing\Router'  => EE_Dependency_Map::load_from_cache,
471
-            ],
472
-            'EE_Admin'                                                                                                    => [
473
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
474
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
475
-            ],
476
-            'EE_Cart'                                                                                                     => [
477
-                'EE_Session' => EE_Dependency_Map::load_from_cache,
478
-            ],
479
-            'EE_Messenger_Collection_Loader'                                                                              => [
480
-                'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
481
-            ],
482
-            'EE_Message_Type_Collection_Loader'                                                                           => [
483
-                'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
484
-            ],
485
-            'EE_Message_Resource_Manager'                                                                                 => [
486
-                'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
487
-                'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
488
-                'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
489
-            ],
490
-            'EE_Message_Factory'                                                                                          => [
491
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
492
-            ],
493
-            'EE_messages'                                                                                                 => [
494
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
495
-            ],
496
-            'EE_Messages_Generator'                                                                                       => [
497
-                'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
498
-                'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
499
-                'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
500
-                'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
501
-            ],
502
-            'EE_Messages_Processor'                                                                                       => [
503
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
504
-            ],
505
-            'EE_Messages_Queue'                                                                                           => [
506
-                'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
507
-            ],
508
-            'EE_Messages_Template_Defaults'                                                                               => [
509
-                'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
510
-                'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
511
-            ],
512
-            'EE_Message_To_Generate_From_Request'                                                                         => [
513
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
514
-                'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
515
-            ],
516
-            'EventEspresso\core\services\commands\CommandBus'                                                             => [
517
-                'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
518
-            ],
519
-            'EventEspresso\services\commands\CommandHandler'                                                              => [
520
-                'EE_Registry'         => EE_Dependency_Map::load_from_cache,
521
-                'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
522
-            ],
523
-            'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => [
524
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
525
-            ],
526
-            'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => [
527
-                'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
528
-                'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
529
-            ],
530
-            'EventEspresso\core\services\commands\CommandFactory'                                                         => [
531
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
532
-            ],
533
-            'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => [
534
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
535
-            ],
536
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => [
537
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
538
-            ],
539
-            'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => [
540
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
541
-            ],
542
-            'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => [
543
-                'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
544
-            ],
545
-            'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => [
546
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
547
-            ],
548
-            'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => [
549
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
550
-            ],
551
-            'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => [
552
-                'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
553
-            ],
554
-            'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => [
555
-                'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
556
-            ],
557
-            'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => [
558
-                'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
559
-            ],
560
-            'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => [
561
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
562
-            ],
563
-            'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => [
564
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
565
-            ],
566
-            'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => [
567
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
568
-            ],
569
-            'EventEspresso\core\services\database\TableManager'                                                           => [
570
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
571
-            ],
572
-            'EE_Data_Migration_Class_Base'                                                                                => [
573
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
574
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
575
-            ],
576
-            'EE_DMS_Core_4_1_0'                                                                                           => [
577
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
578
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
579
-            ],
580
-            'EE_DMS_Core_4_2_0'                                                                                           => [
581
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
582
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
583
-            ],
584
-            'EE_DMS_Core_4_3_0'                                                                                           => [
585
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
586
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
587
-            ],
588
-            'EE_DMS_Core_4_4_0'                                                                                           => [
589
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
590
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
591
-            ],
592
-            'EE_DMS_Core_4_5_0'                                                                                           => [
593
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
594
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
595
-            ],
596
-            'EE_DMS_Core_4_6_0'                                                                                           => [
597
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
598
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
599
-            ],
600
-            'EE_DMS_Core_4_7_0'                                                                                           => [
601
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
602
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
603
-            ],
604
-            'EE_DMS_Core_4_8_0'                                                                                           => [
605
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
606
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
607
-            ],
608
-            'EE_DMS_Core_4_9_0'                                                                                           => [
609
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
610
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
611
-            ],
612
-            'EE_DMS_Core_4_10_0'                                                                                          => [
613
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
614
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
615
-                'EE_DMS_Core_4_9_0'                                  => EE_Dependency_Map::load_from_cache,
616
-            ],
617
-            'EE_DMS_Core_4_11_0'                                                                                          => [
618
-                'EE_DMS_Core_4_10_0'                                 => EE_Dependency_Map::load_from_cache,
619
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
620
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
621
-            ],
622
-            'EventEspresso\core\services\assets\Registry'                                                                 => [
623
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_new_object,
624
-                'EventEspresso\core\services\assets\AssetManifest'   => EE_Dependency_Map::load_from_cache,
625
-            ],
626
-            'EventEspresso\core\services\cache\BasicCacheManager'                                                         => [
627
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
628
-            ],
629
-            'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => [
630
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
631
-            ],
632
-            'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => [
633
-                'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
634
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
635
-            ],
636
-            'EventEspresso\core\domain\values\EmailAddress'                                                               => [
637
-                null,
638
-                'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
639
-            ],
640
-            'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => [
641
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
642
-            ],
643
-            'LEGACY_MODELS'                                                                                               => [
644
-                null,
645
-                'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
646
-            ],
647
-            'EE_Module_Request_Router'                                                                                    => [
648
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
649
-            ],
650
-            'EE_Registration_Processor'                                                                                   => [
651
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
652
-            ],
653
-            'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => [
654
-                null,
655
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
656
-                'EventEspresso\core\services\request\Request'                         => EE_Dependency_Map::load_from_cache,
657
-            ],
658
-            'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => [
659
-                'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
660
-                'EE_Session'             => EE_Dependency_Map::load_from_cache,
661
-            ],
662
-            'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => [
663
-                'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
664
-                'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
665
-                'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
666
-                'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
667
-                'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
668
-            ],
669
-            'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => [
670
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
671
-            ],
672
-            'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => [
673
-                'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
674
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
675
-            ],
676
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => [
677
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
678
-            ],
679
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => [
680
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
681
-            ],
682
-            'EE_CPT_Strategy'                                                                                             => [
683
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
684
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
685
-            ],
686
-            'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => [
687
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
688
-            ],
689
-            'EventEspresso\core\CPTs\CptQueryModifier'                                                                    => [
690
-                null,
691
-                null,
692
-                null,
693
-                'EE_Request_Handler'                          => EE_Dependency_Map::load_from_cache,
694
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
695
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
696
-            ],
697
-            'EventEspresso\core\services\dependencies\DependencyResolver'                                                 => [
698
-                'EventEspresso\core\services\container\Mirror'            => EE_Dependency_Map::load_from_cache,
699
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
700
-                'EE_Dependency_Map'                                       => EE_Dependency_Map::load_from_cache,
701
-            ],
702
-            'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver'                               => [
703
-                'EventEspresso\core\services\container\Mirror'            => EE_Dependency_Map::load_from_cache,
704
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
705
-                'EE_Dependency_Map'                                       => EE_Dependency_Map::load_from_cache,
706
-            ],
707
-            'EventEspresso\core\services\routing\RouteMatchSpecificationFactory'                                          => [
708
-                'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache,
709
-                'EventEspresso\core\services\loaders\Loader'                                    => EE_Dependency_Map::load_from_cache,
710
-            ],
711
-            'EventEspresso\core\services\routing\RouteMatchSpecificationManager'                                          => [
712
-                'EventEspresso\core\services\routing\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache,
713
-                'EventEspresso\core\services\routing\RouteMatchSpecificationFactory'    => EE_Dependency_Map::load_from_cache,
714
-            ],
715
-            'EE_URL_Validation_Strategy'                                                                                  => [
716
-                null,
717
-                null,
718
-                'EventEspresso\core\services\validators\URLValidator' => EE_Dependency_Map::load_from_cache,
719
-            ],
720
-            'EventEspresso\core\services\request\files\FilesDataHandler'                                                  => [
721
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
722
-            ],
723
-            'EventEspressoBatchRequest\BatchRequestProcessor'                                                             => [
724
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
725
-            ],
726
-            'EventEspresso\core\domain\services\converters\RestApiSpoofer'                                                => [
727
-                'WP_REST_Server'                                               => EE_Dependency_Map::load_from_cache,
728
-                'EED_Core_Rest_Api'                                            => EE_Dependency_Map::load_from_cache,
729
-                'EventEspresso\core\libraries\rest_api\controllers\model\Read' => EE_Dependency_Map::load_from_cache,
730
-                null,
731
-            ],
732
-            'EventEspresso\core\services\routing\RouteHandler'                                                            => [
733
-                'EventEspresso\core\services\json\JsonDataNodeHandler' => EE_Dependency_Map::load_from_cache,
734
-                'EventEspresso\core\services\loaders\Loader'           => EE_Dependency_Map::load_from_cache,
735
-                'EventEspresso\core\services\request\Request'          => EE_Dependency_Map::load_from_cache,
736
-                'EventEspresso\core\services\routing\RouteCollection'  => EE_Dependency_Map::load_from_cache,
737
-            ],
738
-            'EventEspresso\core\services\json\JsonDataNodeHandler'                                                        => [
739
-                'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache,
740
-            ],
741
-            'EventEspresso\core\services\routing\Router'                                                                  => [
742
-                'EE_Dependency_Map'                                => EE_Dependency_Map::load_from_cache,
743
-                'EventEspresso\core\services\loaders\Loader'       => EE_Dependency_Map::load_from_cache,
744
-                'EventEspresso\core\services\routing\RouteHandler' => EE_Dependency_Map::load_from_cache,
745
-            ],
746
-            'EventEspresso\core\services\assets\AssetManifest'                                                            => [
747
-                'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
748
-            ],
749
-            'EventEspresso\core\services\assets\AssetManifestFactory'                                                     => [
750
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
751
-            ],
752
-            'EventEspresso\core\services\assets\BaristaFactory'                                                           => [
753
-                'EventEspresso\core\services\assets\AssetManifestFactory' => EE_Dependency_Map::load_from_cache,
754
-                'EventEspresso\core\services\loaders\Loader'              => EE_Dependency_Map::load_from_cache,
755
-            ],
756
-            'EventEspresso\core\domain\services\capabilities\FeatureFlags'                                                => [
757
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
758
-            ],
759
-            'EventEspresso\core\services\addon\AddonManager' => [
760
-                'EventEspresso\core\services\addon\AddonCollection'              => EE_Dependency_Map::load_from_cache,
761
-                'EventEspresso\core\Psr4Autoloader'                              => EE_Dependency_Map::load_from_cache,
762
-                'EventEspresso\core\services\addon\api\v1\RegisterAddon'         => EE_Dependency_Map::load_from_cache,
763
-                'EventEspresso\core\services\addon\api\IncompatibleAddonHandler' => EE_Dependency_Map::load_from_cache,
764
-                'EventEspresso\core\services\addon\api\ThirdPartyPluginHandler'  => EE_Dependency_Map::load_from_cache,
765
-            ],
766
-            'EventEspresso\core\services\addon\api\ThirdPartyPluginHandler' => [
767
-                'EventEspresso\core\services\request\Request'  => EE_Dependency_Map::load_from_cache,
768
-            ],
769
-        ];
770
-    }
771
-
772
-
773
-    /**
774
-     * Registers how core classes are loaded.
775
-     * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
776
-     *        'EE_Request_Handler' => 'load_core'
777
-     *        'EE_Messages_Queue'  => 'load_lib'
778
-     *        'EEH_Debug_Tools'    => 'load_helper'
779
-     * or, if greater control is required, by providing a custom closure. For example:
780
-     *        'Some_Class' => function () {
781
-     *            return new Some_Class();
782
-     *        },
783
-     * This is required for instantiating dependencies
784
-     * where an interface has been type hinted in a class constructor. For example:
785
-     *        'Required_Interface' => function () {
786
-     *            return new A_Class_That_Implements_Required_Interface();
787
-     *        },
788
-     */
789
-    protected function _register_core_class_loaders()
790
-    {
791
-        $this->_class_loaders = [
792
-            // load_core
793
-            'EE_Dependency_Map'                            => function () {
794
-                return $this;
795
-            },
796
-            'EE_Capabilities'                              => 'load_core',
797
-            'EE_Encryption'                                => 'load_core',
798
-            'EE_Front_Controller'                          => 'load_core',
799
-            'EE_Module_Request_Router'                     => 'load_core',
800
-            'EE_Registry'                                  => 'load_core',
801
-            'EE_Request'                                   => function () {
802
-                return $this->legacy_request;
803
-            },
804
-            'EventEspresso\core\services\request\Request'  => function () {
805
-                return $this->request;
806
-            },
807
-            'EventEspresso\core\services\request\Response' => function () {
808
-                return $this->response;
809
-            },
810
-            'EE_Base'                                      => 'load_core',
811
-            'EE_Request_Handler'                           => 'load_core',
812
-            'EE_Session'                                   => 'load_core',
813
-            'EE_Cron_Tasks'                                => 'load_core',
814
-            'EE_System'                                    => 'load_core',
815
-            'EE_Maintenance_Mode'                          => 'load_core',
816
-            'EE_Register_CPTs'                             => 'load_core',
817
-            'EE_Admin'                                     => 'load_core',
818
-            'EE_CPT_Strategy'                              => 'load_core',
819
-            // load_class
820
-            'EE_Registration_Processor'                    => 'load_class',
821
-            // load_lib
822
-            'EE_Message_Resource_Manager'                  => 'load_lib',
823
-            'EE_Message_Type_Collection'                   => 'load_lib',
824
-            'EE_Message_Type_Collection_Loader'            => 'load_lib',
825
-            'EE_Messenger_Collection'                      => 'load_lib',
826
-            'EE_Messenger_Collection_Loader'               => 'load_lib',
827
-            'EE_Messages_Processor'                        => 'load_lib',
828
-            'EE_Message_Repository'                        => 'load_lib',
829
-            'EE_Messages_Queue'                            => 'load_lib',
830
-            'EE_Messages_Data_Handler_Collection'          => 'load_lib',
831
-            'EE_Message_Template_Group_Collection'         => 'load_lib',
832
-            'EE_Payment_Method_Manager'                    => 'load_lib',
833
-            'EE_DMS_Core_4_1_0'                            => 'load_dms',
834
-            'EE_DMS_Core_4_2_0'                            => 'load_dms',
835
-            'EE_DMS_Core_4_3_0'                            => 'load_dms',
836
-            'EE_DMS_Core_4_5_0'                            => 'load_dms',
837
-            'EE_DMS_Core_4_6_0'                            => 'load_dms',
838
-            'EE_DMS_Core_4_7_0'                            => 'load_dms',
839
-            'EE_DMS_Core_4_8_0'                            => 'load_dms',
840
-            'EE_DMS_Core_4_9_0'                            => 'load_dms',
841
-            'EE_DMS_Core_4_10_0'                           => 'load_dms',
842
-            'EE_DMS_Core_4_11_0'                           => 'load_dms',
843
-            'EE_Messages_Generator'                        => static function () {
844
-                return EE_Registry::instance()->load_lib(
845
-                    'Messages_Generator',
846
-                    [],
847
-                    false,
848
-                    false
849
-                );
850
-            },
851
-            'EE_Messages_Template_Defaults'                => static function ($arguments = []) {
852
-                return EE_Registry::instance()->load_lib(
853
-                    'Messages_Template_Defaults',
854
-                    $arguments,
855
-                    false,
856
-                    false
857
-                );
858
-            },
859
-            // load_helper
860
-            'EEH_Parse_Shortcodes'                         => static function () {
861
-                if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
862
-                    return new EEH_Parse_Shortcodes();
863
-                }
864
-                return null;
865
-            },
866
-            'EE_Template_Config'                           => static function () {
867
-                return EE_Config::instance()->template_settings;
868
-            },
869
-            'EE_Currency_Config'                           => static function () {
870
-                return EE_Config::instance()->currency;
871
-            },
872
-            'EE_Registration_Config'                       => static function () {
873
-                return EE_Config::instance()->registration;
874
-            },
875
-            'EE_Core_Config'                               => static function () {
876
-                return EE_Config::instance()->core;
877
-            },
878
-            'EventEspresso\core\services\loaders\Loader'   => static function () {
879
-                return LoaderFactory::getLoader();
880
-            },
881
-            'EE_Network_Config'                            => static function () {
882
-                return EE_Network_Config::instance();
883
-            },
884
-            'EE_Config'                                    => static function () {
885
-                return EE_Config::instance();
886
-            },
887
-            'EventEspresso\core\domain\Domain'             => static function () {
888
-                return DomainFactory::getEventEspressoCoreDomain();
889
-            },
890
-            'EE_Admin_Config'                              => static function () {
891
-                return EE_Config::instance()->admin;
892
-            },
893
-            'EE_Organization_Config'                       => static function () {
894
-                return EE_Config::instance()->organization;
895
-            },
896
-            'EE_Network_Core_Config'                       => static function () {
897
-                return EE_Network_Config::instance()->core;
898
-            },
899
-            'EE_Environment_Config'                        => static function () {
900
-                return EE_Config::instance()->environment;
901
-            },
902
-            'EED_Core_Rest_Api'                            => static function () {
903
-                return EED_Core_Rest_Api::instance();
904
-            },
905
-            'WP_REST_Server'                               => static function () {
906
-                return rest_get_server();
907
-            },
908
-            'EventEspresso\core\Psr4Autoloader'            => static function () {
909
-                return EE_Psr4AutoloaderInit::psr4_loader();
910
-            },
911
-        ];
912
-    }
913
-
914
-
915
-    /**
916
-     * can be used for supplying alternate names for classes,
917
-     * or for connecting interface names to instantiable classes
918
-     *
919
-     * @throws InvalidAliasException
920
-     */
921
-    protected function _register_core_aliases()
922
-    {
923
-        $aliases = [
924
-            'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
925
-            'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
926
-            'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
927
-            'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
928
-            'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
929
-            'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
930
-            'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
931
-            'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
932
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
933
-            'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
934
-            'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
935
-            'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
936
-            'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
937
-            'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
938
-            'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
939
-            'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
940
-            'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
941
-            'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
942
-            'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
943
-            'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
944
-            'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
945
-            'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
946
-            'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
947
-            'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
948
-            'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
949
-            'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
950
-            'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
951
-            'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
952
-            'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
953
-            'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
954
-            'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
955
-            'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
956
-            'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
957
-            'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
958
-            'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
959
-            'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
960
-            'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
961
-            'Registration_Processor'                                                       => 'EE_Registration_Processor',
962
-            'EventEspresso\core\services\assets\AssetManifestInterface'                    => 'EventEspresso\core\services\assets\AssetManifest',
963
-        ];
964
-        foreach ($aliases as $alias => $fqn) {
965
-            if (is_array($fqn)) {
966
-                foreach ($fqn as $class => $for_class) {
967
-                    $this->class_cache->addAlias($class, $alias, $for_class);
968
-                }
969
-                continue;
970
-            }
971
-            $this->class_cache->addAlias($fqn, $alias);
972
-        }
973
-        if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
974
-            $this->class_cache->addAlias(
975
-                'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
976
-                'EventEspresso\core\services\notices\NoticeConverterInterface'
977
-            );
978
-        }
979
-    }
980
-
981
-
982
-    /**
983
-     * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
984
-     * request Primarily used by unit tests.
985
-     */
986
-    public function reset()
987
-    {
988
-        $this->_register_core_class_loaders();
989
-        $this->_register_core_dependencies();
990
-    }
991
-
992
-
993
-    /**
994
-     * PLZ NOTE: a better name for this method would be is_alias()
995
-     * because it returns TRUE if the provided fully qualified name IS an alias
996
-     * WHY?
997
-     * Because if a class is type hinting for a concretion,
998
-     * then why would we need to find another class to supply it?
999
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
1000
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
1001
-     * Don't go looking for some substitute.
1002
-     * Whereas if a class is type hinting for an interface...
1003
-     * then we need to find an actual class to use.
1004
-     * So the interface IS the alias for some other FQN,
1005
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
1006
-     * represents some other class.
1007
-     *
1008
-     * @param string $fqn
1009
-     * @param string $for_class
1010
-     * @return bool
1011
-     * @deprecated 4.9.62.p
1012
-     */
1013
-    public function has_alias($fqn = '', $for_class = '')
1014
-    {
1015
-        return $this->isAlias($fqn, $for_class);
1016
-    }
1017
-
1018
-
1019
-    /**
1020
-     * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
1021
-     * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
1022
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
1023
-     *  for example:
1024
-     *      if the following two entries were added to the _aliases array:
1025
-     *          array(
1026
-     *              'interface_alias'           => 'some\namespace\interface'
1027
-     *              'some\namespace\interface'  => 'some\namespace\classname'
1028
-     *          )
1029
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
1030
-     *      to load an instance of 'some\namespace\classname'
1031
-     *
1032
-     * @param string $alias
1033
-     * @param string $for_class
1034
-     * @return string
1035
-     * @deprecated 4.9.62.p
1036
-     */
1037
-    public function get_alias($alias = '', $for_class = '')
1038
-    {
1039
-        return $this->getFqnForAlias($alias, $for_class);
1040
-    }
24
+	/**
25
+	 * This means that the requested class dependency is not present in the dependency map
26
+	 */
27
+	const not_registered = 0;
28
+
29
+	/**
30
+	 * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
31
+	 */
32
+	const load_new_object = 1;
33
+
34
+	/**
35
+	 * This instructs class loaders to return a previously instantiated and cached object for the requested class.
36
+	 * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
37
+	 */
38
+	const load_from_cache = 2;
39
+
40
+	/**
41
+	 * When registering a dependency,
42
+	 * this indicates to keep any existing dependencies that already exist,
43
+	 * and simply discard any new dependencies declared in the incoming data
44
+	 */
45
+	const KEEP_EXISTING_DEPENDENCIES = 0;
46
+
47
+	/**
48
+	 * When registering a dependency,
49
+	 * this indicates to overwrite any existing dependencies that already exist using the incoming data
50
+	 */
51
+	const OVERWRITE_DEPENDENCIES = 1;
52
+
53
+	/**
54
+	 * @type EE_Dependency_Map $_instance
55
+	 */
56
+	protected static $_instance;
57
+
58
+	/**
59
+	 * @var ClassInterfaceCache $class_cache
60
+	 */
61
+	private $class_cache;
62
+
63
+	/**
64
+	 * @type RequestInterface $request
65
+	 */
66
+	protected $request;
67
+
68
+	/**
69
+	 * @type LegacyRequestInterface $legacy_request
70
+	 */
71
+	protected $legacy_request;
72
+
73
+	/**
74
+	 * @type ResponseInterface $response
75
+	 */
76
+	protected $response;
77
+
78
+	/**
79
+	 * @type LoaderInterface $loader
80
+	 */
81
+	protected $loader;
82
+
83
+	/**
84
+	 * @type array $_dependency_map
85
+	 */
86
+	protected $_dependency_map = [];
87
+
88
+	/**
89
+	 * @type array $_class_loaders
90
+	 */
91
+	protected $_class_loaders = [];
92
+
93
+
94
+	/**
95
+	 * EE_Dependency_Map constructor.
96
+	 *
97
+	 * @param ClassInterfaceCache $class_cache
98
+	 */
99
+	protected function __construct(ClassInterfaceCache $class_cache)
100
+	{
101
+		$this->class_cache = $class_cache;
102
+		do_action('EE_Dependency_Map____construct', $this);
103
+	}
104
+
105
+
106
+	/**
107
+	 * @return void
108
+	 * @throws InvalidAliasException
109
+	 */
110
+	public function initialize()
111
+	{
112
+		$this->_register_core_dependencies();
113
+		$this->_register_core_class_loaders();
114
+		$this->_register_core_aliases();
115
+	}
116
+
117
+
118
+	/**
119
+	 * @singleton method used to instantiate class object
120
+	 * @param ClassInterfaceCache|null $class_cache
121
+	 * @return EE_Dependency_Map
122
+	 */
123
+	public static function instance(ClassInterfaceCache $class_cache = null)
124
+	{
125
+		// check if class object is instantiated, and instantiated properly
126
+		if (
127
+			! EE_Dependency_Map::$_instance instanceof EE_Dependency_Map
128
+			&& $class_cache instanceof ClassInterfaceCache
129
+		) {
130
+			EE_Dependency_Map::$_instance = new EE_Dependency_Map($class_cache);
131
+		}
132
+		return EE_Dependency_Map::$_instance;
133
+	}
134
+
135
+
136
+	/**
137
+	 * @param RequestInterface $request
138
+	 */
139
+	public function setRequest(RequestInterface $request)
140
+	{
141
+		$this->request = $request;
142
+	}
143
+
144
+
145
+	/**
146
+	 * @param LegacyRequestInterface $legacy_request
147
+	 */
148
+	public function setLegacyRequest(LegacyRequestInterface $legacy_request)
149
+	{
150
+		$this->legacy_request = $legacy_request;
151
+	}
152
+
153
+
154
+	/**
155
+	 * @param ResponseInterface $response
156
+	 */
157
+	public function setResponse(ResponseInterface $response)
158
+	{
159
+		$this->response = $response;
160
+	}
161
+
162
+
163
+	/**
164
+	 * @param LoaderInterface $loader
165
+	 */
166
+	public function setLoader(LoaderInterface $loader)
167
+	{
168
+		$this->loader = $loader;
169
+	}
170
+
171
+
172
+	/**
173
+	 * @param string $class
174
+	 * @param array  $dependencies
175
+	 * @param int    $overwrite
176
+	 * @return bool
177
+	 */
178
+	public static function register_dependencies(
179
+		$class,
180
+		array $dependencies,
181
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
182
+	) {
183
+		return EE_Dependency_Map::$_instance->registerDependencies($class, $dependencies, $overwrite);
184
+	}
185
+
186
+
187
+	/**
188
+	 * Assigns an array of class names and corresponding load sources (new or cached)
189
+	 * to the class specified by the first parameter.
190
+	 * IMPORTANT !!!
191
+	 * The order of elements in the incoming $dependencies array MUST match
192
+	 * the order of the constructor parameters for the class in question.
193
+	 * This is especially important when overriding any existing dependencies that are registered.
194
+	 * the third parameter controls whether any duplicate dependencies are overwritten or not.
195
+	 *
196
+	 * @param string $class
197
+	 * @param array  $dependencies
198
+	 * @param int    $overwrite
199
+	 * @return bool
200
+	 */
201
+	public function registerDependencies(
202
+		$class,
203
+		array $dependencies,
204
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
205
+	) {
206
+		$class      = trim($class, '\\');
207
+		$registered = false;
208
+		if (empty(EE_Dependency_Map::$_instance->_dependency_map[ $class ])) {
209
+			EE_Dependency_Map::$_instance->_dependency_map[ $class ] = [];
210
+		}
211
+		// we need to make sure that any aliases used when registering a dependency
212
+		// get resolved to the correct class name
213
+		foreach ($dependencies as $dependency => $load_source) {
214
+			$alias = EE_Dependency_Map::$_instance->getFqnForAlias($dependency);
215
+			if (
216
+				$overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
217
+				|| ! isset(EE_Dependency_Map::$_instance->_dependency_map[ $class ][ $alias ])
218
+			) {
219
+				unset($dependencies[ $dependency ]);
220
+				$dependencies[ $alias ] = $load_source;
221
+				$registered             = true;
222
+			}
223
+		}
224
+		// now add our two lists of dependencies together.
225
+		// using Union (+=) favours the arrays in precedence from left to right,
226
+		// so $dependencies is NOT overwritten because it is listed first
227
+		// ie: with A = B + C, entries in B take precedence over duplicate entries in C
228
+		// Union is way faster than array_merge() but should be used with caution...
229
+		// especially with numerically indexed arrays
230
+		$dependencies += EE_Dependency_Map::$_instance->_dependency_map[ $class ];
231
+		// now we need to ensure that the resulting dependencies
232
+		// array only has the entries that are required for the class
233
+		// so first count how many dependencies were originally registered for the class
234
+		$dependency_count = count(EE_Dependency_Map::$_instance->_dependency_map[ $class ]);
235
+		// if that count is non-zero (meaning dependencies were already registered)
236
+		EE_Dependency_Map::$_instance->_dependency_map[ $class ] = $dependency_count
237
+			// then truncate the  final array to match that count
238
+			? array_slice($dependencies, 0, $dependency_count)
239
+			// otherwise just take the incoming array because nothing previously existed
240
+			: $dependencies;
241
+		return $registered;
242
+	}
243
+
244
+
245
+	/**
246
+	 * @param string $class_name
247
+	 * @param string $loader
248
+	 * @return bool
249
+	 * @throws DomainException
250
+	 */
251
+	public static function register_class_loader($class_name, $loader = 'load_core')
252
+	{
253
+		return EE_Dependency_Map::$_instance->registerClassLoader($class_name, $loader);
254
+	}
255
+
256
+
257
+	/**
258
+	 * @param string $class_name
259
+	 * @param string $loader
260
+	 * @return bool
261
+	 * @throws DomainException
262
+	 */
263
+	public function registerClassLoader($class_name, $loader = 'load_core')
264
+	{
265
+		if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
266
+			throw new DomainException(
267
+				esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
268
+			);
269
+		}
270
+		// check that loader is callable or method starts with "load_" and exists in EE_Registry
271
+		if (
272
+			! is_callable($loader)
273
+			&& (
274
+				strpos($loader, 'load_') !== 0
275
+				|| ! method_exists('EE_Registry', $loader)
276
+			)
277
+		) {
278
+			throw new DomainException(
279
+				sprintf(
280
+					esc_html__(
281
+						'"%1$s" is not a valid loader method on EE_Registry.',
282
+						'event_espresso'
283
+					),
284
+					$loader
285
+				)
286
+			);
287
+		}
288
+		$class_name = EE_Dependency_Map::$_instance->getFqnForAlias($class_name);
289
+		if (! isset(EE_Dependency_Map::$_instance->_class_loaders[ $class_name ])) {
290
+			EE_Dependency_Map::$_instance->_class_loaders[ $class_name ] = $loader;
291
+			return true;
292
+		}
293
+		return false;
294
+	}
295
+
296
+
297
+	/**
298
+	 * @return array
299
+	 */
300
+	public function dependency_map()
301
+	{
302
+		return $this->_dependency_map;
303
+	}
304
+
305
+
306
+	/**
307
+	 * returns TRUE if dependency map contains a listing for the provided class name
308
+	 *
309
+	 * @param string $class_name
310
+	 * @return boolean
311
+	 */
312
+	public function has($class_name = '')
313
+	{
314
+		// all legacy models have the same dependencies
315
+		if (strpos($class_name, 'EEM_') === 0) {
316
+			$class_name = 'LEGACY_MODELS';
317
+		}
318
+		return isset($this->_dependency_map[ $class_name ]);
319
+	}
320
+
321
+
322
+	/**
323
+	 * returns TRUE if dependency map contains a listing for the provided class name AND dependency
324
+	 *
325
+	 * @param string $class_name
326
+	 * @param string $dependency
327
+	 * @return bool
328
+	 */
329
+	public function has_dependency_for_class($class_name = '', $dependency = '')
330
+	{
331
+		// all legacy models have the same dependencies
332
+		if (strpos($class_name, 'EEM_') === 0) {
333
+			$class_name = 'LEGACY_MODELS';
334
+		}
335
+		$dependency = $this->getFqnForAlias($dependency, $class_name);
336
+		return isset($this->_dependency_map[ $class_name ][ $dependency ]);
337
+	}
338
+
339
+
340
+	/**
341
+	 * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
342
+	 *
343
+	 * @param string $class_name
344
+	 * @param string $dependency
345
+	 * @return int
346
+	 */
347
+	public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
348
+	{
349
+		// all legacy models have the same dependencies
350
+		if (strpos($class_name, 'EEM_') === 0) {
351
+			$class_name = 'LEGACY_MODELS';
352
+		}
353
+		$dependency = $this->getFqnForAlias($dependency);
354
+		return $this->has_dependency_for_class($class_name, $dependency)
355
+			? $this->_dependency_map[ $class_name ][ $dependency ]
356
+			: EE_Dependency_Map::not_registered;
357
+	}
358
+
359
+
360
+	/**
361
+	 * @param string $class_name
362
+	 * @return string | Closure
363
+	 */
364
+	public function class_loader($class_name)
365
+	{
366
+		// all legacy models use load_model()
367
+		if (strpos($class_name, 'EEM_') === 0) {
368
+			return 'load_model';
369
+		}
370
+		// EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc
371
+		// perform strpos() first to avoid loading regex every time we load a class
372
+		if (
373
+			strpos($class_name, 'EE_CPT_') === 0
374
+			&& preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name)
375
+		) {
376
+			return 'load_core';
377
+		}
378
+		$class_name = $this->getFqnForAlias($class_name);
379
+		return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
380
+	}
381
+
382
+
383
+	/**
384
+	 * @return array
385
+	 */
386
+	public function class_loaders()
387
+	{
388
+		return $this->_class_loaders;
389
+	}
390
+
391
+
392
+	/**
393
+	 * adds an alias for a classname
394
+	 *
395
+	 * @param string $fqcn      the class name that should be used (concrete class to replace interface)
396
+	 * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
397
+	 * @param string $for_class the class that has the dependency (is type hinting for the interface)
398
+	 * @throws InvalidAliasException
399
+	 */
400
+	public function add_alias($fqcn, $alias, $for_class = '')
401
+	{
402
+		$this->class_cache->addAlias($fqcn, $alias, $for_class);
403
+	}
404
+
405
+
406
+	/**
407
+	 * Returns TRUE if the provided fully qualified name IS an alias
408
+	 * WHY?
409
+	 * Because if a class is type hinting for a concretion,
410
+	 * then why would we need to find another class to supply it?
411
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
412
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
413
+	 * Don't go looking for some substitute.
414
+	 * Whereas if a class is type hinting for an interface...
415
+	 * then we need to find an actual class to use.
416
+	 * So the interface IS the alias for some other FQN,
417
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
418
+	 * represents some other class.
419
+	 *
420
+	 * @param string $fqn
421
+	 * @param string $for_class
422
+	 * @return bool
423
+	 */
424
+	public function isAlias($fqn = '', $for_class = '')
425
+	{
426
+		return $this->class_cache->isAlias($fqn, $for_class);
427
+	}
428
+
429
+
430
+	/**
431
+	 * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
432
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
433
+	 *  for example:
434
+	 *      if the following two entries were added to the _aliases array:
435
+	 *          array(
436
+	 *              'interface_alias'           => 'some\namespace\interface'
437
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
438
+	 *          )
439
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
440
+	 *      to load an instance of 'some\namespace\classname'
441
+	 *
442
+	 * @param string $alias
443
+	 * @param string $for_class
444
+	 * @return string
445
+	 */
446
+	public function getFqnForAlias($alias = '', $for_class = '')
447
+	{
448
+		return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
449
+	}
450
+
451
+
452
+	/**
453
+	 * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
454
+	 * if one exists, or whether a new object should be generated every time the requested class is loaded.
455
+	 * This is done by using the following class constants:
456
+	 *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
457
+	 *        EE_Dependency_Map::load_new_object - generates a new object every time
458
+	 */
459
+	protected function _register_core_dependencies()
460
+	{
461
+		$this->_dependency_map = [
462
+			'EE_Request_Handler'                                                                                          => [
463
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
464
+			],
465
+			'EE_System'                                                                                                   => [
466
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
467
+				'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
468
+				'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
469
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
470
+				'EventEspresso\core\services\routing\Router'  => EE_Dependency_Map::load_from_cache,
471
+			],
472
+			'EE_Admin'                                                                                                    => [
473
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
474
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
475
+			],
476
+			'EE_Cart'                                                                                                     => [
477
+				'EE_Session' => EE_Dependency_Map::load_from_cache,
478
+			],
479
+			'EE_Messenger_Collection_Loader'                                                                              => [
480
+				'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
481
+			],
482
+			'EE_Message_Type_Collection_Loader'                                                                           => [
483
+				'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
484
+			],
485
+			'EE_Message_Resource_Manager'                                                                                 => [
486
+				'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
487
+				'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
488
+				'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
489
+			],
490
+			'EE_Message_Factory'                                                                                          => [
491
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
492
+			],
493
+			'EE_messages'                                                                                                 => [
494
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
495
+			],
496
+			'EE_Messages_Generator'                                                                                       => [
497
+				'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
498
+				'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
499
+				'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
500
+				'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
501
+			],
502
+			'EE_Messages_Processor'                                                                                       => [
503
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
504
+			],
505
+			'EE_Messages_Queue'                                                                                           => [
506
+				'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
507
+			],
508
+			'EE_Messages_Template_Defaults'                                                                               => [
509
+				'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
510
+				'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
511
+			],
512
+			'EE_Message_To_Generate_From_Request'                                                                         => [
513
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
514
+				'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
515
+			],
516
+			'EventEspresso\core\services\commands\CommandBus'                                                             => [
517
+				'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
518
+			],
519
+			'EventEspresso\services\commands\CommandHandler'                                                              => [
520
+				'EE_Registry'         => EE_Dependency_Map::load_from_cache,
521
+				'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
522
+			],
523
+			'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => [
524
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
525
+			],
526
+			'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => [
527
+				'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
528
+				'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
529
+			],
530
+			'EventEspresso\core\services\commands\CommandFactory'                                                         => [
531
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
532
+			],
533
+			'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => [
534
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
535
+			],
536
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => [
537
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
538
+			],
539
+			'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => [
540
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
541
+			],
542
+			'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => [
543
+				'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
544
+			],
545
+			'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => [
546
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
547
+			],
548
+			'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => [
549
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
550
+			],
551
+			'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => [
552
+				'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
553
+			],
554
+			'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => [
555
+				'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
556
+			],
557
+			'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => [
558
+				'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
559
+			],
560
+			'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => [
561
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
562
+			],
563
+			'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => [
564
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
565
+			],
566
+			'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => [
567
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
568
+			],
569
+			'EventEspresso\core\services\database\TableManager'                                                           => [
570
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
571
+			],
572
+			'EE_Data_Migration_Class_Base'                                                                                => [
573
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
574
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
575
+			],
576
+			'EE_DMS_Core_4_1_0'                                                                                           => [
577
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
578
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
579
+			],
580
+			'EE_DMS_Core_4_2_0'                                                                                           => [
581
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
582
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
583
+			],
584
+			'EE_DMS_Core_4_3_0'                                                                                           => [
585
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
586
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
587
+			],
588
+			'EE_DMS_Core_4_4_0'                                                                                           => [
589
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
590
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
591
+			],
592
+			'EE_DMS_Core_4_5_0'                                                                                           => [
593
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
594
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
595
+			],
596
+			'EE_DMS_Core_4_6_0'                                                                                           => [
597
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
598
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
599
+			],
600
+			'EE_DMS_Core_4_7_0'                                                                                           => [
601
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
602
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
603
+			],
604
+			'EE_DMS_Core_4_8_0'                                                                                           => [
605
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
606
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
607
+			],
608
+			'EE_DMS_Core_4_9_0'                                                                                           => [
609
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
610
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
611
+			],
612
+			'EE_DMS_Core_4_10_0'                                                                                          => [
613
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
614
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
615
+				'EE_DMS_Core_4_9_0'                                  => EE_Dependency_Map::load_from_cache,
616
+			],
617
+			'EE_DMS_Core_4_11_0'                                                                                          => [
618
+				'EE_DMS_Core_4_10_0'                                 => EE_Dependency_Map::load_from_cache,
619
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
620
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
621
+			],
622
+			'EventEspresso\core\services\assets\Registry'                                                                 => [
623
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_new_object,
624
+				'EventEspresso\core\services\assets\AssetManifest'   => EE_Dependency_Map::load_from_cache,
625
+			],
626
+			'EventEspresso\core\services\cache\BasicCacheManager'                                                         => [
627
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
628
+			],
629
+			'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => [
630
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
631
+			],
632
+			'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => [
633
+				'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
634
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
635
+			],
636
+			'EventEspresso\core\domain\values\EmailAddress'                                                               => [
637
+				null,
638
+				'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
639
+			],
640
+			'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => [
641
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
642
+			],
643
+			'LEGACY_MODELS'                                                                                               => [
644
+				null,
645
+				'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
646
+			],
647
+			'EE_Module_Request_Router'                                                                                    => [
648
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
649
+			],
650
+			'EE_Registration_Processor'                                                                                   => [
651
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
652
+			],
653
+			'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => [
654
+				null,
655
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
656
+				'EventEspresso\core\services\request\Request'                         => EE_Dependency_Map::load_from_cache,
657
+			],
658
+			'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => [
659
+				'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
660
+				'EE_Session'             => EE_Dependency_Map::load_from_cache,
661
+			],
662
+			'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => [
663
+				'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
664
+				'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
665
+				'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
666
+				'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
667
+				'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
668
+			],
669
+			'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => [
670
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
671
+			],
672
+			'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => [
673
+				'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
674
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
675
+			],
676
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => [
677
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
678
+			],
679
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => [
680
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
681
+			],
682
+			'EE_CPT_Strategy'                                                                                             => [
683
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
684
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
685
+			],
686
+			'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => [
687
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
688
+			],
689
+			'EventEspresso\core\CPTs\CptQueryModifier'                                                                    => [
690
+				null,
691
+				null,
692
+				null,
693
+				'EE_Request_Handler'                          => EE_Dependency_Map::load_from_cache,
694
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
695
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
696
+			],
697
+			'EventEspresso\core\services\dependencies\DependencyResolver'                                                 => [
698
+				'EventEspresso\core\services\container\Mirror'            => EE_Dependency_Map::load_from_cache,
699
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
700
+				'EE_Dependency_Map'                                       => EE_Dependency_Map::load_from_cache,
701
+			],
702
+			'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver'                               => [
703
+				'EventEspresso\core\services\container\Mirror'            => EE_Dependency_Map::load_from_cache,
704
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
705
+				'EE_Dependency_Map'                                       => EE_Dependency_Map::load_from_cache,
706
+			],
707
+			'EventEspresso\core\services\routing\RouteMatchSpecificationFactory'                                          => [
708
+				'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache,
709
+				'EventEspresso\core\services\loaders\Loader'                                    => EE_Dependency_Map::load_from_cache,
710
+			],
711
+			'EventEspresso\core\services\routing\RouteMatchSpecificationManager'                                          => [
712
+				'EventEspresso\core\services\routing\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache,
713
+				'EventEspresso\core\services\routing\RouteMatchSpecificationFactory'    => EE_Dependency_Map::load_from_cache,
714
+			],
715
+			'EE_URL_Validation_Strategy'                                                                                  => [
716
+				null,
717
+				null,
718
+				'EventEspresso\core\services\validators\URLValidator' => EE_Dependency_Map::load_from_cache,
719
+			],
720
+			'EventEspresso\core\services\request\files\FilesDataHandler'                                                  => [
721
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
722
+			],
723
+			'EventEspressoBatchRequest\BatchRequestProcessor'                                                             => [
724
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
725
+			],
726
+			'EventEspresso\core\domain\services\converters\RestApiSpoofer'                                                => [
727
+				'WP_REST_Server'                                               => EE_Dependency_Map::load_from_cache,
728
+				'EED_Core_Rest_Api'                                            => EE_Dependency_Map::load_from_cache,
729
+				'EventEspresso\core\libraries\rest_api\controllers\model\Read' => EE_Dependency_Map::load_from_cache,
730
+				null,
731
+			],
732
+			'EventEspresso\core\services\routing\RouteHandler'                                                            => [
733
+				'EventEspresso\core\services\json\JsonDataNodeHandler' => EE_Dependency_Map::load_from_cache,
734
+				'EventEspresso\core\services\loaders\Loader'           => EE_Dependency_Map::load_from_cache,
735
+				'EventEspresso\core\services\request\Request'          => EE_Dependency_Map::load_from_cache,
736
+				'EventEspresso\core\services\routing\RouteCollection'  => EE_Dependency_Map::load_from_cache,
737
+			],
738
+			'EventEspresso\core\services\json\JsonDataNodeHandler'                                                        => [
739
+				'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache,
740
+			],
741
+			'EventEspresso\core\services\routing\Router'                                                                  => [
742
+				'EE_Dependency_Map'                                => EE_Dependency_Map::load_from_cache,
743
+				'EventEspresso\core\services\loaders\Loader'       => EE_Dependency_Map::load_from_cache,
744
+				'EventEspresso\core\services\routing\RouteHandler' => EE_Dependency_Map::load_from_cache,
745
+			],
746
+			'EventEspresso\core\services\assets\AssetManifest'                                                            => [
747
+				'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
748
+			],
749
+			'EventEspresso\core\services\assets\AssetManifestFactory'                                                     => [
750
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
751
+			],
752
+			'EventEspresso\core\services\assets\BaristaFactory'                                                           => [
753
+				'EventEspresso\core\services\assets\AssetManifestFactory' => EE_Dependency_Map::load_from_cache,
754
+				'EventEspresso\core\services\loaders\Loader'              => EE_Dependency_Map::load_from_cache,
755
+			],
756
+			'EventEspresso\core\domain\services\capabilities\FeatureFlags'                                                => [
757
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
758
+			],
759
+			'EventEspresso\core\services\addon\AddonManager' => [
760
+				'EventEspresso\core\services\addon\AddonCollection'              => EE_Dependency_Map::load_from_cache,
761
+				'EventEspresso\core\Psr4Autoloader'                              => EE_Dependency_Map::load_from_cache,
762
+				'EventEspresso\core\services\addon\api\v1\RegisterAddon'         => EE_Dependency_Map::load_from_cache,
763
+				'EventEspresso\core\services\addon\api\IncompatibleAddonHandler' => EE_Dependency_Map::load_from_cache,
764
+				'EventEspresso\core\services\addon\api\ThirdPartyPluginHandler'  => EE_Dependency_Map::load_from_cache,
765
+			],
766
+			'EventEspresso\core\services\addon\api\ThirdPartyPluginHandler' => [
767
+				'EventEspresso\core\services\request\Request'  => EE_Dependency_Map::load_from_cache,
768
+			],
769
+		];
770
+	}
771
+
772
+
773
+	/**
774
+	 * Registers how core classes are loaded.
775
+	 * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
776
+	 *        'EE_Request_Handler' => 'load_core'
777
+	 *        'EE_Messages_Queue'  => 'load_lib'
778
+	 *        'EEH_Debug_Tools'    => 'load_helper'
779
+	 * or, if greater control is required, by providing a custom closure. For example:
780
+	 *        'Some_Class' => function () {
781
+	 *            return new Some_Class();
782
+	 *        },
783
+	 * This is required for instantiating dependencies
784
+	 * where an interface has been type hinted in a class constructor. For example:
785
+	 *        'Required_Interface' => function () {
786
+	 *            return new A_Class_That_Implements_Required_Interface();
787
+	 *        },
788
+	 */
789
+	protected function _register_core_class_loaders()
790
+	{
791
+		$this->_class_loaders = [
792
+			// load_core
793
+			'EE_Dependency_Map'                            => function () {
794
+				return $this;
795
+			},
796
+			'EE_Capabilities'                              => 'load_core',
797
+			'EE_Encryption'                                => 'load_core',
798
+			'EE_Front_Controller'                          => 'load_core',
799
+			'EE_Module_Request_Router'                     => 'load_core',
800
+			'EE_Registry'                                  => 'load_core',
801
+			'EE_Request'                                   => function () {
802
+				return $this->legacy_request;
803
+			},
804
+			'EventEspresso\core\services\request\Request'  => function () {
805
+				return $this->request;
806
+			},
807
+			'EventEspresso\core\services\request\Response' => function () {
808
+				return $this->response;
809
+			},
810
+			'EE_Base'                                      => 'load_core',
811
+			'EE_Request_Handler'                           => 'load_core',
812
+			'EE_Session'                                   => 'load_core',
813
+			'EE_Cron_Tasks'                                => 'load_core',
814
+			'EE_System'                                    => 'load_core',
815
+			'EE_Maintenance_Mode'                          => 'load_core',
816
+			'EE_Register_CPTs'                             => 'load_core',
817
+			'EE_Admin'                                     => 'load_core',
818
+			'EE_CPT_Strategy'                              => 'load_core',
819
+			// load_class
820
+			'EE_Registration_Processor'                    => 'load_class',
821
+			// load_lib
822
+			'EE_Message_Resource_Manager'                  => 'load_lib',
823
+			'EE_Message_Type_Collection'                   => 'load_lib',
824
+			'EE_Message_Type_Collection_Loader'            => 'load_lib',
825
+			'EE_Messenger_Collection'                      => 'load_lib',
826
+			'EE_Messenger_Collection_Loader'               => 'load_lib',
827
+			'EE_Messages_Processor'                        => 'load_lib',
828
+			'EE_Message_Repository'                        => 'load_lib',
829
+			'EE_Messages_Queue'                            => 'load_lib',
830
+			'EE_Messages_Data_Handler_Collection'          => 'load_lib',
831
+			'EE_Message_Template_Group_Collection'         => 'load_lib',
832
+			'EE_Payment_Method_Manager'                    => 'load_lib',
833
+			'EE_DMS_Core_4_1_0'                            => 'load_dms',
834
+			'EE_DMS_Core_4_2_0'                            => 'load_dms',
835
+			'EE_DMS_Core_4_3_0'                            => 'load_dms',
836
+			'EE_DMS_Core_4_5_0'                            => 'load_dms',
837
+			'EE_DMS_Core_4_6_0'                            => 'load_dms',
838
+			'EE_DMS_Core_4_7_0'                            => 'load_dms',
839
+			'EE_DMS_Core_4_8_0'                            => 'load_dms',
840
+			'EE_DMS_Core_4_9_0'                            => 'load_dms',
841
+			'EE_DMS_Core_4_10_0'                           => 'load_dms',
842
+			'EE_DMS_Core_4_11_0'                           => 'load_dms',
843
+			'EE_Messages_Generator'                        => static function () {
844
+				return EE_Registry::instance()->load_lib(
845
+					'Messages_Generator',
846
+					[],
847
+					false,
848
+					false
849
+				);
850
+			},
851
+			'EE_Messages_Template_Defaults'                => static function ($arguments = []) {
852
+				return EE_Registry::instance()->load_lib(
853
+					'Messages_Template_Defaults',
854
+					$arguments,
855
+					false,
856
+					false
857
+				);
858
+			},
859
+			// load_helper
860
+			'EEH_Parse_Shortcodes'                         => static function () {
861
+				if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
862
+					return new EEH_Parse_Shortcodes();
863
+				}
864
+				return null;
865
+			},
866
+			'EE_Template_Config'                           => static function () {
867
+				return EE_Config::instance()->template_settings;
868
+			},
869
+			'EE_Currency_Config'                           => static function () {
870
+				return EE_Config::instance()->currency;
871
+			},
872
+			'EE_Registration_Config'                       => static function () {
873
+				return EE_Config::instance()->registration;
874
+			},
875
+			'EE_Core_Config'                               => static function () {
876
+				return EE_Config::instance()->core;
877
+			},
878
+			'EventEspresso\core\services\loaders\Loader'   => static function () {
879
+				return LoaderFactory::getLoader();
880
+			},
881
+			'EE_Network_Config'                            => static function () {
882
+				return EE_Network_Config::instance();
883
+			},
884
+			'EE_Config'                                    => static function () {
885
+				return EE_Config::instance();
886
+			},
887
+			'EventEspresso\core\domain\Domain'             => static function () {
888
+				return DomainFactory::getEventEspressoCoreDomain();
889
+			},
890
+			'EE_Admin_Config'                              => static function () {
891
+				return EE_Config::instance()->admin;
892
+			},
893
+			'EE_Organization_Config'                       => static function () {
894
+				return EE_Config::instance()->organization;
895
+			},
896
+			'EE_Network_Core_Config'                       => static function () {
897
+				return EE_Network_Config::instance()->core;
898
+			},
899
+			'EE_Environment_Config'                        => static function () {
900
+				return EE_Config::instance()->environment;
901
+			},
902
+			'EED_Core_Rest_Api'                            => static function () {
903
+				return EED_Core_Rest_Api::instance();
904
+			},
905
+			'WP_REST_Server'                               => static function () {
906
+				return rest_get_server();
907
+			},
908
+			'EventEspresso\core\Psr4Autoloader'            => static function () {
909
+				return EE_Psr4AutoloaderInit::psr4_loader();
910
+			},
911
+		];
912
+	}
913
+
914
+
915
+	/**
916
+	 * can be used for supplying alternate names for classes,
917
+	 * or for connecting interface names to instantiable classes
918
+	 *
919
+	 * @throws InvalidAliasException
920
+	 */
921
+	protected function _register_core_aliases()
922
+	{
923
+		$aliases = [
924
+			'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
925
+			'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
926
+			'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
927
+			'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
928
+			'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
929
+			'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
930
+			'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
931
+			'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
932
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
933
+			'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
934
+			'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
935
+			'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
936
+			'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
937
+			'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
938
+			'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
939
+			'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
940
+			'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
941
+			'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
942
+			'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
943
+			'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
944
+			'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
945
+			'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
946
+			'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
947
+			'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
948
+			'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
949
+			'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
950
+			'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
951
+			'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
952
+			'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
953
+			'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
954
+			'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
955
+			'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
956
+			'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
957
+			'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
958
+			'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
959
+			'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
960
+			'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
961
+			'Registration_Processor'                                                       => 'EE_Registration_Processor',
962
+			'EventEspresso\core\services\assets\AssetManifestInterface'                    => 'EventEspresso\core\services\assets\AssetManifest',
963
+		];
964
+		foreach ($aliases as $alias => $fqn) {
965
+			if (is_array($fqn)) {
966
+				foreach ($fqn as $class => $for_class) {
967
+					$this->class_cache->addAlias($class, $alias, $for_class);
968
+				}
969
+				continue;
970
+			}
971
+			$this->class_cache->addAlias($fqn, $alias);
972
+		}
973
+		if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
974
+			$this->class_cache->addAlias(
975
+				'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
976
+				'EventEspresso\core\services\notices\NoticeConverterInterface'
977
+			);
978
+		}
979
+	}
980
+
981
+
982
+	/**
983
+	 * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
984
+	 * request Primarily used by unit tests.
985
+	 */
986
+	public function reset()
987
+	{
988
+		$this->_register_core_class_loaders();
989
+		$this->_register_core_dependencies();
990
+	}
991
+
992
+
993
+	/**
994
+	 * PLZ NOTE: a better name for this method would be is_alias()
995
+	 * because it returns TRUE if the provided fully qualified name IS an alias
996
+	 * WHY?
997
+	 * Because if a class is type hinting for a concretion,
998
+	 * then why would we need to find another class to supply it?
999
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
1000
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
1001
+	 * Don't go looking for some substitute.
1002
+	 * Whereas if a class is type hinting for an interface...
1003
+	 * then we need to find an actual class to use.
1004
+	 * So the interface IS the alias for some other FQN,
1005
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
1006
+	 * represents some other class.
1007
+	 *
1008
+	 * @param string $fqn
1009
+	 * @param string $for_class
1010
+	 * @return bool
1011
+	 * @deprecated 4.9.62.p
1012
+	 */
1013
+	public function has_alias($fqn = '', $for_class = '')
1014
+	{
1015
+		return $this->isAlias($fqn, $for_class);
1016
+	}
1017
+
1018
+
1019
+	/**
1020
+	 * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
1021
+	 * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
1022
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
1023
+	 *  for example:
1024
+	 *      if the following two entries were added to the _aliases array:
1025
+	 *          array(
1026
+	 *              'interface_alias'           => 'some\namespace\interface'
1027
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
1028
+	 *          )
1029
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
1030
+	 *      to load an instance of 'some\namespace\classname'
1031
+	 *
1032
+	 * @param string $alias
1033
+	 * @param string $for_class
1034
+	 * @return string
1035
+	 * @deprecated 4.9.62.p
1036
+	 */
1037
+	public function get_alias($alias = '', $for_class = '')
1038
+	{
1039
+		return $this->getFqnForAlias($alias, $for_class);
1040
+	}
1041 1041
 }
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
     ) {
206 206
         $class      = trim($class, '\\');
207 207
         $registered = false;
208
-        if (empty(EE_Dependency_Map::$_instance->_dependency_map[ $class ])) {
209
-            EE_Dependency_Map::$_instance->_dependency_map[ $class ] = [];
208
+        if (empty(EE_Dependency_Map::$_instance->_dependency_map[$class])) {
209
+            EE_Dependency_Map::$_instance->_dependency_map[$class] = [];
210 210
         }
211 211
         // we need to make sure that any aliases used when registering a dependency
212 212
         // get resolved to the correct class name
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
             $alias = EE_Dependency_Map::$_instance->getFqnForAlias($dependency);
215 215
             if (
216 216
                 $overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
217
-                || ! isset(EE_Dependency_Map::$_instance->_dependency_map[ $class ][ $alias ])
217
+                || ! isset(EE_Dependency_Map::$_instance->_dependency_map[$class][$alias])
218 218
             ) {
219
-                unset($dependencies[ $dependency ]);
220
-                $dependencies[ $alias ] = $load_source;
219
+                unset($dependencies[$dependency]);
220
+                $dependencies[$alias] = $load_source;
221 221
                 $registered             = true;
222 222
             }
223 223
         }
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
         // ie: with A = B + C, entries in B take precedence over duplicate entries in C
228 228
         // Union is way faster than array_merge() but should be used with caution...
229 229
         // especially with numerically indexed arrays
230
-        $dependencies += EE_Dependency_Map::$_instance->_dependency_map[ $class ];
230
+        $dependencies += EE_Dependency_Map::$_instance->_dependency_map[$class];
231 231
         // now we need to ensure that the resulting dependencies
232 232
         // array only has the entries that are required for the class
233 233
         // so first count how many dependencies were originally registered for the class
234
-        $dependency_count = count(EE_Dependency_Map::$_instance->_dependency_map[ $class ]);
234
+        $dependency_count = count(EE_Dependency_Map::$_instance->_dependency_map[$class]);
235 235
         // if that count is non-zero (meaning dependencies were already registered)
236
-        EE_Dependency_Map::$_instance->_dependency_map[ $class ] = $dependency_count
236
+        EE_Dependency_Map::$_instance->_dependency_map[$class] = $dependency_count
237 237
             // then truncate the  final array to match that count
238 238
             ? array_slice($dependencies, 0, $dependency_count)
239 239
             // otherwise just take the incoming array because nothing previously existed
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      */
263 263
     public function registerClassLoader($class_name, $loader = 'load_core')
264 264
     {
265
-        if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
265
+        if ( ! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
266 266
             throw new DomainException(
267 267
                 esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
268 268
             );
@@ -286,8 +286,8 @@  discard block
 block discarded – undo
286 286
             );
287 287
         }
288 288
         $class_name = EE_Dependency_Map::$_instance->getFqnForAlias($class_name);
289
-        if (! isset(EE_Dependency_Map::$_instance->_class_loaders[ $class_name ])) {
290
-            EE_Dependency_Map::$_instance->_class_loaders[ $class_name ] = $loader;
289
+        if ( ! isset(EE_Dependency_Map::$_instance->_class_loaders[$class_name])) {
290
+            EE_Dependency_Map::$_instance->_class_loaders[$class_name] = $loader;
291 291
             return true;
292 292
         }
293 293
         return false;
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         if (strpos($class_name, 'EEM_') === 0) {
316 316
             $class_name = 'LEGACY_MODELS';
317 317
         }
318
-        return isset($this->_dependency_map[ $class_name ]);
318
+        return isset($this->_dependency_map[$class_name]);
319 319
     }
320 320
 
321 321
 
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
             $class_name = 'LEGACY_MODELS';
334 334
         }
335 335
         $dependency = $this->getFqnForAlias($dependency, $class_name);
336
-        return isset($this->_dependency_map[ $class_name ][ $dependency ]);
336
+        return isset($this->_dependency_map[$class_name][$dependency]);
337 337
     }
338 338
 
339 339
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
         }
353 353
         $dependency = $this->getFqnForAlias($dependency);
354 354
         return $this->has_dependency_for_class($class_name, $dependency)
355
-            ? $this->_dependency_map[ $class_name ][ $dependency ]
355
+            ? $this->_dependency_map[$class_name][$dependency]
356 356
             : EE_Dependency_Map::not_registered;
357 357
     }
358 358
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             return 'load_core';
377 377
         }
378 378
         $class_name = $this->getFqnForAlias($class_name);
379
-        return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
379
+        return isset($this->_class_loaders[$class_name]) ? $this->_class_loaders[$class_name] : '';
380 380
     }
381 381
 
382 382
 
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
     {
791 791
         $this->_class_loaders = [
792 792
             // load_core
793
-            'EE_Dependency_Map'                            => function () {
793
+            'EE_Dependency_Map'                            => function() {
794 794
                 return $this;
795 795
             },
796 796
             'EE_Capabilities'                              => 'load_core',
@@ -798,13 +798,13 @@  discard block
 block discarded – undo
798 798
             'EE_Front_Controller'                          => 'load_core',
799 799
             'EE_Module_Request_Router'                     => 'load_core',
800 800
             'EE_Registry'                                  => 'load_core',
801
-            'EE_Request'                                   => function () {
801
+            'EE_Request'                                   => function() {
802 802
                 return $this->legacy_request;
803 803
             },
804
-            'EventEspresso\core\services\request\Request'  => function () {
804
+            'EventEspresso\core\services\request\Request'  => function() {
805 805
                 return $this->request;
806 806
             },
807
-            'EventEspresso\core\services\request\Response' => function () {
807
+            'EventEspresso\core\services\request\Response' => function() {
808 808
                 return $this->response;
809 809
             },
810 810
             'EE_Base'                                      => 'load_core',
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
             'EE_DMS_Core_4_9_0'                            => 'load_dms',
841 841
             'EE_DMS_Core_4_10_0'                           => 'load_dms',
842 842
             'EE_DMS_Core_4_11_0'                           => 'load_dms',
843
-            'EE_Messages_Generator'                        => static function () {
843
+            'EE_Messages_Generator'                        => static function() {
844 844
                 return EE_Registry::instance()->load_lib(
845 845
                     'Messages_Generator',
846 846
                     [],
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
                     false
849 849
                 );
850 850
             },
851
-            'EE_Messages_Template_Defaults'                => static function ($arguments = []) {
851
+            'EE_Messages_Template_Defaults'                => static function($arguments = []) {
852 852
                 return EE_Registry::instance()->load_lib(
853 853
                     'Messages_Template_Defaults',
854 854
                     $arguments,
@@ -857,55 +857,55 @@  discard block
 block discarded – undo
857 857
                 );
858 858
             },
859 859
             // load_helper
860
-            'EEH_Parse_Shortcodes'                         => static function () {
860
+            'EEH_Parse_Shortcodes'                         => static function() {
861 861
                 if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
862 862
                     return new EEH_Parse_Shortcodes();
863 863
                 }
864 864
                 return null;
865 865
             },
866
-            'EE_Template_Config'                           => static function () {
866
+            'EE_Template_Config'                           => static function() {
867 867
                 return EE_Config::instance()->template_settings;
868 868
             },
869
-            'EE_Currency_Config'                           => static function () {
869
+            'EE_Currency_Config'                           => static function() {
870 870
                 return EE_Config::instance()->currency;
871 871
             },
872
-            'EE_Registration_Config'                       => static function () {
872
+            'EE_Registration_Config'                       => static function() {
873 873
                 return EE_Config::instance()->registration;
874 874
             },
875
-            'EE_Core_Config'                               => static function () {
875
+            'EE_Core_Config'                               => static function() {
876 876
                 return EE_Config::instance()->core;
877 877
             },
878
-            'EventEspresso\core\services\loaders\Loader'   => static function () {
878
+            'EventEspresso\core\services\loaders\Loader'   => static function() {
879 879
                 return LoaderFactory::getLoader();
880 880
             },
881
-            'EE_Network_Config'                            => static function () {
881
+            'EE_Network_Config'                            => static function() {
882 882
                 return EE_Network_Config::instance();
883 883
             },
884
-            'EE_Config'                                    => static function () {
884
+            'EE_Config'                                    => static function() {
885 885
                 return EE_Config::instance();
886 886
             },
887
-            'EventEspresso\core\domain\Domain'             => static function () {
887
+            'EventEspresso\core\domain\Domain'             => static function() {
888 888
                 return DomainFactory::getEventEspressoCoreDomain();
889 889
             },
890
-            'EE_Admin_Config'                              => static function () {
890
+            'EE_Admin_Config'                              => static function() {
891 891
                 return EE_Config::instance()->admin;
892 892
             },
893
-            'EE_Organization_Config'                       => static function () {
893
+            'EE_Organization_Config'                       => static function() {
894 894
                 return EE_Config::instance()->organization;
895 895
             },
896
-            'EE_Network_Core_Config'                       => static function () {
896
+            'EE_Network_Core_Config'                       => static function() {
897 897
                 return EE_Network_Config::instance()->core;
898 898
             },
899
-            'EE_Environment_Config'                        => static function () {
899
+            'EE_Environment_Config'                        => static function() {
900 900
                 return EE_Config::instance()->environment;
901 901
             },
902
-            'EED_Core_Rest_Api'                            => static function () {
902
+            'EED_Core_Rest_Api'                            => static function() {
903 903
                 return EED_Core_Rest_Api::instance();
904 904
             },
905
-            'WP_REST_Server'                               => static function () {
905
+            'WP_REST_Server'                               => static function() {
906 906
                 return rest_get_server();
907 907
             },
908
-            'EventEspresso\core\Psr4Autoloader'            => static function () {
908
+            'EventEspresso\core\Psr4Autoloader'            => static function() {
909 909
                 return EE_Psr4AutoloaderInit::psr4_loader();
910 910
             },
911 911
         ];
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
             }
971 971
             $this->class_cache->addAlias($fqn, $alias);
972 972
         }
973
-        if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
973
+        if ( ! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
974 974
             $this->class_cache->addAlias(
975 975
                 'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
976 976
                 'EventEspresso\core\services\notices\NoticeConverterInterface'
Please login to merge, or discard this patch.
core/EE_System.core.php 1 patch
Indentation   +1162 added lines, -1162 removed lines patch added patch discarded remove patch
@@ -25,1166 +25,1166 @@
 block discarded – undo
25 25
 final class EE_System implements ResettableInterface
26 26
 {
27 27
 
28
-    /**
29
-     * indicates this is a 'normal' request. Ie, not activation, nor upgrade, nor activation.
30
-     * So examples of this would be a normal GET request on the frontend or backend, or a POST, etc
31
-     */
32
-    const req_type_normal = 0;
33
-
34
-    /**
35
-     * Indicates this is a brand new installation of EE so we should install
36
-     * tables and default data etc
37
-     */
38
-    const req_type_new_activation = 1;
39
-
40
-    /**
41
-     * we've detected that EE has been reactivated (or EE was activated during maintenance mode,
42
-     * and we just exited maintenance mode). We MUST check the database is setup properly
43
-     * and that default data is setup too
44
-     */
45
-    const req_type_reactivation = 2;
46
-
47
-    /**
48
-     * indicates that EE has been upgraded since its previous request.
49
-     * We may have data migration scripts to call and will want to trigger maintenance mode
50
-     */
51
-    const req_type_upgrade = 3;
52
-
53
-    /**
54
-     * TODO  will detect that EE has been DOWNGRADED. We probably don't want to run in this case...
55
-     */
56
-    const req_type_downgrade = 4;
57
-
58
-    /**
59
-     * @deprecated since version 4.6.0.dev.006
60
-     * Now whenever a new_activation is detected the request type is still just
61
-     * new_activation (same for reactivation, upgrade, downgrade etc), but if we're in maintenance mode
62
-     * EE_System::initialize_db_if_no_migrations_required and EE_Addon::initialize_db_if_no_migrations_required
63
-     * will instead enqueue that EE plugin's db initialization for when we're taken out of maintenance mode.
64
-     * (Specifically, when the migration manager indicates migrations are finished
65
-     * EE_Data_Migration_Manager::initialize_db_for_enqueued_ee_plugins() will be called)
66
-     */
67
-    const req_type_activation_but_not_installed = 5;
68
-
69
-    /**
70
-     * option prefix for recording the activation history (like core's "espresso_db_update") of addons
71
-     */
72
-    const addon_activation_history_option_prefix = 'ee_addon_activation_history_';
73
-
74
-    /**
75
-     * @var AddonManager $addon_manager
76
-     */
77
-    private $addon_manager;
78
-
79
-    /**
80
-     * @var EE_System $_instance
81
-     */
82
-    private static $_instance;
83
-
84
-    /**
85
-     * @var EE_Registry $registry
86
-     */
87
-    private $registry;
88
-
89
-    /**
90
-     * @var LoaderInterface $loader
91
-     */
92
-    private $loader;
93
-
94
-    /**
95
-     * @var EE_Capabilities $capabilities
96
-     */
97
-    private $capabilities;
98
-
99
-    /**
100
-     * @var EE_Maintenance_Mode $maintenance_mode
101
-     */
102
-    private $maintenance_mode;
103
-
104
-    /**
105
-     * @var RequestInterface $request
106
-     */
107
-    private $request;
108
-
109
-    /**
110
-     * Stores which type of request this is, options being one of the constants on EE_System starting with req_type_*.
111
-     * It can be a brand-new activation, a reactivation, an upgrade, a downgrade, or a normal request.
112
-     *
113
-     * @var int $_req_type
114
-     */
115
-    private $_req_type;
116
-
117
-    /**
118
-     * Whether or not there was a non-micro version change in EE core version during this request
119
-     *
120
-     * @var boolean $_major_version_change
121
-     */
122
-    private $_major_version_change = false;
123
-
124
-    /**
125
-     * @var Router $router
126
-     */
127
-    private $router;
128
-
129
-
130
-    /**
131
-     * @singleton method used to instantiate class object
132
-     * @param LoaderInterface|null     $loader
133
-     * @param EE_Maintenance_Mode|null $maintenance_mode
134
-     * @param EE_Registry|null         $registry
135
-     * @param RequestInterface|null    $request
136
-     * @param Router|null              $router
137
-     * @return EE_System
138
-     */
139
-    public static function instance(
140
-        LoaderInterface $loader = null,
141
-        EE_Maintenance_Mode $maintenance_mode = null,
142
-        EE_Registry $registry = null,
143
-        RequestInterface $request = null,
144
-        Router $router = null
145
-    ): EE_System {
146
-        // check if class object is instantiated
147
-        if (! self::$_instance instanceof EE_System) {
148
-            self::$_instance = new self($loader, $maintenance_mode, $registry, $request, $router);
149
-        }
150
-        return self::$_instance;
151
-    }
152
-
153
-
154
-    /**
155
-     * resets the instance and returns it
156
-     *
157
-     * @return EE_System
158
-     */
159
-    public static function reset(): EE_System
160
-    {
161
-        self::$_instance->_req_type = null;
162
-        // make sure none of the old hooks are left hanging around
163
-        remove_all_actions('AHEE__EE_System__perform_activations_upgrades_and_migrations');
164
-        // we need to reset the migration manager in order for it to detect DMSs properly
165
-        EE_Data_Migration_Manager::reset();
166
-        self::instance()->detect_activations_or_upgrades();
167
-        self::instance()->perform_activations_upgrades_and_migrations();
168
-        return self::instance();
169
-    }
170
-
171
-
172
-    /**
173
-     * sets hooks for running rest of system
174
-     * provides "AHEE__EE_System__construct__complete" hook for EE Addons to use as their starting point
175
-     * starting EE Addons from any other point may lead to problems
176
-     *
177
-     * @param LoaderInterface     $loader
178
-     * @param EE_Maintenance_Mode $maintenance_mode
179
-     * @param EE_Registry         $registry
180
-     * @param RequestInterface    $request
181
-     * @param Router              $router
182
-     */
183
-    private function __construct(
184
-        LoaderInterface $loader,
185
-        EE_Maintenance_Mode $maintenance_mode,
186
-        EE_Registry $registry,
187
-        RequestInterface $request,
188
-        Router $router
189
-    ) {
190
-        $this->registry         = $registry;
191
-        $this->loader           = $loader;
192
-        $this->request          = $request;
193
-        $this->router           = $router;
194
-        $this->maintenance_mode = $maintenance_mode;
195
-        do_action('AHEE__EE_System__construct__begin', $this);
196
-        add_action(
197
-            'AHEE__EE_Bootstrap__load_espresso_addons',
198
-            [$this, 'loadCapabilities'],
199
-            5
200
-        );
201
-        add_action(
202
-            'AHEE__EE_Bootstrap__load_espresso_addons',
203
-            [$this, 'loadCommandBus'],
204
-            7
205
-        );
206
-        add_action(
207
-            'AHEE__EE_Bootstrap__load_espresso_addons',
208
-            [$this, 'loadPluginApi'],
209
-            9
210
-        );
211
-        // allow addons to load first so that they can register autoloaders, set hooks for running DMS's, etc
212
-        add_action(
213
-            'AHEE__EE_Bootstrap__load_espresso_addons',
214
-            [$this, 'load_espresso_addons']
215
-        );
216
-        // when an ee addon is activated, we want to call the core hook(s) again
217
-        // because the newly-activated addon didn't get a chance to run at all
218
-        add_action('activate_plugin', [$this, 'load_espresso_addons'], 1);
219
-        // detect whether install or upgrade
220
-        add_action(
221
-            'AHEE__EE_Bootstrap__detect_activations_or_upgrades',
222
-            [$this, 'detect_activations_or_upgrades'],
223
-            3
224
-        );
225
-        // load EE_Config, EE_Textdomain, etc
226
-        add_action(
227
-            'AHEE__EE_Bootstrap__load_core_configuration',
228
-            [$this, 'load_core_configuration'],
229
-            5
230
-        );
231
-        // load specifications for matching routes to current request
232
-        add_action(
233
-            'AHEE__EE_Bootstrap__load_core_configuration',
234
-            [$this, 'loadRouteMatchSpecifications']
235
-        );
236
-        // load EE_Config, EE_Textdomain, etc
237
-        add_action(
238
-            'AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets',
239
-            [$this, 'register_shortcodes_modules_and_widgets'],
240
-            7
241
-        );
242
-        // you wanna get going? I wanna get going... let's get going!
243
-        add_action(
244
-            'AHEE__EE_Bootstrap__brew_espresso',
245
-            [$this, 'brew_espresso'],
246
-            9
247
-        );
248
-        // other housekeeping
249
-        // exclude EE critical pages from wp_list_pages
250
-        add_filter(
251
-            'wp_list_pages_excludes',
252
-            [$this, 'remove_pages_from_wp_list_pages'],
253
-            10
254
-        );
255
-        // ALL EE Addons should use the following hook point to attach their initial setup too
256
-        // it's extremely important for EE Addons to register any class autoloaders so that they can be available when the EE_Config loads
257
-        do_action('AHEE__EE_System__construct__complete', $this);
258
-    }
259
-
260
-
261
-    /**
262
-     * load and setup EE_Capabilities
263
-     *
264
-     * @return void
265
-     */
266
-    public function loadCapabilities()
267
-    {
268
-        $this->capabilities = $this->loader->getShared('EE_Capabilities');
269
-        add_action(
270
-            'AHEE__EE_Capabilities__init_caps__before_initialization',
271
-            function () {
272
-                LoaderFactory::getLoader()->getShared('EE_Payment_Method_Manager');
273
-            }
274
-        );
275
-    }
276
-
277
-
278
-    /**
279
-     * create and cache the CommandBus, and also add middleware
280
-     * The CapChecker middleware requires the use of EE_Capabilities
281
-     * which is why we need to load the CommandBus after Caps are set up
282
-     *
283
-     * @return void
284
-     */
285
-    public function loadCommandBus()
286
-    {
287
-        $this->loader->getShared(
288
-            'CommandBusInterface',
289
-            [
290
-                null,
291
-                apply_filters(
292
-                    'FHEE__EE_Load_Espresso_Core__handle_request__CommandBus_middleware',
293
-                    [
294
-                        $this->loader->getShared('EventEspresso\core\services\commands\middleware\CapChecker'),
295
-                        $this->loader->getShared('EventEspresso\core\services\commands\middleware\AddActionHook'),
296
-                    ]
297
-                ),
298
-            ]
299
-        );
300
-    }
301
-
302
-
303
-    /**
304
-     * @return void
305
-     * @throws Exception
306
-     */
307
-    public function loadPluginApi()
308
-    {
309
-        $this->addon_manager = $this->loader->getShared(AddonManager::class);
310
-        $this->addon_manager->initialize();
311
-        $this->loader->getShared('EE_Request_Handler');
312
-    }
313
-
314
-
315
-    /**
316
-     * load_espresso_addons
317
-     * allow addons to load first so that they can set hooks for running DMS's, etc
318
-     * this is hooked into both:
319
-     *    'AHEE__EE_Bootstrap__load_core_configuration'
320
-     *        which runs during the WP 'plugins_loaded' action at priority 5
321
-     *    and the WP 'activate_plugin' hook point
322
-     *
323
-     * @return void
324
-     * @throws Exception
325
-     */
326
-    public function load_espresso_addons()
327
-    {
328
-        // looking for hooks? they've been moved into the AddonManager to maintain compatibility
329
-        $this->addon_manager->loadAddons();
330
-    }
331
-
332
-
333
-    /**
334
-     * detect_activations_or_upgrades
335
-     * Checks for activation or upgrade of core first;
336
-     * then also checks if any registered addons have been activated or upgraded
337
-     * This is hooked into 'AHEE__EE_Bootstrap__detect_activations_or_upgrades'
338
-     * which runs during the WP 'plugins_loaded' action at priority 3
339
-     *
340
-     * @access public
341
-     * @return void
342
-     */
343
-    public function detect_activations_or_upgrades()
344
-    {
345
-        // first off: let's make sure to handle core
346
-        $this->detect_if_activation_or_upgrade();
347
-        foreach ($this->registry->addons as $addon) {
348
-            if ($addon instanceof EE_Addon) {
349
-                // detect teh request type for that addon
350
-                $addon->detect_activation_or_upgrade();
351
-            }
352
-        }
353
-    }
354
-
355
-
356
-    /**
357
-     * detect_if_activation_or_upgrade
358
-     * Takes care of detecting whether this is a brand new install or code upgrade,
359
-     * and either setting up the DB or setting up maintenance mode etc.
360
-     *
361
-     * @access public
362
-     * @return void
363
-     */
364
-    public function detect_if_activation_or_upgrade()
365
-    {
366
-        do_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin');
367
-        // check if db has been updated, or if its a brand-new installation
368
-        $espresso_db_update = $this->fix_espresso_db_upgrade_option();
369
-        $request_type       = $this->detect_req_type($espresso_db_update);
370
-        // EEH_Debug_Tools::printr( $request_type, '$request_type', __FILE__, __LINE__ );
371
-        switch ($request_type) {
372
-            case EE_System::req_type_new_activation:
373
-                do_action('AHEE__EE_System__detect_if_activation_or_upgrade__new_activation');
374
-                $this->_handle_core_version_change($espresso_db_update);
375
-                break;
376
-            case EE_System::req_type_reactivation:
377
-                do_action('AHEE__EE_System__detect_if_activation_or_upgrade__reactivation');
378
-                $this->_handle_core_version_change($espresso_db_update);
379
-                break;
380
-            case EE_System::req_type_upgrade:
381
-                do_action('AHEE__EE_System__detect_if_activation_or_upgrade__upgrade');
382
-                // migrations may be required now that we've upgraded
383
-                $this->maintenance_mode->set_maintenance_mode_if_db_old();
384
-                $this->_handle_core_version_change($espresso_db_update);
385
-                break;
386
-            case EE_System::req_type_downgrade:
387
-                do_action('AHEE__EE_System__detect_if_activation_or_upgrade__downgrade');
388
-                // its possible migrations are no longer required
389
-                $this->maintenance_mode->set_maintenance_mode_if_db_old();
390
-                $this->_handle_core_version_change($espresso_db_update);
391
-                break;
392
-            case EE_System::req_type_normal:
393
-            default:
394
-                break;
395
-        }
396
-        do_action('AHEE__EE_System__detect_if_activation_or_upgrade__complete');
397
-    }
398
-
399
-
400
-    /**
401
-     * Updates the list of installed versions and sets hooks for
402
-     * initializing the database later during the request
403
-     *
404
-     * @param array $espresso_db_update
405
-     */
406
-    private function _handle_core_version_change(array $espresso_db_update)
407
-    {
408
-        $this->update_list_of_installed_versions($espresso_db_update);
409
-        // get ready to verify the DB is ok (provided we aren't in maintenance mode, of course)
410
-        add_action(
411
-            'AHEE__EE_System__perform_activations_upgrades_and_migrations',
412
-            [$this, 'initialize_db_if_no_migrations_required']
413
-        );
414
-    }
415
-
416
-
417
-    /**
418
-     * standardizes the wp option 'espresso_db_upgrade' which actually stores
419
-     * information about what versions of EE have been installed and activated,
420
-     * NOT necessarily the state of the database
421
-     *
422
-     * @param mixed $espresso_db_update           the value of the WordPress option.
423
-     *                                            If not supplied, fetches it from the options table
424
-     * @return array the correct value of 'espresso_db_upgrade', after saving it, if it needed correction
425
-     */
426
-    private function fix_espresso_db_upgrade_option($espresso_db_update = null): array
427
-    {
428
-        do_action('FHEE__EE_System__manage_fix_espresso_db_upgrade_option__begin', $espresso_db_update);
429
-        if (! $espresso_db_update) {
430
-            $espresso_db_update = get_option('espresso_db_update');
431
-        }
432
-        // check that option is an array
433
-        if (! is_array($espresso_db_update)) {
434
-            // if option is FALSE, then it never existed
435
-            if ($espresso_db_update === false) {
436
-                // make $espresso_db_update an array and save option with autoload OFF
437
-                $espresso_db_update = [];
438
-                add_option('espresso_db_update', $espresso_db_update, '', 'no');
439
-            } else {
440
-                // option is NOT FALSE but also is NOT an array, so make it an array and save it
441
-                $espresso_db_update = [$espresso_db_update => []];
442
-                update_option('espresso_db_update', $espresso_db_update);
443
-            }
444
-        } else {
445
-            $corrected_db_update = [];
446
-            // if IS an array, but is it an array where KEYS are version numbers, and values are arrays?
447
-            foreach ($espresso_db_update as $should_be_version_string => $should_be_array) {
448
-                if (is_int($should_be_version_string) && ! is_array($should_be_array)) {
449
-                    // the key is an int, and the value IS NOT an array
450
-                    // so it must be numerically-indexed, where values are versions installed...
451
-                    // fix it!
452
-                    $version_string                         = $should_be_array;
453
-                    $corrected_db_update[ $version_string ] = ['unknown-date'];
454
-                } else {
455
-                    // ok it checks out
456
-                    $corrected_db_update[ $should_be_version_string ] = $should_be_array;
457
-                }
458
-            }
459
-            $espresso_db_update = $corrected_db_update;
460
-            update_option('espresso_db_update', $espresso_db_update);
461
-        }
462
-        do_action('FHEE__EE_System__manage_fix_espresso_db_upgrade_option__complete', $espresso_db_update);
463
-        return ! empty($espresso_db_update) ? $espresso_db_update : [];
464
-    }
465
-
466
-
467
-    /**
468
-     * Does the traditional work of setting up the plugin's database and adding default data.
469
-     * If migration script/process did not exist, this is what would happen on every activation/reactivation/upgrade.
470
-     * NOTE: if we're in maintenance mode (which would be the case if we detect there are data
471
-     * migration scripts that need to be run and a version change happens), enqueues core for database initialization,
472
-     * so that it will be done when migrations are finished
473
-     *
474
-     * @param boolean $initialize_addons_too if true, we double-check addons' database tables etc too;
475
-     * @param boolean $verify_schema         if true will re-check the database tables have the correct schema.
476
-     *                                       This is a resource-intensive job
477
-     *                                       so we prefer to only do it when necessary
478
-     * @return void
479
-     * @throws EE_Error
480
-     * @throws ReflectionException
481
-     */
482
-    public function initialize_db_if_no_migrations_required($initialize_addons_too = false, $verify_schema = true)
483
-    {
484
-        $request_type = $this->detect_req_type();
485
-        // only initialize system if we're not in maintenance mode.
486
-        if ($this->maintenance_mode->level() !== EE_Maintenance_Mode::level_2_complete_maintenance) {
487
-            /** @var EventEspresso\core\domain\services\custom_post_types\RewriteRules $rewrite_rules */
488
-            $rewrite_rules = $this->loader->getShared(
489
-                'EventEspresso\core\domain\services\custom_post_types\RewriteRules'
490
-            );
491
-            $rewrite_rules->flush();
492
-            if ($verify_schema) {
493
-                EEH_Activation::initialize_db_and_folders();
494
-            }
495
-            EEH_Activation::initialize_db_content();
496
-            EEH_Activation::system_initialization();
497
-            if ($initialize_addons_too) {
498
-                $this->initialize_addons();
499
-            }
500
-        } else {
501
-            EE_Data_Migration_Manager::instance()->enqueue_db_initialization_for('Core');
502
-        }
503
-        if (
504
-            $request_type === EE_System::req_type_new_activation
505
-            || $request_type === EE_System::req_type_reactivation
506
-            || (
507
-                $request_type === EE_System::req_type_upgrade
508
-                && $this->is_major_version_change()
509
-            )
510
-        ) {
511
-            add_action('AHEE__EE_System__initialize_last', [$this, 'redirect_to_about_ee'], 9);
512
-        }
513
-    }
514
-
515
-
516
-    /**
517
-     * Initializes the db for all registered addons
518
-     *
519
-     * @throws EE_Error
520
-     * @throws ReflectionException
521
-     */
522
-    public function initialize_addons()
523
-    {
524
-        // foreach registered addon, make sure its db is up-to-date too
525
-        foreach ($this->registry->addons as $addon) {
526
-            if ($addon instanceof EE_Addon) {
527
-                $addon->initialize_db_if_no_migrations_required();
528
-            }
529
-        }
530
-    }
531
-
532
-
533
-    /**
534
-     * Adds the current code version to the saved wp option which stores a list of all ee versions ever installed.
535
-     *
536
-     * @param array  $version_history
537
-     * @param string $current_version_to_add version to be added to the version history
538
-     * @return    boolean success as to whether or not this option was changed
539
-     */
540
-    public function update_list_of_installed_versions($version_history = null, $current_version_to_add = null): bool
541
-    {
542
-        if (! $version_history) {
543
-            $version_history = $this->fix_espresso_db_upgrade_option($version_history);
544
-        }
545
-        if ($current_version_to_add === null) {
546
-            $current_version_to_add = espresso_version();
547
-        }
548
-        $version_history[ $current_version_to_add ][] = date('Y-m-d H:i:s', time());
549
-        // re-save
550
-        return update_option('espresso_db_update', $version_history);
551
-    }
552
-
553
-
554
-    /**
555
-     * Detects if the current version indicated in the has existed in the list of
556
-     * previously-installed versions of EE (espresso_db_update). Does NOT modify it (ie, no side-effect)
557
-     *
558
-     * @param array $espresso_db_update array from the wp option stored under the name 'espresso_db_update'.
559
-     *                                  If not supplied, fetches it from the options table.
560
-     *                                  Also, caches its result so later parts of the code can also know whether
561
-     *                                  there's been an update or not. This way we can add the current version to
562
-     *                                  espresso_db_update, but still know if this is a new install or not
563
-     * @return int one of the constants on EE_System::req_type_
564
-     */
565
-    public function detect_req_type($espresso_db_update = null): int
566
-    {
567
-        if ($this->_req_type === null) {
568
-            $espresso_db_update          = ! empty($espresso_db_update)
569
-                ? $espresso_db_update
570
-                : $this->fix_espresso_db_upgrade_option();
571
-            $this->_req_type             = EE_System::detect_req_type_given_activation_history(
572
-                $espresso_db_update,
573
-                'ee_espresso_activation',
574
-                espresso_version()
575
-            );
576
-            $this->_major_version_change = $this->_detect_major_version_change($espresso_db_update);
577
-            $this->request->setIsActivation($this->_req_type !== EE_System::req_type_normal);
578
-        }
579
-        return $this->_req_type;
580
-    }
581
-
582
-
583
-    /**
584
-     * Returns whether or not there was a non-micro version change (ie, change in either
585
-     * the first or second number in the version. Eg 4.9.0.rc.001 to 4.10.0.rc.000,
586
-     * but not 4.9.0.rc.0001 to 4.9.1.rc.0001
587
-     *
588
-     * @param $activation_history
589
-     * @return bool
590
-     */
591
-    private function _detect_major_version_change($activation_history): bool
592
-    {
593
-        $previous_version       = EE_System::getMostRecentlyActiveVersion($activation_history);
594
-        $previous_version_parts = explode('.', $previous_version);
595
-        $current_version_parts  = explode('.', espresso_version());
596
-        return isset(
597
-            $previous_version_parts[0],
598
-            $previous_version_parts[1],
599
-            $current_version_parts[0],
600
-            $current_version_parts[1]
601
-        ) && (
602
-            $previous_version_parts[0] !== $current_version_parts[0]
603
-            || $previous_version_parts[1] !== $current_version_parts[1]
604
-        );
605
-    }
606
-
607
-
608
-    /**
609
-     * Returns true if either the major or minor version of EE changed during this request.
610
-     * Eg 4.9.0.rc.001 to 4.10.0.rc.000, but not 4.9.0.rc.0001 to 4.9.1.rc.0001
611
-     *
612
-     * @return bool
613
-     */
614
-    public function is_major_version_change(): bool
615
-    {
616
-        return $this->_major_version_change;
617
-    }
618
-
619
-
620
-    /**
621
-     * Determines the request type for any ee addon, given three piece of info: the current array of activation
622
-     * histories (for core that' 'espresso_db_update' wp option); the name of the WordPress option which is temporarily
623
-     * set upon activation of the plugin (for core it's 'ee_espresso_activation'); and the version that this plugin was
624
-     * just activated to (for core that will always be espresso_version())
625
-     *
626
-     * @param array|null $activation_history             the option's value which stores the activation history for
627
-     *                                                 this
628
-     *                                                 ee plugin. for core that's 'espresso_db_update'
629
-     * @param string $activation_indicator_option_name the name of the WordPress option that is temporarily set to
630
-     *                                                 indicate that this plugin was just activated
631
-     * @param string $current_version                  the version that was just upgraded to (for core that will be
632
-     *                                                 espresso_version())
633
-     * @return int one of the constants on EE_System::req_type_
634
-     */
635
-    public static function detect_req_type_given_activation_history(
636
-        array $activation_history,
637
-        string $activation_indicator_option_name,
638
-        string $current_version
639
-    ): int {
640
-        $version_change = self::compareVersionWithPrevious($activation_history, $current_version);
641
-        $is_activation  = get_option($activation_indicator_option_name, false);
642
-        $req_type       = self::getRequestType($activation_history, $version_change, $is_activation);
643
-        if ($is_activation) {
644
-            // cleanup in aisle 6
645
-            delete_option($activation_indicator_option_name);
646
-        }
647
-        return $req_type;
648
-    }
649
-
650
-
651
-    /**
652
-     * @param array  $activation_history
653
-     * @param int    $version_change
654
-     * @param bool   $is_activation
655
-     * @return int
656
-     * @since $VID:$
657
-     */
658
-    private static function getRequestType(array $activation_history, int $version_change, bool $is_activation): int
659
-    {
660
-        // if no previous activation history exists, then this is a brand new install
661
-        if (empty($activation_history)) {
662
-            return EE_System::req_type_new_activation;
663
-        }
664
-        // current version is higher than previous version, so it's an upgrade
665
-        if ($version_change === 1) {
666
-            return EE_System::req_type_upgrade;
667
-        }
668
-        // current version is lower than previous version, so it's a downgrade
669
-        if ($version_change === -1) {
670
-            return EE_System::req_type_downgrade;
671
-        }
672
-        // version hasn't changed since last version so check if the activation indicator is set
673
-        // to determine if it's a reactivation, or just a normal request
674
-        return $is_activation
675
-            ? EE_System::req_type_reactivation
676
-            : EE_System::req_type_normal;
677
-    }
678
-
679
-
680
-    /**
681
-     * Detects if the $version_to_upgrade_to is higher than the most recent version in
682
-     * the $activation_history_for_addon
683
-     *
684
-     * @param array  $activation_history    array where keys are versions,
685
-     *                                      values are arrays of times activated (sometimes 'unknown-date')
686
-     * @param string $current_version
687
-     * @return int results of version_compare( $version_to_upgrade_to, $most_recently_active_version ).
688
-     *                                      -1 if $version_to_upgrade_to is LOWER (downgrade);
689
-     *                                      0 if $version_to_upgrade_to MATCHES (reactivation or normal request);
690
-     *                                      1 if $version_to_upgrade_to is HIGHER (upgrade) ;
691
-     */
692
-    private static function compareVersionWithPrevious(array $activation_history, string $current_version): int
693
-    {
694
-        // find the most recently-activated version
695
-        $most_recently_active_version = EE_System::getMostRecentlyActiveVersion($activation_history);
696
-        return version_compare($current_version, $most_recently_active_version);
697
-    }
698
-
699
-
700
-    /**
701
-     * Gets the most recently active version listed in the activation history,
702
-     * and if none are found (ie, it's a brand new install) returns '0.0.0.dev.000'.
703
-     *
704
-     * @param array $activation_history  (keys are versions, values are arrays of times activated,
705
-     *                                   sometimes containing 'unknown-date'
706
-     * @return string
707
-     */
708
-    private static function getMostRecentlyActiveVersion(array $activation_history): string
709
-    {
710
-        $most_recent_activation_date  = '1970-01-01 00:00:00';
711
-        $most_recently_active_version = '0.0.0.dev.000';
712
-        if (is_array($activation_history)) {
713
-            foreach ($activation_history as $version => $activation_dates) {
714
-                // check there is a record of when this version was activated.
715
-                // Otherwise, mark it as unknown
716
-                if (! $activation_dates) {
717
-                    $activation_dates = ['unknown-date'];
718
-                }
719
-                $activation_dates = is_string($activation_dates) ? [$activation_dates] : $activation_dates;
720
-                foreach ($activation_dates as $activation_date) {
721
-                    if ($activation_date !== 'unknown-date' && $activation_date > $most_recent_activation_date) {
722
-                        $most_recently_active_version = $version;
723
-                        $most_recent_activation_date  = $activation_date;
724
-                    }
725
-                }
726
-            }
727
-        }
728
-        return $most_recently_active_version;
729
-    }
730
-
731
-
732
-    /**
733
-     * This redirects to the about EE page after activation
734
-     *
735
-     * @return void
736
-     */
737
-    public function redirect_to_about_ee()
738
-    {
739
-        $notices = EE_Error::get_notices(false);
740
-        // if current user is an admin and it's not an ajax or rest request
741
-        if (
742
-            ! isset($notices['errors'])
743
-            && $this->request->isAdmin()
744
-            && apply_filters(
745
-                'FHEE__EE_System__redirect_to_about_ee__do_redirect',
746
-                $this->capabilities->current_user_can('manage_options', 'espresso_about_default')
747
-            )
748
-        ) {
749
-            $query_params = ['page' => 'espresso_about'];
750
-            if (EE_System::instance()->detect_req_type() === EE_System::req_type_new_activation) {
751
-                $query_params['new_activation'] = true;
752
-            }
753
-            if (EE_System::instance()->detect_req_type() === EE_System::req_type_reactivation) {
754
-                $query_params['reactivation'] = true;
755
-            }
756
-            $url = add_query_arg($query_params, admin_url('admin.php'));
757
-            EEH_URL::safeRedirectAndExit($url);
758
-        }
759
-    }
760
-
761
-
762
-    /**
763
-     * load_core_configuration
764
-     * this is hooked into 'AHEE__EE_Bootstrap__load_core_configuration'
765
-     * which runs during the WP 'plugins_loaded' action at priority 5
766
-     *
767
-     * @return void
768
-     * @throws ReflectionException
769
-     * @throws Exception
770
-     */
771
-    public function load_core_configuration()
772
-    {
773
-        do_action('AHEE__EE_System__load_core_configuration__begin', $this);
774
-        $this->loader->getShared('EE_Load_Textdomain');
775
-        // load textdomain
776
-        EE_Load_Textdomain::load_textdomain();
777
-        // load caf stuff a chance to play during the activation process too.
778
-        $this->_maybe_brew_regular();
779
-        // load and setup EE_Config and EE_Network_Config
780
-        $config = $this->loader->getShared('EE_Config');
781
-        $this->loader->getShared('EE_Network_Config');
782
-        // setup autoloaders
783
-        // enable logging?
784
-        if ($config->admin->use_remote_logging) {
785
-            $this->loader->getShared('EE_Log');
786
-        }
787
-        // check for activation errors
788
-        $activation_errors = get_option('ee_plugin_activation_errors', false);
789
-        if ($activation_errors) {
790
-            EE_Error::add_error($activation_errors, __FILE__, __FUNCTION__, __LINE__);
791
-            update_option('ee_plugin_activation_errors', false);
792
-        }
793
-        // get model names
794
-        $this->_parse_model_names();
795
-        // configure custom post type definitions
796
-        $this->loader->getShared('EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions');
797
-        $this->loader->getShared('EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions');
798
-        do_action('AHEE__EE_System__load_core_configuration__complete', $this);
799
-    }
800
-
801
-
802
-    /**
803
-     * cycles through all of the models/*.model.php files, and assembles an array of model names
804
-     *
805
-     * @return void
806
-     * @throws ReflectionException
807
-     */
808
-    private function _parse_model_names()
809
-    {
810
-        // get all the files in the EE_MODELS folder that end in .model.php
811
-        $models                 = glob(EE_MODELS . '*.model.php');
812
-        $model_names            = [];
813
-        $non_abstract_db_models = [];
814
-        foreach ($models as $model) {
815
-            // get model classname
816
-            $classname       = EEH_File::get_classname_from_filepath_with_standard_filename($model);
817
-            $short_name      = str_replace('EEM_', '', $classname);
818
-            $reflectionClass = new ReflectionClass($classname);
819
-            if ($reflectionClass->isSubclassOf('EEM_Base') && ! $reflectionClass->isAbstract()) {
820
-                $non_abstract_db_models[ $short_name ] = $classname;
821
-            }
822
-            $model_names[ $short_name ] = $classname;
823
-        }
824
-        $this->registry->models                 = apply_filters('FHEE__EE_System__parse_model_names', $model_names);
825
-        $this->registry->non_abstract_db_models = apply_filters(
826
-            'FHEE__EE_System__parse_implemented_model_names',
827
-            $non_abstract_db_models
828
-        );
829
-    }
830
-
831
-
832
-    /**
833
-     * The purpose of this method is to simply check for a file named "caffeinated/brewing_regular.php" for any hooks
834
-     * that need to be setup before our EE_System launches.
835
-     *
836
-     * @return void
837
-     * @throws DomainException
838
-     * @throws InvalidArgumentException
839
-     * @throws InvalidDataTypeException
840
-     * @throws InvalidInterfaceException
841
-     * @throws InvalidClassException
842
-     * @throws InvalidFilePathException
843
-     */
844
-    private function _maybe_brew_regular()
845
-    {
846
-        /** @var Domain $domain */
847
-        $domain = DomainFactory::getEventEspressoCoreDomain();
848
-        if ($domain->isCaffeinated()) {
849
-            require_once EE_CAFF_PATH . 'brewing_regular.php';
850
-        }
851
-    }
852
-
853
-
854
-    /**
855
-     * @throws Exception
856
-     * @since 4.9.71.p
857
-     */
858
-    public function loadRouteMatchSpecifications()
859
-    {
860
-        try {
861
-            $this->loader->getShared('EventEspresso\core\services\routing\RouteMatchSpecificationManager');
862
-            $this->loader->getShared('EventEspresso\core\services\routing\RouteCollection');
863
-            $this->router->loadPrimaryRoutes();
864
-        } catch (Exception $exception) {
865
-            new ExceptionStackTraceDisplay($exception);
866
-        }
867
-        do_action('AHEE__EE_System__loadRouteMatchSpecifications');
868
-    }
869
-
870
-
871
-    /**
872
-     * register_shortcodes_modules_and_widgets
873
-     * generate lists of shortcodes and modules, then verify paths and classes
874
-     * This is hooked into 'AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets'
875
-     * which runs during the WP 'plugins_loaded' action at priority 7
876
-     *
877
-     * @access public
878
-     * @return void
879
-     * @throws Exception
880
-     */
881
-    public function register_shortcodes_modules_and_widgets()
882
-    {
883
-        $this->router->registerShortcodesModulesAndWidgets();
884
-        do_action('AHEE__EE_System__register_shortcodes_modules_and_widgets');
885
-        // check for addons using old hook point
886
-        if (has_action('AHEE__EE_System__register_shortcodes_modules_and_addons')) {
887
-            $this->_incompatible_addon_error();
888
-        }
889
-    }
890
-
891
-
892
-    /**
893
-     * _incompatible_addon_error
894
-     *
895
-     * @access public
896
-     * @return void
897
-     */
898
-    private function _incompatible_addon_error()
899
-    {
900
-        // get array of classes hooking into here
901
-        $class_names = EEH_Class_Tools::get_class_names_for_all_callbacks_on_hook(
902
-            'AHEE__EE_System__register_shortcodes_modules_and_addons'
903
-        );
904
-        if (! empty($class_names)) {
905
-            $msg = __(
906
-                'The following plugins, addons, or modules appear to be incompatible with this version of Event Espresso and were automatically deactivated to avoid fatal errors:',
907
-                'event_espresso'
908
-            );
909
-            $msg .= '<ul>';
910
-            foreach ($class_names as $class_name) {
911
-                $msg .= '<li><b>Event Espresso - '
912
-                        . str_replace(
913
-                            ['EE_', 'EEM_', 'EED_', 'EES_', 'EEW_'],
914
-                            '',
915
-                            $class_name
916
-                        ) . '</b></li>';
917
-            }
918
-            $msg .= '</ul>';
919
-            $msg .= __(
920
-                'Compatibility issues can be avoided and/or resolved by keeping addons and plugins updated to the latest version.',
921
-                'event_espresso'
922
-            );
923
-            // save list of incompatible addons to wp-options for later use
924
-            add_option('ee_incompatible_addons', $class_names, '', 'no');
925
-            if (is_admin()) {
926
-                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
927
-            }
928
-        }
929
-    }
930
-
931
-
932
-    /**
933
-     * brew_espresso
934
-     * begins the process of setting hooks for initializing EE in the correct order
935
-     * This is happening on the 'AHEE__EE_Bootstrap__brew_espresso' hook point
936
-     * which runs during the WP 'plugins_loaded' action at priority 9
937
-     *
938
-     * @return void
939
-     * @throws Exception
940
-     */
941
-    public function brew_espresso()
942
-    {
943
-        do_action('AHEE__EE_System__brew_espresso__begin', $this);
944
-        // load some final core systems
945
-        add_action('init', [$this, 'set_hooks_for_core'], 1);
946
-        add_action('init', [$this, 'perform_activations_upgrades_and_migrations'], 3);
947
-        add_action('init', [$this, 'load_CPTs_and_session'], 5);
948
-        add_action('init', [$this, 'load_controllers'], 7);
949
-        add_action('init', [$this, 'core_loaded_and_ready'], 9);
950
-        add_action('init', [$this, 'initialize'], 10);
951
-        add_action('init', [$this, 'initialize_last'], 100);
952
-        $this->router->brewEspresso();
953
-        do_action('AHEE__EE_System__brew_espresso__complete', $this);
954
-    }
955
-
956
-
957
-    /**
958
-     *    set_hooks_for_core
959
-     *
960
-     * @access public
961
-     * @return    void
962
-     * @throws EE_Error
963
-     */
964
-    public function set_hooks_for_core()
965
-    {
966
-        $this->_deactivate_incompatible_addons();
967
-        do_action('AHEE__EE_System__set_hooks_for_core');
968
-        $this->loader->getShared('EventEspresso\core\domain\values\session\SessionLifespan');
969
-        // caps need to be initialized on every request so that capability maps are set.
970
-        // @see https://events.codebasehq.com/projects/event-espresso/tickets/8674
971
-        $this->registry->CAP->init_caps();
972
-    }
973
-
974
-
975
-    /**
976
-     * Using the information gathered in EE_System::_incompatible_addon_error,
977
-     * deactivates any addons considered incompatible with the current version of EE
978
-     */
979
-    private function _deactivate_incompatible_addons()
980
-    {
981
-        $incompatible_addons = get_option('ee_incompatible_addons', []);
982
-        if (! empty($incompatible_addons)) {
983
-            $active_plugins = get_option('active_plugins', []);
984
-            foreach ($active_plugins as $active_plugin) {
985
-                foreach ($incompatible_addons as $incompatible_addon) {
986
-                    if (strpos($active_plugin, $incompatible_addon) !== false) {
987
-                        unset($_GET['activate']);
988
-                        espresso_deactivate_plugin($active_plugin);
989
-                    }
990
-                }
991
-            }
992
-        }
993
-    }
994
-
995
-
996
-    /**
997
-     *    perform_activations_upgrades_and_migrations
998
-     *
999
-     * @access public
1000
-     * @return    void
1001
-     */
1002
-    public function perform_activations_upgrades_and_migrations()
1003
-    {
1004
-        do_action('AHEE__EE_System__perform_activations_upgrades_and_migrations');
1005
-    }
1006
-
1007
-
1008
-    /**
1009
-     * @return void
1010
-     * @throws DomainException
1011
-     */
1012
-    public function load_CPTs_and_session()
1013
-    {
1014
-        do_action('AHEE__EE_System__load_CPTs_and_session__start');
1015
-        /** @var EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies $register_custom_taxonomies */
1016
-        $register_custom_taxonomies = $this->loader->getShared(
1017
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'
1018
-        );
1019
-        $register_custom_taxonomies->registerCustomTaxonomies();
1020
-        /** @var EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes $register_custom_post_types */
1021
-        $register_custom_post_types = $this->loader->getShared(
1022
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'
1023
-        );
1024
-        $register_custom_post_types->registerCustomPostTypes();
1025
-        /** @var EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomyTerms $register_custom_taxonomy_terms */
1026
-        $register_custom_taxonomy_terms = $this->loader->getShared(
1027
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomyTerms'
1028
-        );
1029
-        $register_custom_taxonomy_terms->registerCustomTaxonomyTerms();
1030
-        // load legacy Custom Post Types and Taxonomies
1031
-        $this->loader->getShared('EE_Register_CPTs');
1032
-        do_action('AHEE__EE_System__load_CPTs_and_session__complete');
1033
-    }
1034
-
1035
-
1036
-    /**
1037
-     * load_controllers
1038
-     * this is the best place to load any additional controllers that needs access to EE core.
1039
-     * it is expected that all basic core EE systems, that are not dependant on the current request are loaded at this
1040
-     * time
1041
-     *
1042
-     * @access public
1043
-     * @return void
1044
-     * @throws Exception
1045
-     */
1046
-    public function load_controllers()
1047
-    {
1048
-        do_action('AHEE__EE_System__load_controllers__start');
1049
-        $this->router->loadControllers();
1050
-        do_action('AHEE__EE_System__load_controllers__complete');
1051
-    }
1052
-
1053
-
1054
-    /**
1055
-     * core_loaded_and_ready
1056
-     * all of the basic EE core should be loaded at this point and available regardless of M-Mode
1057
-     *
1058
-     * @access public
1059
-     * @return void
1060
-     * @throws Exception
1061
-     */
1062
-    public function core_loaded_and_ready()
1063
-    {
1064
-        $this->router->coreLoadedAndReady();
1065
-        // integrate WP_Query with the EE models
1066
-        $this->loader->getShared('EE_CPT_Strategy');
1067
-        do_action('AHEE__EE_System__core_loaded_and_ready');
1068
-        // always load template tags, because it's faster than checking if it's a front-end request, and many page
1069
-        // builders require these even on the front-end
1070
-        require_once EE_PUBLIC . 'template_tags.php';
1071
-        do_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons');
1072
-    }
1073
-
1074
-
1075
-    /**
1076
-     * initialize
1077
-     * this is the best place to begin initializing client code
1078
-     *
1079
-     * @access public
1080
-     * @return void
1081
-     */
1082
-    public function initialize()
1083
-    {
1084
-        do_action('AHEE__EE_System__initialize');
1085
-    }
1086
-
1087
-
1088
-    /**
1089
-     * initialize_last
1090
-     * this is run really late during the WP init hook point, and ensures that mostly everything else that needs to
1091
-     * initialize has done so
1092
-     *
1093
-     * @access public
1094
-     * @return void
1095
-     * @throws Exception
1096
-     */
1097
-    public function initialize_last()
1098
-    {
1099
-        do_action('AHEE__EE_System__initialize_last');
1100
-        /** @var EventEspresso\core\domain\services\custom_post_types\RewriteRules $rewrite_rules */
1101
-        $rewrite_rules = $this->loader->getShared(
1102
-            'EventEspresso\core\domain\services\custom_post_types\RewriteRules'
1103
-        );
1104
-        $rewrite_rules->flushRewriteRules();
1105
-        $this->router->initializeLast();
1106
-        add_action('admin_bar_init', [$this, 'addEspressoToolbar']);
1107
-    }
1108
-
1109
-
1110
-    /**
1111
-     * @return void
1112
-     */
1113
-    public function addEspressoToolbar()
1114
-    {
1115
-        $this->loader->getShared(
1116
-            'EventEspresso\core\domain\services\admin\AdminToolBar',
1117
-            [$this->registry->CAP]
1118
-        );
1119
-    }
1120
-
1121
-
1122
-    /**
1123
-     * do_not_cache
1124
-     * sets no cache headers and defines no cache constants for WP plugins
1125
-     *
1126
-     * @access public
1127
-     * @return void
1128
-     */
1129
-    public static function do_not_cache()
1130
-    {
1131
-        // set no cache constants
1132
-        if (! defined('DONOTCACHEPAGE')) {
1133
-            define('DONOTCACHEPAGE', true);
1134
-        }
1135
-        if (! defined('DONOTCACHCEOBJECT')) {
1136
-            define('DONOTCACHCEOBJECT', true);
1137
-        }
1138
-        if (! defined('DONOTCACHEDB')) {
1139
-            define('DONOTCACHEDB', true);
1140
-        }
1141
-        // add no cache headers
1142
-        add_action('send_headers', ['EE_System', 'nocache_headers'], 10);
1143
-        // plus a little extra for nginx and Google Chrome
1144
-        add_filter('nocache_headers', ['EE_System', 'extra_nocache_headers'], 10, 1);
1145
-        // prevent browsers from prefetching of the rel='next' link, because it may contain content that interferes with the registration process
1146
-        remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
1147
-    }
1148
-
1149
-
1150
-    /**
1151
-     *    extra_nocache_headers
1152
-     *
1153
-     * @access    public
1154
-     * @param $headers
1155
-     * @return    array
1156
-     */
1157
-    public static function extra_nocache_headers($headers): array
1158
-    {
1159
-        // for NGINX
1160
-        $headers['X-Accel-Expires'] = 0;
1161
-        // plus extra for Google Chrome since it doesn't seem to respect "no-cache", but WILL respect "no-store"
1162
-        $headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, max-age=0';
1163
-        return $headers;
1164
-    }
1165
-
1166
-
1167
-    /**
1168
-     *    nocache_headers
1169
-     *
1170
-     * @access    public
1171
-     * @return    void
1172
-     */
1173
-    public static function nocache_headers()
1174
-    {
1175
-        nocache_headers();
1176
-    }
1177
-
1178
-
1179
-    /**
1180
-     * simply hooks into "wp_list_pages_exclude" filter (for wp_list_pages method) and makes sure EE critical pages are
1181
-     * never returned with the function.
1182
-     *
1183
-     * @param array $exclude_array any existing pages being excluded are in this array.
1184
-     * @return array
1185
-     */
1186
-    public function remove_pages_from_wp_list_pages(array $exclude_array): array
1187
-    {
1188
-        return array_merge($exclude_array, $this->registry->CFG->core->get_critical_pages_array());
1189
-    }
28
+	/**
29
+	 * indicates this is a 'normal' request. Ie, not activation, nor upgrade, nor activation.
30
+	 * So examples of this would be a normal GET request on the frontend or backend, or a POST, etc
31
+	 */
32
+	const req_type_normal = 0;
33
+
34
+	/**
35
+	 * Indicates this is a brand new installation of EE so we should install
36
+	 * tables and default data etc
37
+	 */
38
+	const req_type_new_activation = 1;
39
+
40
+	/**
41
+	 * we've detected that EE has been reactivated (or EE was activated during maintenance mode,
42
+	 * and we just exited maintenance mode). We MUST check the database is setup properly
43
+	 * and that default data is setup too
44
+	 */
45
+	const req_type_reactivation = 2;
46
+
47
+	/**
48
+	 * indicates that EE has been upgraded since its previous request.
49
+	 * We may have data migration scripts to call and will want to trigger maintenance mode
50
+	 */
51
+	const req_type_upgrade = 3;
52
+
53
+	/**
54
+	 * TODO  will detect that EE has been DOWNGRADED. We probably don't want to run in this case...
55
+	 */
56
+	const req_type_downgrade = 4;
57
+
58
+	/**
59
+	 * @deprecated since version 4.6.0.dev.006
60
+	 * Now whenever a new_activation is detected the request type is still just
61
+	 * new_activation (same for reactivation, upgrade, downgrade etc), but if we're in maintenance mode
62
+	 * EE_System::initialize_db_if_no_migrations_required and EE_Addon::initialize_db_if_no_migrations_required
63
+	 * will instead enqueue that EE plugin's db initialization for when we're taken out of maintenance mode.
64
+	 * (Specifically, when the migration manager indicates migrations are finished
65
+	 * EE_Data_Migration_Manager::initialize_db_for_enqueued_ee_plugins() will be called)
66
+	 */
67
+	const req_type_activation_but_not_installed = 5;
68
+
69
+	/**
70
+	 * option prefix for recording the activation history (like core's "espresso_db_update") of addons
71
+	 */
72
+	const addon_activation_history_option_prefix = 'ee_addon_activation_history_';
73
+
74
+	/**
75
+	 * @var AddonManager $addon_manager
76
+	 */
77
+	private $addon_manager;
78
+
79
+	/**
80
+	 * @var EE_System $_instance
81
+	 */
82
+	private static $_instance;
83
+
84
+	/**
85
+	 * @var EE_Registry $registry
86
+	 */
87
+	private $registry;
88
+
89
+	/**
90
+	 * @var LoaderInterface $loader
91
+	 */
92
+	private $loader;
93
+
94
+	/**
95
+	 * @var EE_Capabilities $capabilities
96
+	 */
97
+	private $capabilities;
98
+
99
+	/**
100
+	 * @var EE_Maintenance_Mode $maintenance_mode
101
+	 */
102
+	private $maintenance_mode;
103
+
104
+	/**
105
+	 * @var RequestInterface $request
106
+	 */
107
+	private $request;
108
+
109
+	/**
110
+	 * Stores which type of request this is, options being one of the constants on EE_System starting with req_type_*.
111
+	 * It can be a brand-new activation, a reactivation, an upgrade, a downgrade, or a normal request.
112
+	 *
113
+	 * @var int $_req_type
114
+	 */
115
+	private $_req_type;
116
+
117
+	/**
118
+	 * Whether or not there was a non-micro version change in EE core version during this request
119
+	 *
120
+	 * @var boolean $_major_version_change
121
+	 */
122
+	private $_major_version_change = false;
123
+
124
+	/**
125
+	 * @var Router $router
126
+	 */
127
+	private $router;
128
+
129
+
130
+	/**
131
+	 * @singleton method used to instantiate class object
132
+	 * @param LoaderInterface|null     $loader
133
+	 * @param EE_Maintenance_Mode|null $maintenance_mode
134
+	 * @param EE_Registry|null         $registry
135
+	 * @param RequestInterface|null    $request
136
+	 * @param Router|null              $router
137
+	 * @return EE_System
138
+	 */
139
+	public static function instance(
140
+		LoaderInterface $loader = null,
141
+		EE_Maintenance_Mode $maintenance_mode = null,
142
+		EE_Registry $registry = null,
143
+		RequestInterface $request = null,
144
+		Router $router = null
145
+	): EE_System {
146
+		// check if class object is instantiated
147
+		if (! self::$_instance instanceof EE_System) {
148
+			self::$_instance = new self($loader, $maintenance_mode, $registry, $request, $router);
149
+		}
150
+		return self::$_instance;
151
+	}
152
+
153
+
154
+	/**
155
+	 * resets the instance and returns it
156
+	 *
157
+	 * @return EE_System
158
+	 */
159
+	public static function reset(): EE_System
160
+	{
161
+		self::$_instance->_req_type = null;
162
+		// make sure none of the old hooks are left hanging around
163
+		remove_all_actions('AHEE__EE_System__perform_activations_upgrades_and_migrations');
164
+		// we need to reset the migration manager in order for it to detect DMSs properly
165
+		EE_Data_Migration_Manager::reset();
166
+		self::instance()->detect_activations_or_upgrades();
167
+		self::instance()->perform_activations_upgrades_and_migrations();
168
+		return self::instance();
169
+	}
170
+
171
+
172
+	/**
173
+	 * sets hooks for running rest of system
174
+	 * provides "AHEE__EE_System__construct__complete" hook for EE Addons to use as their starting point
175
+	 * starting EE Addons from any other point may lead to problems
176
+	 *
177
+	 * @param LoaderInterface     $loader
178
+	 * @param EE_Maintenance_Mode $maintenance_mode
179
+	 * @param EE_Registry         $registry
180
+	 * @param RequestInterface    $request
181
+	 * @param Router              $router
182
+	 */
183
+	private function __construct(
184
+		LoaderInterface $loader,
185
+		EE_Maintenance_Mode $maintenance_mode,
186
+		EE_Registry $registry,
187
+		RequestInterface $request,
188
+		Router $router
189
+	) {
190
+		$this->registry         = $registry;
191
+		$this->loader           = $loader;
192
+		$this->request          = $request;
193
+		$this->router           = $router;
194
+		$this->maintenance_mode = $maintenance_mode;
195
+		do_action('AHEE__EE_System__construct__begin', $this);
196
+		add_action(
197
+			'AHEE__EE_Bootstrap__load_espresso_addons',
198
+			[$this, 'loadCapabilities'],
199
+			5
200
+		);
201
+		add_action(
202
+			'AHEE__EE_Bootstrap__load_espresso_addons',
203
+			[$this, 'loadCommandBus'],
204
+			7
205
+		);
206
+		add_action(
207
+			'AHEE__EE_Bootstrap__load_espresso_addons',
208
+			[$this, 'loadPluginApi'],
209
+			9
210
+		);
211
+		// allow addons to load first so that they can register autoloaders, set hooks for running DMS's, etc
212
+		add_action(
213
+			'AHEE__EE_Bootstrap__load_espresso_addons',
214
+			[$this, 'load_espresso_addons']
215
+		);
216
+		// when an ee addon is activated, we want to call the core hook(s) again
217
+		// because the newly-activated addon didn't get a chance to run at all
218
+		add_action('activate_plugin', [$this, 'load_espresso_addons'], 1);
219
+		// detect whether install or upgrade
220
+		add_action(
221
+			'AHEE__EE_Bootstrap__detect_activations_or_upgrades',
222
+			[$this, 'detect_activations_or_upgrades'],
223
+			3
224
+		);
225
+		// load EE_Config, EE_Textdomain, etc
226
+		add_action(
227
+			'AHEE__EE_Bootstrap__load_core_configuration',
228
+			[$this, 'load_core_configuration'],
229
+			5
230
+		);
231
+		// load specifications for matching routes to current request
232
+		add_action(
233
+			'AHEE__EE_Bootstrap__load_core_configuration',
234
+			[$this, 'loadRouteMatchSpecifications']
235
+		);
236
+		// load EE_Config, EE_Textdomain, etc
237
+		add_action(
238
+			'AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets',
239
+			[$this, 'register_shortcodes_modules_and_widgets'],
240
+			7
241
+		);
242
+		// you wanna get going? I wanna get going... let's get going!
243
+		add_action(
244
+			'AHEE__EE_Bootstrap__brew_espresso',
245
+			[$this, 'brew_espresso'],
246
+			9
247
+		);
248
+		// other housekeeping
249
+		// exclude EE critical pages from wp_list_pages
250
+		add_filter(
251
+			'wp_list_pages_excludes',
252
+			[$this, 'remove_pages_from_wp_list_pages'],
253
+			10
254
+		);
255
+		// ALL EE Addons should use the following hook point to attach their initial setup too
256
+		// it's extremely important for EE Addons to register any class autoloaders so that they can be available when the EE_Config loads
257
+		do_action('AHEE__EE_System__construct__complete', $this);
258
+	}
259
+
260
+
261
+	/**
262
+	 * load and setup EE_Capabilities
263
+	 *
264
+	 * @return void
265
+	 */
266
+	public function loadCapabilities()
267
+	{
268
+		$this->capabilities = $this->loader->getShared('EE_Capabilities');
269
+		add_action(
270
+			'AHEE__EE_Capabilities__init_caps__before_initialization',
271
+			function () {
272
+				LoaderFactory::getLoader()->getShared('EE_Payment_Method_Manager');
273
+			}
274
+		);
275
+	}
276
+
277
+
278
+	/**
279
+	 * create and cache the CommandBus, and also add middleware
280
+	 * The CapChecker middleware requires the use of EE_Capabilities
281
+	 * which is why we need to load the CommandBus after Caps are set up
282
+	 *
283
+	 * @return void
284
+	 */
285
+	public function loadCommandBus()
286
+	{
287
+		$this->loader->getShared(
288
+			'CommandBusInterface',
289
+			[
290
+				null,
291
+				apply_filters(
292
+					'FHEE__EE_Load_Espresso_Core__handle_request__CommandBus_middleware',
293
+					[
294
+						$this->loader->getShared('EventEspresso\core\services\commands\middleware\CapChecker'),
295
+						$this->loader->getShared('EventEspresso\core\services\commands\middleware\AddActionHook'),
296
+					]
297
+				),
298
+			]
299
+		);
300
+	}
301
+
302
+
303
+	/**
304
+	 * @return void
305
+	 * @throws Exception
306
+	 */
307
+	public function loadPluginApi()
308
+	{
309
+		$this->addon_manager = $this->loader->getShared(AddonManager::class);
310
+		$this->addon_manager->initialize();
311
+		$this->loader->getShared('EE_Request_Handler');
312
+	}
313
+
314
+
315
+	/**
316
+	 * load_espresso_addons
317
+	 * allow addons to load first so that they can set hooks for running DMS's, etc
318
+	 * this is hooked into both:
319
+	 *    'AHEE__EE_Bootstrap__load_core_configuration'
320
+	 *        which runs during the WP 'plugins_loaded' action at priority 5
321
+	 *    and the WP 'activate_plugin' hook point
322
+	 *
323
+	 * @return void
324
+	 * @throws Exception
325
+	 */
326
+	public function load_espresso_addons()
327
+	{
328
+		// looking for hooks? they've been moved into the AddonManager to maintain compatibility
329
+		$this->addon_manager->loadAddons();
330
+	}
331
+
332
+
333
+	/**
334
+	 * detect_activations_or_upgrades
335
+	 * Checks for activation or upgrade of core first;
336
+	 * then also checks if any registered addons have been activated or upgraded
337
+	 * This is hooked into 'AHEE__EE_Bootstrap__detect_activations_or_upgrades'
338
+	 * which runs during the WP 'plugins_loaded' action at priority 3
339
+	 *
340
+	 * @access public
341
+	 * @return void
342
+	 */
343
+	public function detect_activations_or_upgrades()
344
+	{
345
+		// first off: let's make sure to handle core
346
+		$this->detect_if_activation_or_upgrade();
347
+		foreach ($this->registry->addons as $addon) {
348
+			if ($addon instanceof EE_Addon) {
349
+				// detect teh request type for that addon
350
+				$addon->detect_activation_or_upgrade();
351
+			}
352
+		}
353
+	}
354
+
355
+
356
+	/**
357
+	 * detect_if_activation_or_upgrade
358
+	 * Takes care of detecting whether this is a brand new install or code upgrade,
359
+	 * and either setting up the DB or setting up maintenance mode etc.
360
+	 *
361
+	 * @access public
362
+	 * @return void
363
+	 */
364
+	public function detect_if_activation_or_upgrade()
365
+	{
366
+		do_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin');
367
+		// check if db has been updated, or if its a brand-new installation
368
+		$espresso_db_update = $this->fix_espresso_db_upgrade_option();
369
+		$request_type       = $this->detect_req_type($espresso_db_update);
370
+		// EEH_Debug_Tools::printr( $request_type, '$request_type', __FILE__, __LINE__ );
371
+		switch ($request_type) {
372
+			case EE_System::req_type_new_activation:
373
+				do_action('AHEE__EE_System__detect_if_activation_or_upgrade__new_activation');
374
+				$this->_handle_core_version_change($espresso_db_update);
375
+				break;
376
+			case EE_System::req_type_reactivation:
377
+				do_action('AHEE__EE_System__detect_if_activation_or_upgrade__reactivation');
378
+				$this->_handle_core_version_change($espresso_db_update);
379
+				break;
380
+			case EE_System::req_type_upgrade:
381
+				do_action('AHEE__EE_System__detect_if_activation_or_upgrade__upgrade');
382
+				// migrations may be required now that we've upgraded
383
+				$this->maintenance_mode->set_maintenance_mode_if_db_old();
384
+				$this->_handle_core_version_change($espresso_db_update);
385
+				break;
386
+			case EE_System::req_type_downgrade:
387
+				do_action('AHEE__EE_System__detect_if_activation_or_upgrade__downgrade');
388
+				// its possible migrations are no longer required
389
+				$this->maintenance_mode->set_maintenance_mode_if_db_old();
390
+				$this->_handle_core_version_change($espresso_db_update);
391
+				break;
392
+			case EE_System::req_type_normal:
393
+			default:
394
+				break;
395
+		}
396
+		do_action('AHEE__EE_System__detect_if_activation_or_upgrade__complete');
397
+	}
398
+
399
+
400
+	/**
401
+	 * Updates the list of installed versions and sets hooks for
402
+	 * initializing the database later during the request
403
+	 *
404
+	 * @param array $espresso_db_update
405
+	 */
406
+	private function _handle_core_version_change(array $espresso_db_update)
407
+	{
408
+		$this->update_list_of_installed_versions($espresso_db_update);
409
+		// get ready to verify the DB is ok (provided we aren't in maintenance mode, of course)
410
+		add_action(
411
+			'AHEE__EE_System__perform_activations_upgrades_and_migrations',
412
+			[$this, 'initialize_db_if_no_migrations_required']
413
+		);
414
+	}
415
+
416
+
417
+	/**
418
+	 * standardizes the wp option 'espresso_db_upgrade' which actually stores
419
+	 * information about what versions of EE have been installed and activated,
420
+	 * NOT necessarily the state of the database
421
+	 *
422
+	 * @param mixed $espresso_db_update           the value of the WordPress option.
423
+	 *                                            If not supplied, fetches it from the options table
424
+	 * @return array the correct value of 'espresso_db_upgrade', after saving it, if it needed correction
425
+	 */
426
+	private function fix_espresso_db_upgrade_option($espresso_db_update = null): array
427
+	{
428
+		do_action('FHEE__EE_System__manage_fix_espresso_db_upgrade_option__begin', $espresso_db_update);
429
+		if (! $espresso_db_update) {
430
+			$espresso_db_update = get_option('espresso_db_update');
431
+		}
432
+		// check that option is an array
433
+		if (! is_array($espresso_db_update)) {
434
+			// if option is FALSE, then it never existed
435
+			if ($espresso_db_update === false) {
436
+				// make $espresso_db_update an array and save option with autoload OFF
437
+				$espresso_db_update = [];
438
+				add_option('espresso_db_update', $espresso_db_update, '', 'no');
439
+			} else {
440
+				// option is NOT FALSE but also is NOT an array, so make it an array and save it
441
+				$espresso_db_update = [$espresso_db_update => []];
442
+				update_option('espresso_db_update', $espresso_db_update);
443
+			}
444
+		} else {
445
+			$corrected_db_update = [];
446
+			// if IS an array, but is it an array where KEYS are version numbers, and values are arrays?
447
+			foreach ($espresso_db_update as $should_be_version_string => $should_be_array) {
448
+				if (is_int($should_be_version_string) && ! is_array($should_be_array)) {
449
+					// the key is an int, and the value IS NOT an array
450
+					// so it must be numerically-indexed, where values are versions installed...
451
+					// fix it!
452
+					$version_string                         = $should_be_array;
453
+					$corrected_db_update[ $version_string ] = ['unknown-date'];
454
+				} else {
455
+					// ok it checks out
456
+					$corrected_db_update[ $should_be_version_string ] = $should_be_array;
457
+				}
458
+			}
459
+			$espresso_db_update = $corrected_db_update;
460
+			update_option('espresso_db_update', $espresso_db_update);
461
+		}
462
+		do_action('FHEE__EE_System__manage_fix_espresso_db_upgrade_option__complete', $espresso_db_update);
463
+		return ! empty($espresso_db_update) ? $espresso_db_update : [];
464
+	}
465
+
466
+
467
+	/**
468
+	 * Does the traditional work of setting up the plugin's database and adding default data.
469
+	 * If migration script/process did not exist, this is what would happen on every activation/reactivation/upgrade.
470
+	 * NOTE: if we're in maintenance mode (which would be the case if we detect there are data
471
+	 * migration scripts that need to be run and a version change happens), enqueues core for database initialization,
472
+	 * so that it will be done when migrations are finished
473
+	 *
474
+	 * @param boolean $initialize_addons_too if true, we double-check addons' database tables etc too;
475
+	 * @param boolean $verify_schema         if true will re-check the database tables have the correct schema.
476
+	 *                                       This is a resource-intensive job
477
+	 *                                       so we prefer to only do it when necessary
478
+	 * @return void
479
+	 * @throws EE_Error
480
+	 * @throws ReflectionException
481
+	 */
482
+	public function initialize_db_if_no_migrations_required($initialize_addons_too = false, $verify_schema = true)
483
+	{
484
+		$request_type = $this->detect_req_type();
485
+		// only initialize system if we're not in maintenance mode.
486
+		if ($this->maintenance_mode->level() !== EE_Maintenance_Mode::level_2_complete_maintenance) {
487
+			/** @var EventEspresso\core\domain\services\custom_post_types\RewriteRules $rewrite_rules */
488
+			$rewrite_rules = $this->loader->getShared(
489
+				'EventEspresso\core\domain\services\custom_post_types\RewriteRules'
490
+			);
491
+			$rewrite_rules->flush();
492
+			if ($verify_schema) {
493
+				EEH_Activation::initialize_db_and_folders();
494
+			}
495
+			EEH_Activation::initialize_db_content();
496
+			EEH_Activation::system_initialization();
497
+			if ($initialize_addons_too) {
498
+				$this->initialize_addons();
499
+			}
500
+		} else {
501
+			EE_Data_Migration_Manager::instance()->enqueue_db_initialization_for('Core');
502
+		}
503
+		if (
504
+			$request_type === EE_System::req_type_new_activation
505
+			|| $request_type === EE_System::req_type_reactivation
506
+			|| (
507
+				$request_type === EE_System::req_type_upgrade
508
+				&& $this->is_major_version_change()
509
+			)
510
+		) {
511
+			add_action('AHEE__EE_System__initialize_last', [$this, 'redirect_to_about_ee'], 9);
512
+		}
513
+	}
514
+
515
+
516
+	/**
517
+	 * Initializes the db for all registered addons
518
+	 *
519
+	 * @throws EE_Error
520
+	 * @throws ReflectionException
521
+	 */
522
+	public function initialize_addons()
523
+	{
524
+		// foreach registered addon, make sure its db is up-to-date too
525
+		foreach ($this->registry->addons as $addon) {
526
+			if ($addon instanceof EE_Addon) {
527
+				$addon->initialize_db_if_no_migrations_required();
528
+			}
529
+		}
530
+	}
531
+
532
+
533
+	/**
534
+	 * Adds the current code version to the saved wp option which stores a list of all ee versions ever installed.
535
+	 *
536
+	 * @param array  $version_history
537
+	 * @param string $current_version_to_add version to be added to the version history
538
+	 * @return    boolean success as to whether or not this option was changed
539
+	 */
540
+	public function update_list_of_installed_versions($version_history = null, $current_version_to_add = null): bool
541
+	{
542
+		if (! $version_history) {
543
+			$version_history = $this->fix_espresso_db_upgrade_option($version_history);
544
+		}
545
+		if ($current_version_to_add === null) {
546
+			$current_version_to_add = espresso_version();
547
+		}
548
+		$version_history[ $current_version_to_add ][] = date('Y-m-d H:i:s', time());
549
+		// re-save
550
+		return update_option('espresso_db_update', $version_history);
551
+	}
552
+
553
+
554
+	/**
555
+	 * Detects if the current version indicated in the has existed in the list of
556
+	 * previously-installed versions of EE (espresso_db_update). Does NOT modify it (ie, no side-effect)
557
+	 *
558
+	 * @param array $espresso_db_update array from the wp option stored under the name 'espresso_db_update'.
559
+	 *                                  If not supplied, fetches it from the options table.
560
+	 *                                  Also, caches its result so later parts of the code can also know whether
561
+	 *                                  there's been an update or not. This way we can add the current version to
562
+	 *                                  espresso_db_update, but still know if this is a new install or not
563
+	 * @return int one of the constants on EE_System::req_type_
564
+	 */
565
+	public function detect_req_type($espresso_db_update = null): int
566
+	{
567
+		if ($this->_req_type === null) {
568
+			$espresso_db_update          = ! empty($espresso_db_update)
569
+				? $espresso_db_update
570
+				: $this->fix_espresso_db_upgrade_option();
571
+			$this->_req_type             = EE_System::detect_req_type_given_activation_history(
572
+				$espresso_db_update,
573
+				'ee_espresso_activation',
574
+				espresso_version()
575
+			);
576
+			$this->_major_version_change = $this->_detect_major_version_change($espresso_db_update);
577
+			$this->request->setIsActivation($this->_req_type !== EE_System::req_type_normal);
578
+		}
579
+		return $this->_req_type;
580
+	}
581
+
582
+
583
+	/**
584
+	 * Returns whether or not there was a non-micro version change (ie, change in either
585
+	 * the first or second number in the version. Eg 4.9.0.rc.001 to 4.10.0.rc.000,
586
+	 * but not 4.9.0.rc.0001 to 4.9.1.rc.0001
587
+	 *
588
+	 * @param $activation_history
589
+	 * @return bool
590
+	 */
591
+	private function _detect_major_version_change($activation_history): bool
592
+	{
593
+		$previous_version       = EE_System::getMostRecentlyActiveVersion($activation_history);
594
+		$previous_version_parts = explode('.', $previous_version);
595
+		$current_version_parts  = explode('.', espresso_version());
596
+		return isset(
597
+			$previous_version_parts[0],
598
+			$previous_version_parts[1],
599
+			$current_version_parts[0],
600
+			$current_version_parts[1]
601
+		) && (
602
+			$previous_version_parts[0] !== $current_version_parts[0]
603
+			|| $previous_version_parts[1] !== $current_version_parts[1]
604
+		);
605
+	}
606
+
607
+
608
+	/**
609
+	 * Returns true if either the major or minor version of EE changed during this request.
610
+	 * Eg 4.9.0.rc.001 to 4.10.0.rc.000, but not 4.9.0.rc.0001 to 4.9.1.rc.0001
611
+	 *
612
+	 * @return bool
613
+	 */
614
+	public function is_major_version_change(): bool
615
+	{
616
+		return $this->_major_version_change;
617
+	}
618
+
619
+
620
+	/**
621
+	 * Determines the request type for any ee addon, given three piece of info: the current array of activation
622
+	 * histories (for core that' 'espresso_db_update' wp option); the name of the WordPress option which is temporarily
623
+	 * set upon activation of the plugin (for core it's 'ee_espresso_activation'); and the version that this plugin was
624
+	 * just activated to (for core that will always be espresso_version())
625
+	 *
626
+	 * @param array|null $activation_history             the option's value which stores the activation history for
627
+	 *                                                 this
628
+	 *                                                 ee plugin. for core that's 'espresso_db_update'
629
+	 * @param string $activation_indicator_option_name the name of the WordPress option that is temporarily set to
630
+	 *                                                 indicate that this plugin was just activated
631
+	 * @param string $current_version                  the version that was just upgraded to (for core that will be
632
+	 *                                                 espresso_version())
633
+	 * @return int one of the constants on EE_System::req_type_
634
+	 */
635
+	public static function detect_req_type_given_activation_history(
636
+		array $activation_history,
637
+		string $activation_indicator_option_name,
638
+		string $current_version
639
+	): int {
640
+		$version_change = self::compareVersionWithPrevious($activation_history, $current_version);
641
+		$is_activation  = get_option($activation_indicator_option_name, false);
642
+		$req_type       = self::getRequestType($activation_history, $version_change, $is_activation);
643
+		if ($is_activation) {
644
+			// cleanup in aisle 6
645
+			delete_option($activation_indicator_option_name);
646
+		}
647
+		return $req_type;
648
+	}
649
+
650
+
651
+	/**
652
+	 * @param array  $activation_history
653
+	 * @param int    $version_change
654
+	 * @param bool   $is_activation
655
+	 * @return int
656
+	 * @since $VID:$
657
+	 */
658
+	private static function getRequestType(array $activation_history, int $version_change, bool $is_activation): int
659
+	{
660
+		// if no previous activation history exists, then this is a brand new install
661
+		if (empty($activation_history)) {
662
+			return EE_System::req_type_new_activation;
663
+		}
664
+		// current version is higher than previous version, so it's an upgrade
665
+		if ($version_change === 1) {
666
+			return EE_System::req_type_upgrade;
667
+		}
668
+		// current version is lower than previous version, so it's a downgrade
669
+		if ($version_change === -1) {
670
+			return EE_System::req_type_downgrade;
671
+		}
672
+		// version hasn't changed since last version so check if the activation indicator is set
673
+		// to determine if it's a reactivation, or just a normal request
674
+		return $is_activation
675
+			? EE_System::req_type_reactivation
676
+			: EE_System::req_type_normal;
677
+	}
678
+
679
+
680
+	/**
681
+	 * Detects if the $version_to_upgrade_to is higher than the most recent version in
682
+	 * the $activation_history_for_addon
683
+	 *
684
+	 * @param array  $activation_history    array where keys are versions,
685
+	 *                                      values are arrays of times activated (sometimes 'unknown-date')
686
+	 * @param string $current_version
687
+	 * @return int results of version_compare( $version_to_upgrade_to, $most_recently_active_version ).
688
+	 *                                      -1 if $version_to_upgrade_to is LOWER (downgrade);
689
+	 *                                      0 if $version_to_upgrade_to MATCHES (reactivation or normal request);
690
+	 *                                      1 if $version_to_upgrade_to is HIGHER (upgrade) ;
691
+	 */
692
+	private static function compareVersionWithPrevious(array $activation_history, string $current_version): int
693
+	{
694
+		// find the most recently-activated version
695
+		$most_recently_active_version = EE_System::getMostRecentlyActiveVersion($activation_history);
696
+		return version_compare($current_version, $most_recently_active_version);
697
+	}
698
+
699
+
700
+	/**
701
+	 * Gets the most recently active version listed in the activation history,
702
+	 * and if none are found (ie, it's a brand new install) returns '0.0.0.dev.000'.
703
+	 *
704
+	 * @param array $activation_history  (keys are versions, values are arrays of times activated,
705
+	 *                                   sometimes containing 'unknown-date'
706
+	 * @return string
707
+	 */
708
+	private static function getMostRecentlyActiveVersion(array $activation_history): string
709
+	{
710
+		$most_recent_activation_date  = '1970-01-01 00:00:00';
711
+		$most_recently_active_version = '0.0.0.dev.000';
712
+		if (is_array($activation_history)) {
713
+			foreach ($activation_history as $version => $activation_dates) {
714
+				// check there is a record of when this version was activated.
715
+				// Otherwise, mark it as unknown
716
+				if (! $activation_dates) {
717
+					$activation_dates = ['unknown-date'];
718
+				}
719
+				$activation_dates = is_string($activation_dates) ? [$activation_dates] : $activation_dates;
720
+				foreach ($activation_dates as $activation_date) {
721
+					if ($activation_date !== 'unknown-date' && $activation_date > $most_recent_activation_date) {
722
+						$most_recently_active_version = $version;
723
+						$most_recent_activation_date  = $activation_date;
724
+					}
725
+				}
726
+			}
727
+		}
728
+		return $most_recently_active_version;
729
+	}
730
+
731
+
732
+	/**
733
+	 * This redirects to the about EE page after activation
734
+	 *
735
+	 * @return void
736
+	 */
737
+	public function redirect_to_about_ee()
738
+	{
739
+		$notices = EE_Error::get_notices(false);
740
+		// if current user is an admin and it's not an ajax or rest request
741
+		if (
742
+			! isset($notices['errors'])
743
+			&& $this->request->isAdmin()
744
+			&& apply_filters(
745
+				'FHEE__EE_System__redirect_to_about_ee__do_redirect',
746
+				$this->capabilities->current_user_can('manage_options', 'espresso_about_default')
747
+			)
748
+		) {
749
+			$query_params = ['page' => 'espresso_about'];
750
+			if (EE_System::instance()->detect_req_type() === EE_System::req_type_new_activation) {
751
+				$query_params['new_activation'] = true;
752
+			}
753
+			if (EE_System::instance()->detect_req_type() === EE_System::req_type_reactivation) {
754
+				$query_params['reactivation'] = true;
755
+			}
756
+			$url = add_query_arg($query_params, admin_url('admin.php'));
757
+			EEH_URL::safeRedirectAndExit($url);
758
+		}
759
+	}
760
+
761
+
762
+	/**
763
+	 * load_core_configuration
764
+	 * this is hooked into 'AHEE__EE_Bootstrap__load_core_configuration'
765
+	 * which runs during the WP 'plugins_loaded' action at priority 5
766
+	 *
767
+	 * @return void
768
+	 * @throws ReflectionException
769
+	 * @throws Exception
770
+	 */
771
+	public function load_core_configuration()
772
+	{
773
+		do_action('AHEE__EE_System__load_core_configuration__begin', $this);
774
+		$this->loader->getShared('EE_Load_Textdomain');
775
+		// load textdomain
776
+		EE_Load_Textdomain::load_textdomain();
777
+		// load caf stuff a chance to play during the activation process too.
778
+		$this->_maybe_brew_regular();
779
+		// load and setup EE_Config and EE_Network_Config
780
+		$config = $this->loader->getShared('EE_Config');
781
+		$this->loader->getShared('EE_Network_Config');
782
+		// setup autoloaders
783
+		// enable logging?
784
+		if ($config->admin->use_remote_logging) {
785
+			$this->loader->getShared('EE_Log');
786
+		}
787
+		// check for activation errors
788
+		$activation_errors = get_option('ee_plugin_activation_errors', false);
789
+		if ($activation_errors) {
790
+			EE_Error::add_error($activation_errors, __FILE__, __FUNCTION__, __LINE__);
791
+			update_option('ee_plugin_activation_errors', false);
792
+		}
793
+		// get model names
794
+		$this->_parse_model_names();
795
+		// configure custom post type definitions
796
+		$this->loader->getShared('EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions');
797
+		$this->loader->getShared('EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions');
798
+		do_action('AHEE__EE_System__load_core_configuration__complete', $this);
799
+	}
800
+
801
+
802
+	/**
803
+	 * cycles through all of the models/*.model.php files, and assembles an array of model names
804
+	 *
805
+	 * @return void
806
+	 * @throws ReflectionException
807
+	 */
808
+	private function _parse_model_names()
809
+	{
810
+		// get all the files in the EE_MODELS folder that end in .model.php
811
+		$models                 = glob(EE_MODELS . '*.model.php');
812
+		$model_names            = [];
813
+		$non_abstract_db_models = [];
814
+		foreach ($models as $model) {
815
+			// get model classname
816
+			$classname       = EEH_File::get_classname_from_filepath_with_standard_filename($model);
817
+			$short_name      = str_replace('EEM_', '', $classname);
818
+			$reflectionClass = new ReflectionClass($classname);
819
+			if ($reflectionClass->isSubclassOf('EEM_Base') && ! $reflectionClass->isAbstract()) {
820
+				$non_abstract_db_models[ $short_name ] = $classname;
821
+			}
822
+			$model_names[ $short_name ] = $classname;
823
+		}
824
+		$this->registry->models                 = apply_filters('FHEE__EE_System__parse_model_names', $model_names);
825
+		$this->registry->non_abstract_db_models = apply_filters(
826
+			'FHEE__EE_System__parse_implemented_model_names',
827
+			$non_abstract_db_models
828
+		);
829
+	}
830
+
831
+
832
+	/**
833
+	 * The purpose of this method is to simply check for a file named "caffeinated/brewing_regular.php" for any hooks
834
+	 * that need to be setup before our EE_System launches.
835
+	 *
836
+	 * @return void
837
+	 * @throws DomainException
838
+	 * @throws InvalidArgumentException
839
+	 * @throws InvalidDataTypeException
840
+	 * @throws InvalidInterfaceException
841
+	 * @throws InvalidClassException
842
+	 * @throws InvalidFilePathException
843
+	 */
844
+	private function _maybe_brew_regular()
845
+	{
846
+		/** @var Domain $domain */
847
+		$domain = DomainFactory::getEventEspressoCoreDomain();
848
+		if ($domain->isCaffeinated()) {
849
+			require_once EE_CAFF_PATH . 'brewing_regular.php';
850
+		}
851
+	}
852
+
853
+
854
+	/**
855
+	 * @throws Exception
856
+	 * @since 4.9.71.p
857
+	 */
858
+	public function loadRouteMatchSpecifications()
859
+	{
860
+		try {
861
+			$this->loader->getShared('EventEspresso\core\services\routing\RouteMatchSpecificationManager');
862
+			$this->loader->getShared('EventEspresso\core\services\routing\RouteCollection');
863
+			$this->router->loadPrimaryRoutes();
864
+		} catch (Exception $exception) {
865
+			new ExceptionStackTraceDisplay($exception);
866
+		}
867
+		do_action('AHEE__EE_System__loadRouteMatchSpecifications');
868
+	}
869
+
870
+
871
+	/**
872
+	 * register_shortcodes_modules_and_widgets
873
+	 * generate lists of shortcodes and modules, then verify paths and classes
874
+	 * This is hooked into 'AHEE__EE_Bootstrap__register_shortcodes_modules_and_widgets'
875
+	 * which runs during the WP 'plugins_loaded' action at priority 7
876
+	 *
877
+	 * @access public
878
+	 * @return void
879
+	 * @throws Exception
880
+	 */
881
+	public function register_shortcodes_modules_and_widgets()
882
+	{
883
+		$this->router->registerShortcodesModulesAndWidgets();
884
+		do_action('AHEE__EE_System__register_shortcodes_modules_and_widgets');
885
+		// check for addons using old hook point
886
+		if (has_action('AHEE__EE_System__register_shortcodes_modules_and_addons')) {
887
+			$this->_incompatible_addon_error();
888
+		}
889
+	}
890
+
891
+
892
+	/**
893
+	 * _incompatible_addon_error
894
+	 *
895
+	 * @access public
896
+	 * @return void
897
+	 */
898
+	private function _incompatible_addon_error()
899
+	{
900
+		// get array of classes hooking into here
901
+		$class_names = EEH_Class_Tools::get_class_names_for_all_callbacks_on_hook(
902
+			'AHEE__EE_System__register_shortcodes_modules_and_addons'
903
+		);
904
+		if (! empty($class_names)) {
905
+			$msg = __(
906
+				'The following plugins, addons, or modules appear to be incompatible with this version of Event Espresso and were automatically deactivated to avoid fatal errors:',
907
+				'event_espresso'
908
+			);
909
+			$msg .= '<ul>';
910
+			foreach ($class_names as $class_name) {
911
+				$msg .= '<li><b>Event Espresso - '
912
+						. str_replace(
913
+							['EE_', 'EEM_', 'EED_', 'EES_', 'EEW_'],
914
+							'',
915
+							$class_name
916
+						) . '</b></li>';
917
+			}
918
+			$msg .= '</ul>';
919
+			$msg .= __(
920
+				'Compatibility issues can be avoided and/or resolved by keeping addons and plugins updated to the latest version.',
921
+				'event_espresso'
922
+			);
923
+			// save list of incompatible addons to wp-options for later use
924
+			add_option('ee_incompatible_addons', $class_names, '', 'no');
925
+			if (is_admin()) {
926
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
927
+			}
928
+		}
929
+	}
930
+
931
+
932
+	/**
933
+	 * brew_espresso
934
+	 * begins the process of setting hooks for initializing EE in the correct order
935
+	 * This is happening on the 'AHEE__EE_Bootstrap__brew_espresso' hook point
936
+	 * which runs during the WP 'plugins_loaded' action at priority 9
937
+	 *
938
+	 * @return void
939
+	 * @throws Exception
940
+	 */
941
+	public function brew_espresso()
942
+	{
943
+		do_action('AHEE__EE_System__brew_espresso__begin', $this);
944
+		// load some final core systems
945
+		add_action('init', [$this, 'set_hooks_for_core'], 1);
946
+		add_action('init', [$this, 'perform_activations_upgrades_and_migrations'], 3);
947
+		add_action('init', [$this, 'load_CPTs_and_session'], 5);
948
+		add_action('init', [$this, 'load_controllers'], 7);
949
+		add_action('init', [$this, 'core_loaded_and_ready'], 9);
950
+		add_action('init', [$this, 'initialize'], 10);
951
+		add_action('init', [$this, 'initialize_last'], 100);
952
+		$this->router->brewEspresso();
953
+		do_action('AHEE__EE_System__brew_espresso__complete', $this);
954
+	}
955
+
956
+
957
+	/**
958
+	 *    set_hooks_for_core
959
+	 *
960
+	 * @access public
961
+	 * @return    void
962
+	 * @throws EE_Error
963
+	 */
964
+	public function set_hooks_for_core()
965
+	{
966
+		$this->_deactivate_incompatible_addons();
967
+		do_action('AHEE__EE_System__set_hooks_for_core');
968
+		$this->loader->getShared('EventEspresso\core\domain\values\session\SessionLifespan');
969
+		// caps need to be initialized on every request so that capability maps are set.
970
+		// @see https://events.codebasehq.com/projects/event-espresso/tickets/8674
971
+		$this->registry->CAP->init_caps();
972
+	}
973
+
974
+
975
+	/**
976
+	 * Using the information gathered in EE_System::_incompatible_addon_error,
977
+	 * deactivates any addons considered incompatible with the current version of EE
978
+	 */
979
+	private function _deactivate_incompatible_addons()
980
+	{
981
+		$incompatible_addons = get_option('ee_incompatible_addons', []);
982
+		if (! empty($incompatible_addons)) {
983
+			$active_plugins = get_option('active_plugins', []);
984
+			foreach ($active_plugins as $active_plugin) {
985
+				foreach ($incompatible_addons as $incompatible_addon) {
986
+					if (strpos($active_plugin, $incompatible_addon) !== false) {
987
+						unset($_GET['activate']);
988
+						espresso_deactivate_plugin($active_plugin);
989
+					}
990
+				}
991
+			}
992
+		}
993
+	}
994
+
995
+
996
+	/**
997
+	 *    perform_activations_upgrades_and_migrations
998
+	 *
999
+	 * @access public
1000
+	 * @return    void
1001
+	 */
1002
+	public function perform_activations_upgrades_and_migrations()
1003
+	{
1004
+		do_action('AHEE__EE_System__perform_activations_upgrades_and_migrations');
1005
+	}
1006
+
1007
+
1008
+	/**
1009
+	 * @return void
1010
+	 * @throws DomainException
1011
+	 */
1012
+	public function load_CPTs_and_session()
1013
+	{
1014
+		do_action('AHEE__EE_System__load_CPTs_and_session__start');
1015
+		/** @var EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies $register_custom_taxonomies */
1016
+		$register_custom_taxonomies = $this->loader->getShared(
1017
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'
1018
+		);
1019
+		$register_custom_taxonomies->registerCustomTaxonomies();
1020
+		/** @var EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes $register_custom_post_types */
1021
+		$register_custom_post_types = $this->loader->getShared(
1022
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'
1023
+		);
1024
+		$register_custom_post_types->registerCustomPostTypes();
1025
+		/** @var EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomyTerms $register_custom_taxonomy_terms */
1026
+		$register_custom_taxonomy_terms = $this->loader->getShared(
1027
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomyTerms'
1028
+		);
1029
+		$register_custom_taxonomy_terms->registerCustomTaxonomyTerms();
1030
+		// load legacy Custom Post Types and Taxonomies
1031
+		$this->loader->getShared('EE_Register_CPTs');
1032
+		do_action('AHEE__EE_System__load_CPTs_and_session__complete');
1033
+	}
1034
+
1035
+
1036
+	/**
1037
+	 * load_controllers
1038
+	 * this is the best place to load any additional controllers that needs access to EE core.
1039
+	 * it is expected that all basic core EE systems, that are not dependant on the current request are loaded at this
1040
+	 * time
1041
+	 *
1042
+	 * @access public
1043
+	 * @return void
1044
+	 * @throws Exception
1045
+	 */
1046
+	public function load_controllers()
1047
+	{
1048
+		do_action('AHEE__EE_System__load_controllers__start');
1049
+		$this->router->loadControllers();
1050
+		do_action('AHEE__EE_System__load_controllers__complete');
1051
+	}
1052
+
1053
+
1054
+	/**
1055
+	 * core_loaded_and_ready
1056
+	 * all of the basic EE core should be loaded at this point and available regardless of M-Mode
1057
+	 *
1058
+	 * @access public
1059
+	 * @return void
1060
+	 * @throws Exception
1061
+	 */
1062
+	public function core_loaded_and_ready()
1063
+	{
1064
+		$this->router->coreLoadedAndReady();
1065
+		// integrate WP_Query with the EE models
1066
+		$this->loader->getShared('EE_CPT_Strategy');
1067
+		do_action('AHEE__EE_System__core_loaded_and_ready');
1068
+		// always load template tags, because it's faster than checking if it's a front-end request, and many page
1069
+		// builders require these even on the front-end
1070
+		require_once EE_PUBLIC . 'template_tags.php';
1071
+		do_action('AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons');
1072
+	}
1073
+
1074
+
1075
+	/**
1076
+	 * initialize
1077
+	 * this is the best place to begin initializing client code
1078
+	 *
1079
+	 * @access public
1080
+	 * @return void
1081
+	 */
1082
+	public function initialize()
1083
+	{
1084
+		do_action('AHEE__EE_System__initialize');
1085
+	}
1086
+
1087
+
1088
+	/**
1089
+	 * initialize_last
1090
+	 * this is run really late during the WP init hook point, and ensures that mostly everything else that needs to
1091
+	 * initialize has done so
1092
+	 *
1093
+	 * @access public
1094
+	 * @return void
1095
+	 * @throws Exception
1096
+	 */
1097
+	public function initialize_last()
1098
+	{
1099
+		do_action('AHEE__EE_System__initialize_last');
1100
+		/** @var EventEspresso\core\domain\services\custom_post_types\RewriteRules $rewrite_rules */
1101
+		$rewrite_rules = $this->loader->getShared(
1102
+			'EventEspresso\core\domain\services\custom_post_types\RewriteRules'
1103
+		);
1104
+		$rewrite_rules->flushRewriteRules();
1105
+		$this->router->initializeLast();
1106
+		add_action('admin_bar_init', [$this, 'addEspressoToolbar']);
1107
+	}
1108
+
1109
+
1110
+	/**
1111
+	 * @return void
1112
+	 */
1113
+	public function addEspressoToolbar()
1114
+	{
1115
+		$this->loader->getShared(
1116
+			'EventEspresso\core\domain\services\admin\AdminToolBar',
1117
+			[$this->registry->CAP]
1118
+		);
1119
+	}
1120
+
1121
+
1122
+	/**
1123
+	 * do_not_cache
1124
+	 * sets no cache headers and defines no cache constants for WP plugins
1125
+	 *
1126
+	 * @access public
1127
+	 * @return void
1128
+	 */
1129
+	public static function do_not_cache()
1130
+	{
1131
+		// set no cache constants
1132
+		if (! defined('DONOTCACHEPAGE')) {
1133
+			define('DONOTCACHEPAGE', true);
1134
+		}
1135
+		if (! defined('DONOTCACHCEOBJECT')) {
1136
+			define('DONOTCACHCEOBJECT', true);
1137
+		}
1138
+		if (! defined('DONOTCACHEDB')) {
1139
+			define('DONOTCACHEDB', true);
1140
+		}
1141
+		// add no cache headers
1142
+		add_action('send_headers', ['EE_System', 'nocache_headers'], 10);
1143
+		// plus a little extra for nginx and Google Chrome
1144
+		add_filter('nocache_headers', ['EE_System', 'extra_nocache_headers'], 10, 1);
1145
+		// prevent browsers from prefetching of the rel='next' link, because it may contain content that interferes with the registration process
1146
+		remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
1147
+	}
1148
+
1149
+
1150
+	/**
1151
+	 *    extra_nocache_headers
1152
+	 *
1153
+	 * @access    public
1154
+	 * @param $headers
1155
+	 * @return    array
1156
+	 */
1157
+	public static function extra_nocache_headers($headers): array
1158
+	{
1159
+		// for NGINX
1160
+		$headers['X-Accel-Expires'] = 0;
1161
+		// plus extra for Google Chrome since it doesn't seem to respect "no-cache", but WILL respect "no-store"
1162
+		$headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, max-age=0';
1163
+		return $headers;
1164
+	}
1165
+
1166
+
1167
+	/**
1168
+	 *    nocache_headers
1169
+	 *
1170
+	 * @access    public
1171
+	 * @return    void
1172
+	 */
1173
+	public static function nocache_headers()
1174
+	{
1175
+		nocache_headers();
1176
+	}
1177
+
1178
+
1179
+	/**
1180
+	 * simply hooks into "wp_list_pages_exclude" filter (for wp_list_pages method) and makes sure EE critical pages are
1181
+	 * never returned with the function.
1182
+	 *
1183
+	 * @param array $exclude_array any existing pages being excluded are in this array.
1184
+	 * @return array
1185
+	 */
1186
+	public function remove_pages_from_wp_list_pages(array $exclude_array): array
1187
+	{
1188
+		return array_merge($exclude_array, $this->registry->CFG->core->get_critical_pages_array());
1189
+	}
1190 1190
 }
Please login to merge, or discard this patch.
admin_pages/registration_form/Registration_Form_Admin_Page.core.php 2 patches
Indentation   +708 added lines, -708 removed lines patch added patch discarded remove patch
@@ -15,659 +15,659 @@  discard block
 block discarded – undo
15 15
 class Registration_Form_Admin_Page extends EE_Admin_Page
16 16
 {
17 17
 
18
-    /**
19
-     * _question
20
-     * holds the specific question object for the question details screen
21
-     *
22
-     * @var EE_Question $_question
23
-     */
24
-    protected $_question;
25
-
26
-    /**
27
-     * _question_group
28
-     * holds the specific question group object for the question group details screen
29
-     *
30
-     * @var EE_Question_Group $_question_group
31
-     */
32
-    protected $_question_group;
33
-
34
-    /**
35
-     *_question_model EEM_Question model instance (for queries)
36
-     *
37
-     * @var EEM_Question $_question_model ;
38
-     */
39
-    protected $_question_model;
40
-
41
-    /**
42
-     * _question_group_model EEM_Question_group instance (for queries)
43
-     *
44
-     * @var EEM_Question_Group $_question_group_model
45
-     */
46
-    protected $_question_group_model;
47
-
48
-
49
-    /**
50
-     * @Constructor
51
-     * @param bool $routing indicate whether we want to just load the object and handle routing or just load the object.
52
-     * @access public
53
-     */
54
-    public function __construct($routing = true)
55
-    {
56
-        require_once(EE_MODELS . 'EEM_Question.model.php');
57
-        require_once(EE_MODELS . 'EEM_Question_Group.model.php');
58
-        $this->_question_model = EEM_Question::instance();
59
-        $this->_question_group_model = EEM_Question_Group::instance();
60
-        parent::__construct($routing);
61
-    }
62
-
63
-
64
-    protected function _init_page_props()
65
-    {
66
-        $this->page_slug = REGISTRATION_FORM_PG_SLUG;
67
-        $this->page_label = esc_html__('Registration Form', 'event_espresso');
68
-        $this->_admin_base_url = REGISTRATION_FORM_ADMIN_URL;
69
-        $this->_admin_base_path = REGISTRATION_FORM_ADMIN;
70
-    }
71
-
72
-
73
-    protected function _ajax_hooks()
74
-    {
75
-    }
76
-
77
-
78
-    protected function _define_page_props()
79
-    {
80
-        $this->_admin_page_title = esc_html__('Registration Form', 'event_espresso');
81
-        $this->_labels = array(
82
-            'buttons' => array(
83
-                'edit_question' => esc_html__('Edit Question', 'event_espresso'),
84
-            ),
85
-        );
86
-    }
87
-
88
-
89
-    /**
90
-     *_set_page_routes
91
-     */
92
-    protected function _set_page_routes()
93
-    {
94
-        $qst_id = ! empty($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0;
95
-        $this->_page_routes = array(
96
-            'default' => array(
97
-                'func'       => '_questions_overview_list_table',
98
-                'capability' => 'ee_read_questions',
99
-            ),
100
-
101
-            'edit_question' => array(
102
-                'func'       => '_edit_question',
103
-                'capability' => 'ee_edit_question',
104
-                'obj_id'     => $qst_id,
105
-                'args'       => array('edit'),
106
-            ),
107
-
108
-            'question_groups' => array(
109
-                'func'       => '_questions_groups_preview',
110
-                'capability' => 'ee_read_question_groups',
111
-            ),
112
-
113
-            'update_question' => array(
114
-                'func'       => '_insert_or_update_question',
115
-                'args'       => array('new_question' => false),
116
-                'capability' => 'ee_edit_question',
117
-                'obj_id'     => $qst_id,
118
-                'noheader'   => true,
119
-            ),
120
-        );
121
-    }
122
-
123
-
124
-    protected function _set_page_config()
125
-    {
126
-        $this->_page_config = array(
127
-            'default' => array(
128
-                'nav'           => array(
129
-                    'label' => esc_html__('Questions', 'event_espresso'),
130
-                    'order' => 10,
131
-                ),
132
-                'list_table'    => 'Registration_Form_Questions_Admin_List_Table',
133
-                'metaboxes'     => $this->_default_espresso_metaboxes,
134
-                'help_tabs'     => array(
135
-                    'registration_form_questions_overview_help_tab'                           => array(
136
-                        'title'    => esc_html__('Questions Overview', 'event_espresso'),
137
-                        'filename' => 'registration_form_questions_overview',
138
-                    ),
139
-                    'registration_form_questions_overview_table_column_headings_help_tab'     => array(
140
-                        'title'    => esc_html__('Questions Overview Table Column Headings', 'event_espresso'),
141
-                        'filename' => 'registration_form_questions_overview_table_column_headings',
142
-                    ),
143
-                    'registration_form_questions_overview_views_bulk_actions_search_help_tab' => array(
144
-                        'title'    => esc_html__('Question Overview Views & Bulk Actions & Search', 'event_espresso'),
145
-                        'filename' => 'registration_form_questions_overview_views_bulk_actions_search',
146
-                    ),
147
-                ),
148
-                'help_tour'     => array('Registration_Form_Questions_Overview_Help_Tour'),
149
-                'require_nonce' => false,
150
-                'qtips'         => array(
151
-                    'EE_Registration_Form_Tips',
152
-                )/**/
153
-            ),
154
-
155
-            'question_groups' => array(
156
-                'nav'           => array(
157
-                    'label' => esc_html__('Question Groups', 'event_espresso'),
158
-                    'order' => 20,
159
-                ),
160
-                'metaboxes'     => $this->_default_espresso_metaboxes,
161
-                'help_tabs'     => array(
162
-                    'registration_form_question_groups_help_tab' => array(
163
-                        'title'    => esc_html__('Question Groups', 'event_espresso'),
164
-                        'filename' => 'registration_form_question_groups',
165
-                    ),
166
-                ),
167
-                'help_tour'     => array('Registration_Form_Question_Groups_Help_Tour'),
168
-                'require_nonce' => false,
169
-            ),
170
-
171
-            'edit_question' => array(
172
-                'nav'           => array(
173
-                    'label'      => esc_html__('Edit Question', 'event_espresso'),
174
-                    'order'      => 15,
175
-                    'persistent' => false,
176
-                    'url'        => isset($this->_req_data['question_id']) ? add_query_arg(
177
-                        array('question_id' => $this->_req_data['question_id']),
178
-                        $this->_current_page_view_url
179
-                    ) : $this->_admin_base_url,
180
-                ),
181
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
182
-                'help_tabs'     => array(
183
-                    'registration_form_edit_question_group_help_tab' => array(
184
-                        'title'    => esc_html__('Edit Question', 'event_espresso'),
185
-                        'filename' => 'registration_form_edit_question',
186
-                    ),
187
-                ),
188
-                'help_tour'     => array('Registration_Form_Edit_Question_Help_Tour'),
189
-                'require_nonce' => false,
190
-            ),
191
-        );
192
-    }
193
-
194
-
195
-    protected function _add_screen_options()
196
-    {
197
-        // todo
198
-    }
199
-
200
-    protected function _add_screen_options_default()
201
-    {
202
-        $page_title = $this->_admin_page_title;
203
-        $this->_admin_page_title = esc_html__('Questions', 'event_espresso');
204
-        $this->_per_page_screen_option();
205
-        $this->_admin_page_title = $page_title;
206
-    }
207
-
208
-    protected function _add_screen_options_question_groups()
209
-    {
210
-        $page_title = $this->_admin_page_title;
211
-        $this->_admin_page_title = esc_html__('Question Groups', 'event_espresso');
212
-        $this->_per_page_screen_option();
213
-        $this->_admin_page_title = $page_title;
214
-    }
215
-
216
-    // none of the below group are currently used for Event Categories
217
-    protected function _add_feature_pointers()
218
-    {
219
-    }
220
-
221
-    public function load_scripts_styles()
222
-    {
223
-        wp_register_style(
224
-            'espresso_registration',
225
-            REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.css',
226
-            array(),
227
-            EVENT_ESPRESSO_VERSION
228
-        );
229
-        wp_enqueue_style('espresso_registration');
230
-    }
231
-
232
-    public function admin_init()
233
-    {
234
-    }
235
-
236
-    public function admin_notices()
237
-    {
238
-    }
239
-
240
-    public function admin_footer_scripts()
241
-    {
242
-    }
243
-
244
-
245
-    public function load_scripts_styles_default()
246
-    {
247
-    }
248
-
249
-
250
-    public function load_scripts_styles_add_question()
251
-    {
252
-        $this->load_scripts_styles_question_details();
253
-    }
254
-
255
-    public function load_scripts_styles_edit_question()
256
-    {
257
-        $this->load_scripts_styles_question_details();
258
-    }
259
-
260
-    /**
261
-     * Loads the JS required for adding or editing a question
262
-     */
263
-    protected function load_scripts_styles_question_details()
264
-    {
265
-        $this->load_scripts_styles_forms();
266
-        wp_register_script(
267
-            'espresso_registration_form_single',
268
-            REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js',
269
-            array('jquery-ui-sortable'),
270
-            EVENT_ESPRESSO_VERSION,
271
-            true
272
-        );
273
-        wp_enqueue_script('espresso_registration_form_single');
274
-        wp_localize_script(
275
-            'espresso_registration_form_single',
276
-            'ee_question_data',
277
-            array(
278
-                'question_types_with_max'    => EEM_Question::instance()->questionTypesWithMaxLength(),
279
-                'question_type_with_options' => EEM_Question::instance()->question_types_with_options(),
280
-            )
281
-        );
282
-    }
283
-
284
-
285
-    public function recaptcha_info_help_tab()
286
-    {
287
-        $template = REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php';
288
-        EEH_Template::display_template($template, array());
289
-    }
290
-
291
-
292
-    public function load_scripts_styles_forms()
293
-    {
294
-        // styles
295
-        wp_enqueue_style('espresso-ui-theme');
296
-        // scripts
297
-        wp_enqueue_script('ee_admin_js');
298
-    }
299
-
300
-
301
-    protected function _set_list_table_views_default()
302
-    {
303
-        $this->_views = array(
304
-            'all' => array(
305
-                'slug'  => 'all',
306
-                'label' => esc_html__('View All Questions', 'event_espresso'),
307
-                'count' => 0,
308
-            ),
309
-        );
310
-
311
-        if (
312
-            EE_Registry::instance()->CAP->current_user_can(
313
-                'ee_delete_questions',
314
-                'espresso_registration_form_trash_questions'
315
-            )
316
-        ) {
317
-            $this->_views['trash'] = array(
318
-                'slug'  => 'trash',
319
-                'label' => esc_html__('Trash', 'event_espresso'),
320
-                'count' => 0,
321
-            );
322
-        }
323
-    }
324
-
325
-    /**
326
-     * This just previews the question groups tab that comes in caffeinated.
327
-     *
328
-     * @return string html
329
-     */
330
-    protected function _questions_groups_preview()
331
-    {
332
-        $this->_admin_page_title = esc_html__('Question Groups (Preview)', 'event_espresso');
333
-        $this->_template_args['preview_img'] = '<img src="' . REGISTRATION_FORM_ASSETS_URL . 'caf_reg_form_preview.jpg" alt="'
334
-                                               . esc_attr__(
335
-                                                   'Preview Question Groups Overview List Table screenshot',
336
-                                                   'event_espresso'
337
-                                               ) . '" />';
338
-        $this->_template_args['preview_text'] = '<strong>'
339
-                                                . esc_html__(
340
-                                                    'Question Groups is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. With the Question Groups feature you are able to create new question groups, edit existing question groups, and create and edit new questions and add them to question groups.',
341
-                                                    'event_espresso'
342
-                                                ) . '</strong>';
343
-        $this->display_admin_caf_preview_page('question_groups_tab');
344
-    }
345
-
346
-
347
-    /**
348
-     * Extracts the question field's values from the POST request to update or insert them
349
-     *
350
-     * @param EEM_Base $model
351
-     * @return array where each key is the name of a model's field/db column, and each value is its value.
352
-     * @throws EE_Error
353
-     */
354
-    protected function _set_column_values_for(EEM_Base $model)
355
-    {
356
-        $question_model = EEM_Question::instance();
357
-        $set_column_values = array();
358
-
359
-        // some initial checks for proper values.
360
-        // if QST_admin_only, then no matter what QST_required is we disable.
361
-        if (! empty($this->_req_data['QST_admin_only'])) {
362
-            $this->_req_data['QST_required'] = 0;
363
-        }
364
-        // if the question shouldn't have a max length, don't let them set one
365
-        if (
366
-            ! isset(
367
-                $this->_req_data['QST_type'],
368
-                $this->_req_data['QST_max']
369
-            )
370
-            || ! in_array(
371
-                $this->_req_data['QST_type'],
372
-                $question_model->questionTypesWithMaxLength(),
373
-                true
374
-            )
375
-        ) {
376
-            // they're not allowed to set the max
377
-            $this->_req_data['QST_max'] = null;
378
-        }
379
-        foreach ($model->field_settings() as $fieldName => $settings) {
380
-            if (
381
-                // basically if QSG_identifier is empty or not set
382
-                $fieldName === 'QSG_identifier'
383
-                && (isset($this->_req_data['QSG_identifier']) && empty($this->_req_data['QSG_identifier']))
384
-            ) {
385
-                $QSG_name = isset($this->_req_data['QSG_name']) ? $this->_req_data['QSG_name'] : '';
386
-                $set_column_values[ $fieldName ] = sanitize_title($QSG_name) . '-' . uniqid('', true);
387
-            } elseif (
388
-                // if the admin label is blank, use a slug version of the question text
389
-                $fieldName === 'QST_admin_label'
390
-                && (isset($this->_req_data['QST_admin_label']) && empty($this->_req_data['QST_admin_label']))
391
-            ) {
392
-                $QST_text = isset($this->_req_data['QST_display_text']) ? $this->_req_data['QST_display_text'] : '';
393
-                $set_column_values[ $fieldName ] = sanitize_title(wp_trim_words($QST_text, 10));
394
-            } elseif ($fieldName === 'QST_admin_only' && (! isset($this->_req_data['QST_admin_only']))) {
395
-                $set_column_values[ $fieldName ] = 0;
396
-            } elseif ($fieldName === 'QST_max') {
397
-                $qst_system = $question_model->get_var(
398
-                    array(
399
-                        array(
400
-                            'QST_ID' => isset($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0,
401
-                        ),
402
-                    ),
403
-                    'QST_system'
404
-                );
405
-                $max_max = $question_model->absolute_max_for_system_question((string) $qst_system);
406
-                if (
407
-                    empty($this->_req_data['QST_max']) ||
408
-                    $this->_req_data['QST_max'] > $max_max
409
-                ) {
410
-                    $set_column_values[ $fieldName ] = $max_max;
411
-                }
412
-            }
413
-
414
-
415
-            // only add a property to the array if it's not null (otherwise the model should just use the default value)
416
-            if (
417
-                ! isset($set_column_values[ $fieldName ]) &&
418
-                isset($this->_req_data[ $fieldName ])
419
-            ) {
420
-                $set_column_values[ $fieldName ] = $this->_req_data[ $fieldName ];
421
-            }
422
-        }
423
-        // validation fo this data to be performed by the model before insertion.
424
-        return $set_column_values;
425
-    }
426
-
427
-
428
-    /**
429
-     *_questions_overview_list_table
430
-     */
431
-    protected function _questions_overview_list_table()
432
-    {
433
-        $this->_search_btn_label = esc_html__('Questions', 'event_espresso');
434
-        $this->display_admin_list_table_page_with_sidebar();
435
-    }
436
-
437
-
438
-    /**
439
-     * _edit_question
440
-     */
441
-    protected function _edit_question()
442
-    {
443
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
444
-        $ID = isset($this->_req_data['QST_ID']) && ! empty($this->_req_data['QST_ID']) ? absint(
445
-            $this->_req_data['QST_ID']
446
-        ) : false;
447
-
448
-        switch ($this->_req_action) {
449
-            case 'add_question':
450
-                $this->_admin_page_title = esc_html__('Add Question', 'event_espresso');
451
-                break;
452
-            case 'edit_question':
453
-                $this->_admin_page_title = esc_html__('Edit Question', 'event_espresso');
454
-                break;
455
-            default:
456
-                $this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
457
-        }
458
-
459
-        // add PRC_ID to title if editing
460
-        $this->_admin_page_title = $ID ? $this->_admin_page_title . ' # ' . $ID : $this->_admin_page_title;
461
-        if ($ID) {
462
-            $question = $this->_question_model->get_one_by_ID($ID);
463
-            $additional_hidden_fields = array('QST_ID' => array('type' => 'hidden', 'value' => $ID));
464
-            $this->_set_add_edit_form_tags('update_question', $additional_hidden_fields);
465
-        } else {
466
-            $question = EE_Question::new_instance();
467
-            $question->set_order_to_latest();
468
-            $this->_set_add_edit_form_tags('insert_question');
469
-        }
470
-        if ($question->system_ID() === EEM_Attendee::system_question_phone) {
471
-            $question_types = array_intersect_key(
472
-                EEM_Question::instance()->allowed_question_types(),
473
-                array_flip(
474
-                    array(
475
-                        EEM_Question::QST_type_text,
476
-                        EEM_Question::QST_type_us_phone,
477
-                    )
478
-                )
479
-            );
480
-        } else {
481
-            $question_types = $question->has_answers() ? $this->_question_model->question_types_in_same_category(
482
-                $question->type()
483
-            ) : $this->_question_model->allowed_question_types();
484
-        }
485
-        $this->_template_args['QST_ID'] = $ID;
486
-        $this->_template_args['question'] = $question;
487
-        $this->_template_args['question_types'] = $question_types;
488
-        $this->_template_args['max_max'] = EEM_Question::instance()->absolute_max_for_system_question(
489
-            $question->system_ID()
490
-        );
491
-        $this->_template_args['question_type_descriptions'] = $this->_get_question_type_descriptions();
492
-        $this->_set_publish_post_box_vars('id', $ID);
493
-        $this->_template_args['admin_page_content'] = EEH_Template::display_template(
494
-            REGISTRATION_FORM_TEMPLATE_PATH . 'questions_main_meta_box.template.php',
495
-            $this->_template_args,
496
-            true
497
-        );
498
-
499
-        // the details template wrapper
500
-        $this->display_admin_page_with_sidebar();
501
-    }
502
-
503
-
504
-    /**
505
-     * @return string
506
-     */
507
-    protected function _get_question_type_descriptions()
508
-    {
509
-        EE_Registry::instance()->load_helper('HTML');
510
-        $descriptions = '';
511
-        $question_type_descriptions = EEM_Question::instance()->question_descriptions();
512
-        foreach ($question_type_descriptions as $type => $question_type_description) {
513
-            if ($type == 'HTML_TEXTAREA') {
514
-                $html = new EE_Simple_HTML_Validation_Strategy();
515
-                $question_type_description .= sprintf(
516
-                    esc_html__('%1$s(allowed tags: %2$s)', 'event_espresso'),
517
-                    '<br/>',
518
-                    $html->get_list_of_allowed_tags()
519
-                );
520
-            }
521
-            $descriptions .= EEH_HTML::p(
522
-                $question_type_description,
523
-                'question_type_description-' . $type,
524
-                'question_type_description description',
525
-                'display:none;'
526
-            );
527
-        }
528
-        return $descriptions;
529
-    }
530
-
531
-
532
-    /**
533
-     * @param bool|true $new_question
534
-     * @throws \EE_Error
535
-     */
536
-    protected function _insert_or_update_question($new_question = true)
537
-    {
538
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
539
-        $set_column_values = $this->_set_column_values_for($this->_question_model);
540
-        if ($new_question) {
541
-            $question = EE_Question::new_instance($set_column_values);
542
-            $action_desc = 'added';
543
-        } else {
544
-            $question = EEM_Question::instance()->get_one_by_ID(absint($this->_req_data['QST_ID']));
545
-            foreach ($set_column_values as $field => $new_value) {
546
-                $question->set($field, $new_value);
547
-            }
548
-            $action_desc = 'updated';
549
-        }
550
-        $success = $question->save();
551
-        $ID = $question->ID();
552
-        if ($ID && $question->should_have_question_options()) {
553
-            // save the related options
554
-            // trash removed options, save old ones
555
-            // get list of all options
556
-            $options = $question->options();
557
-            if (! empty($options)) {
558
-                foreach ($options as $option_ID => $option) {
559
-                    $option_req_index = $this->_get_option_req_data_index($option_ID);
560
-                    if ($option_req_index !== false) {
561
-                        $option->save($this->_req_data['question_options'][ $option_req_index ]);
562
-                    } else {
563
-                        // not found, remove it
564
-                        $option->delete();
565
-                    }
566
-                }
567
-            }
568
-            // save new related options
569
-            foreach ($this->_req_data['question_options'] as $index => $option_req_data) {
570
-                // skip $index that is from our sample
571
-                if ($index === 'xxcountxx') {
572
-                    continue;
573
-                }
574
-                // note we allow saving blank options.
575
-                if (
576
-                    empty($option_req_data['QSO_ID'])
577
-                ) {// no ID! save it!
578
-                    $new_option = EE_Question_Option::new_instance(
579
-                        array(
580
-                            'QSO_value' => $option_req_data['QSO_value'],
581
-                            'QSO_desc'  => $option_req_data['QSO_desc'],
582
-                            'QSO_order' => $option_req_data['QSO_order'],
583
-                            'QST_ID'    => $question->ID(),
584
-                        )
585
-                    );
586
-                    $new_option->save();
587
-                }
588
-            }
589
-        }
590
-        $query_args = array('action' => 'edit_question', 'QST_ID' => $ID);
591
-        if ($success !== false) {
592
-            $msg = $new_question
593
-                ? sprintf(
594
-                    esc_html__('The %s has been created', 'event_espresso'),
595
-                    $this->_question_model->item_name()
596
-                )
597
-                : sprintf(
598
-                    esc_html__('The %s has been updated', 'event_espresso'),
599
-                    $this->_question_model->item_name()
600
-                );
601
-            EE_Error::add_success($msg);
602
-        }
603
-
604
-        $this->_redirect_after_action(false, '', $action_desc, $query_args, true);
605
-    }
606
-
607
-
608
-    /**
609
-     * Upon saving a question, there should be an array of 'question_options'. This array is index numerically, but not
610
-     * by ID
611
-     * (this is done because new question options don't have an ID, but we may want to add multiple simultaneously).
612
-     * So, this function gets the index in that request data array called question_options. Returns FALSE if not found.
613
-     *
614
-     * @param int $ID of the question option to find
615
-     * @return int index in question_options array if successful, FALSE if unsuccessful
616
-     */
617
-    protected function _get_option_req_data_index($ID)
618
-    {
619
-        $req_data_for_question_options = $this->_req_data['question_options'];
620
-        foreach ($req_data_for_question_options as $num => $option_data) {
621
-            if (array_key_exists('QSO_ID', $option_data) && (int) $option_data['QSO_ID'] === $ID) {
622
-                return $num;
623
-            }
624
-        }
625
-        return false;
626
-    }
627
-
628
-
629
-
630
-
631
-    /***********/
632
-    /* QUERIES */
633
-    /**
634
-     * For internal use in getting all the query parameters
635
-     * (because it's pretty well the same between question, question groups,
636
-     * and for both when searching for trashed and untrashed ones)
637
-     *
638
-     * @param EEM_Base $model either EEM_Question or EEM_Question_Group
639
-     * @param int      $per_page
640
-     * @param int      $current_page
641
-     * @return array model query params, @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
642
-     */
643
-    protected function get_query_params($model, $per_page = 10, $current_page = 10)
644
-    {
645
-        $query_params = array();
646
-        $offset = ($current_page - 1) * $per_page;
647
-        $query_params['limit'] = array($offset, $per_page);
648
-        $order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order']
649
-            : 'ASC';
650
-        $orderby_field = $model instanceof EEM_Question ? 'QST_ID' : 'QSG_order';
651
-        $field_to_order_by = empty($this->_req_data['orderby']) ? $orderby_field : $this->_req_data['orderby'];
652
-        $query_params['order_by'] = array($field_to_order_by => $order);
653
-        $search_string = array_key_exists('s', $this->_req_data) ? $this->_req_data['s'] : null;
654
-        if (! empty($search_string)) {
655
-            if ($model instanceof EEM_Question_Group) {
656
-                $query_params[0] = array(
657
-                    'OR' => array(
658
-                        'QSG_name' => array('LIKE', "%$search_string%"),
659
-                        'QSG_desc' => array('LIKE', "%$search_string%"),
660
-                    ),
661
-                );
662
-            } else {
663
-                $query_params[0] = array(
664
-                    'QST_display_text' => array('LIKE', "%$search_string%"),
665
-                );
666
-            }
667
-        }
668
-
669
-        // capability checks (just leaving this commented out for reference because it illustrates some complicated query params that could be useful when fully implemented)
670
-        /*if ( $model instanceof EEM_Question_Group ) {
18
+	/**
19
+	 * _question
20
+	 * holds the specific question object for the question details screen
21
+	 *
22
+	 * @var EE_Question $_question
23
+	 */
24
+	protected $_question;
25
+
26
+	/**
27
+	 * _question_group
28
+	 * holds the specific question group object for the question group details screen
29
+	 *
30
+	 * @var EE_Question_Group $_question_group
31
+	 */
32
+	protected $_question_group;
33
+
34
+	/**
35
+	 *_question_model EEM_Question model instance (for queries)
36
+	 *
37
+	 * @var EEM_Question $_question_model ;
38
+	 */
39
+	protected $_question_model;
40
+
41
+	/**
42
+	 * _question_group_model EEM_Question_group instance (for queries)
43
+	 *
44
+	 * @var EEM_Question_Group $_question_group_model
45
+	 */
46
+	protected $_question_group_model;
47
+
48
+
49
+	/**
50
+	 * @Constructor
51
+	 * @param bool $routing indicate whether we want to just load the object and handle routing or just load the object.
52
+	 * @access public
53
+	 */
54
+	public function __construct($routing = true)
55
+	{
56
+		require_once(EE_MODELS . 'EEM_Question.model.php');
57
+		require_once(EE_MODELS . 'EEM_Question_Group.model.php');
58
+		$this->_question_model = EEM_Question::instance();
59
+		$this->_question_group_model = EEM_Question_Group::instance();
60
+		parent::__construct($routing);
61
+	}
62
+
63
+
64
+	protected function _init_page_props()
65
+	{
66
+		$this->page_slug = REGISTRATION_FORM_PG_SLUG;
67
+		$this->page_label = esc_html__('Registration Form', 'event_espresso');
68
+		$this->_admin_base_url = REGISTRATION_FORM_ADMIN_URL;
69
+		$this->_admin_base_path = REGISTRATION_FORM_ADMIN;
70
+	}
71
+
72
+
73
+	protected function _ajax_hooks()
74
+	{
75
+	}
76
+
77
+
78
+	protected function _define_page_props()
79
+	{
80
+		$this->_admin_page_title = esc_html__('Registration Form', 'event_espresso');
81
+		$this->_labels = array(
82
+			'buttons' => array(
83
+				'edit_question' => esc_html__('Edit Question', 'event_espresso'),
84
+			),
85
+		);
86
+	}
87
+
88
+
89
+	/**
90
+	 *_set_page_routes
91
+	 */
92
+	protected function _set_page_routes()
93
+	{
94
+		$qst_id = ! empty($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0;
95
+		$this->_page_routes = array(
96
+			'default' => array(
97
+				'func'       => '_questions_overview_list_table',
98
+				'capability' => 'ee_read_questions',
99
+			),
100
+
101
+			'edit_question' => array(
102
+				'func'       => '_edit_question',
103
+				'capability' => 'ee_edit_question',
104
+				'obj_id'     => $qst_id,
105
+				'args'       => array('edit'),
106
+			),
107
+
108
+			'question_groups' => array(
109
+				'func'       => '_questions_groups_preview',
110
+				'capability' => 'ee_read_question_groups',
111
+			),
112
+
113
+			'update_question' => array(
114
+				'func'       => '_insert_or_update_question',
115
+				'args'       => array('new_question' => false),
116
+				'capability' => 'ee_edit_question',
117
+				'obj_id'     => $qst_id,
118
+				'noheader'   => true,
119
+			),
120
+		);
121
+	}
122
+
123
+
124
+	protected function _set_page_config()
125
+	{
126
+		$this->_page_config = array(
127
+			'default' => array(
128
+				'nav'           => array(
129
+					'label' => esc_html__('Questions', 'event_espresso'),
130
+					'order' => 10,
131
+				),
132
+				'list_table'    => 'Registration_Form_Questions_Admin_List_Table',
133
+				'metaboxes'     => $this->_default_espresso_metaboxes,
134
+				'help_tabs'     => array(
135
+					'registration_form_questions_overview_help_tab'                           => array(
136
+						'title'    => esc_html__('Questions Overview', 'event_espresso'),
137
+						'filename' => 'registration_form_questions_overview',
138
+					),
139
+					'registration_form_questions_overview_table_column_headings_help_tab'     => array(
140
+						'title'    => esc_html__('Questions Overview Table Column Headings', 'event_espresso'),
141
+						'filename' => 'registration_form_questions_overview_table_column_headings',
142
+					),
143
+					'registration_form_questions_overview_views_bulk_actions_search_help_tab' => array(
144
+						'title'    => esc_html__('Question Overview Views & Bulk Actions & Search', 'event_espresso'),
145
+						'filename' => 'registration_form_questions_overview_views_bulk_actions_search',
146
+					),
147
+				),
148
+				'help_tour'     => array('Registration_Form_Questions_Overview_Help_Tour'),
149
+				'require_nonce' => false,
150
+				'qtips'         => array(
151
+					'EE_Registration_Form_Tips',
152
+				)/**/
153
+			),
154
+
155
+			'question_groups' => array(
156
+				'nav'           => array(
157
+					'label' => esc_html__('Question Groups', 'event_espresso'),
158
+					'order' => 20,
159
+				),
160
+				'metaboxes'     => $this->_default_espresso_metaboxes,
161
+				'help_tabs'     => array(
162
+					'registration_form_question_groups_help_tab' => array(
163
+						'title'    => esc_html__('Question Groups', 'event_espresso'),
164
+						'filename' => 'registration_form_question_groups',
165
+					),
166
+				),
167
+				'help_tour'     => array('Registration_Form_Question_Groups_Help_Tour'),
168
+				'require_nonce' => false,
169
+			),
170
+
171
+			'edit_question' => array(
172
+				'nav'           => array(
173
+					'label'      => esc_html__('Edit Question', 'event_espresso'),
174
+					'order'      => 15,
175
+					'persistent' => false,
176
+					'url'        => isset($this->_req_data['question_id']) ? add_query_arg(
177
+						array('question_id' => $this->_req_data['question_id']),
178
+						$this->_current_page_view_url
179
+					) : $this->_admin_base_url,
180
+				),
181
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')),
182
+				'help_tabs'     => array(
183
+					'registration_form_edit_question_group_help_tab' => array(
184
+						'title'    => esc_html__('Edit Question', 'event_espresso'),
185
+						'filename' => 'registration_form_edit_question',
186
+					),
187
+				),
188
+				'help_tour'     => array('Registration_Form_Edit_Question_Help_Tour'),
189
+				'require_nonce' => false,
190
+			),
191
+		);
192
+	}
193
+
194
+
195
+	protected function _add_screen_options()
196
+	{
197
+		// todo
198
+	}
199
+
200
+	protected function _add_screen_options_default()
201
+	{
202
+		$page_title = $this->_admin_page_title;
203
+		$this->_admin_page_title = esc_html__('Questions', 'event_espresso');
204
+		$this->_per_page_screen_option();
205
+		$this->_admin_page_title = $page_title;
206
+	}
207
+
208
+	protected function _add_screen_options_question_groups()
209
+	{
210
+		$page_title = $this->_admin_page_title;
211
+		$this->_admin_page_title = esc_html__('Question Groups', 'event_espresso');
212
+		$this->_per_page_screen_option();
213
+		$this->_admin_page_title = $page_title;
214
+	}
215
+
216
+	// none of the below group are currently used for Event Categories
217
+	protected function _add_feature_pointers()
218
+	{
219
+	}
220
+
221
+	public function load_scripts_styles()
222
+	{
223
+		wp_register_style(
224
+			'espresso_registration',
225
+			REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.css',
226
+			array(),
227
+			EVENT_ESPRESSO_VERSION
228
+		);
229
+		wp_enqueue_style('espresso_registration');
230
+	}
231
+
232
+	public function admin_init()
233
+	{
234
+	}
235
+
236
+	public function admin_notices()
237
+	{
238
+	}
239
+
240
+	public function admin_footer_scripts()
241
+	{
242
+	}
243
+
244
+
245
+	public function load_scripts_styles_default()
246
+	{
247
+	}
248
+
249
+
250
+	public function load_scripts_styles_add_question()
251
+	{
252
+		$this->load_scripts_styles_question_details();
253
+	}
254
+
255
+	public function load_scripts_styles_edit_question()
256
+	{
257
+		$this->load_scripts_styles_question_details();
258
+	}
259
+
260
+	/**
261
+	 * Loads the JS required for adding or editing a question
262
+	 */
263
+	protected function load_scripts_styles_question_details()
264
+	{
265
+		$this->load_scripts_styles_forms();
266
+		wp_register_script(
267
+			'espresso_registration_form_single',
268
+			REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js',
269
+			array('jquery-ui-sortable'),
270
+			EVENT_ESPRESSO_VERSION,
271
+			true
272
+		);
273
+		wp_enqueue_script('espresso_registration_form_single');
274
+		wp_localize_script(
275
+			'espresso_registration_form_single',
276
+			'ee_question_data',
277
+			array(
278
+				'question_types_with_max'    => EEM_Question::instance()->questionTypesWithMaxLength(),
279
+				'question_type_with_options' => EEM_Question::instance()->question_types_with_options(),
280
+			)
281
+		);
282
+	}
283
+
284
+
285
+	public function recaptcha_info_help_tab()
286
+	{
287
+		$template = REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php';
288
+		EEH_Template::display_template($template, array());
289
+	}
290
+
291
+
292
+	public function load_scripts_styles_forms()
293
+	{
294
+		// styles
295
+		wp_enqueue_style('espresso-ui-theme');
296
+		// scripts
297
+		wp_enqueue_script('ee_admin_js');
298
+	}
299
+
300
+
301
+	protected function _set_list_table_views_default()
302
+	{
303
+		$this->_views = array(
304
+			'all' => array(
305
+				'slug'  => 'all',
306
+				'label' => esc_html__('View All Questions', 'event_espresso'),
307
+				'count' => 0,
308
+			),
309
+		);
310
+
311
+		if (
312
+			EE_Registry::instance()->CAP->current_user_can(
313
+				'ee_delete_questions',
314
+				'espresso_registration_form_trash_questions'
315
+			)
316
+		) {
317
+			$this->_views['trash'] = array(
318
+				'slug'  => 'trash',
319
+				'label' => esc_html__('Trash', 'event_espresso'),
320
+				'count' => 0,
321
+			);
322
+		}
323
+	}
324
+
325
+	/**
326
+	 * This just previews the question groups tab that comes in caffeinated.
327
+	 *
328
+	 * @return string html
329
+	 */
330
+	protected function _questions_groups_preview()
331
+	{
332
+		$this->_admin_page_title = esc_html__('Question Groups (Preview)', 'event_espresso');
333
+		$this->_template_args['preview_img'] = '<img src="' . REGISTRATION_FORM_ASSETS_URL . 'caf_reg_form_preview.jpg" alt="'
334
+											   . esc_attr__(
335
+												   'Preview Question Groups Overview List Table screenshot',
336
+												   'event_espresso'
337
+											   ) . '" />';
338
+		$this->_template_args['preview_text'] = '<strong>'
339
+												. esc_html__(
340
+													'Question Groups is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. With the Question Groups feature you are able to create new question groups, edit existing question groups, and create and edit new questions and add them to question groups.',
341
+													'event_espresso'
342
+												) . '</strong>';
343
+		$this->display_admin_caf_preview_page('question_groups_tab');
344
+	}
345
+
346
+
347
+	/**
348
+	 * Extracts the question field's values from the POST request to update or insert them
349
+	 *
350
+	 * @param EEM_Base $model
351
+	 * @return array where each key is the name of a model's field/db column, and each value is its value.
352
+	 * @throws EE_Error
353
+	 */
354
+	protected function _set_column_values_for(EEM_Base $model)
355
+	{
356
+		$question_model = EEM_Question::instance();
357
+		$set_column_values = array();
358
+
359
+		// some initial checks for proper values.
360
+		// if QST_admin_only, then no matter what QST_required is we disable.
361
+		if (! empty($this->_req_data['QST_admin_only'])) {
362
+			$this->_req_data['QST_required'] = 0;
363
+		}
364
+		// if the question shouldn't have a max length, don't let them set one
365
+		if (
366
+			! isset(
367
+				$this->_req_data['QST_type'],
368
+				$this->_req_data['QST_max']
369
+			)
370
+			|| ! in_array(
371
+				$this->_req_data['QST_type'],
372
+				$question_model->questionTypesWithMaxLength(),
373
+				true
374
+			)
375
+		) {
376
+			// they're not allowed to set the max
377
+			$this->_req_data['QST_max'] = null;
378
+		}
379
+		foreach ($model->field_settings() as $fieldName => $settings) {
380
+			if (
381
+				// basically if QSG_identifier is empty or not set
382
+				$fieldName === 'QSG_identifier'
383
+				&& (isset($this->_req_data['QSG_identifier']) && empty($this->_req_data['QSG_identifier']))
384
+			) {
385
+				$QSG_name = isset($this->_req_data['QSG_name']) ? $this->_req_data['QSG_name'] : '';
386
+				$set_column_values[ $fieldName ] = sanitize_title($QSG_name) . '-' . uniqid('', true);
387
+			} elseif (
388
+				// if the admin label is blank, use a slug version of the question text
389
+				$fieldName === 'QST_admin_label'
390
+				&& (isset($this->_req_data['QST_admin_label']) && empty($this->_req_data['QST_admin_label']))
391
+			) {
392
+				$QST_text = isset($this->_req_data['QST_display_text']) ? $this->_req_data['QST_display_text'] : '';
393
+				$set_column_values[ $fieldName ] = sanitize_title(wp_trim_words($QST_text, 10));
394
+			} elseif ($fieldName === 'QST_admin_only' && (! isset($this->_req_data['QST_admin_only']))) {
395
+				$set_column_values[ $fieldName ] = 0;
396
+			} elseif ($fieldName === 'QST_max') {
397
+				$qst_system = $question_model->get_var(
398
+					array(
399
+						array(
400
+							'QST_ID' => isset($this->_req_data['QST_ID']) ? $this->_req_data['QST_ID'] : 0,
401
+						),
402
+					),
403
+					'QST_system'
404
+				);
405
+				$max_max = $question_model->absolute_max_for_system_question((string) $qst_system);
406
+				if (
407
+					empty($this->_req_data['QST_max']) ||
408
+					$this->_req_data['QST_max'] > $max_max
409
+				) {
410
+					$set_column_values[ $fieldName ] = $max_max;
411
+				}
412
+			}
413
+
414
+
415
+			// only add a property to the array if it's not null (otherwise the model should just use the default value)
416
+			if (
417
+				! isset($set_column_values[ $fieldName ]) &&
418
+				isset($this->_req_data[ $fieldName ])
419
+			) {
420
+				$set_column_values[ $fieldName ] = $this->_req_data[ $fieldName ];
421
+			}
422
+		}
423
+		// validation fo this data to be performed by the model before insertion.
424
+		return $set_column_values;
425
+	}
426
+
427
+
428
+	/**
429
+	 *_questions_overview_list_table
430
+	 */
431
+	protected function _questions_overview_list_table()
432
+	{
433
+		$this->_search_btn_label = esc_html__('Questions', 'event_espresso');
434
+		$this->display_admin_list_table_page_with_sidebar();
435
+	}
436
+
437
+
438
+	/**
439
+	 * _edit_question
440
+	 */
441
+	protected function _edit_question()
442
+	{
443
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
444
+		$ID = isset($this->_req_data['QST_ID']) && ! empty($this->_req_data['QST_ID']) ? absint(
445
+			$this->_req_data['QST_ID']
446
+		) : false;
447
+
448
+		switch ($this->_req_action) {
449
+			case 'add_question':
450
+				$this->_admin_page_title = esc_html__('Add Question', 'event_espresso');
451
+				break;
452
+			case 'edit_question':
453
+				$this->_admin_page_title = esc_html__('Edit Question', 'event_espresso');
454
+				break;
455
+			default:
456
+				$this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action));
457
+		}
458
+
459
+		// add PRC_ID to title if editing
460
+		$this->_admin_page_title = $ID ? $this->_admin_page_title . ' # ' . $ID : $this->_admin_page_title;
461
+		if ($ID) {
462
+			$question = $this->_question_model->get_one_by_ID($ID);
463
+			$additional_hidden_fields = array('QST_ID' => array('type' => 'hidden', 'value' => $ID));
464
+			$this->_set_add_edit_form_tags('update_question', $additional_hidden_fields);
465
+		} else {
466
+			$question = EE_Question::new_instance();
467
+			$question->set_order_to_latest();
468
+			$this->_set_add_edit_form_tags('insert_question');
469
+		}
470
+		if ($question->system_ID() === EEM_Attendee::system_question_phone) {
471
+			$question_types = array_intersect_key(
472
+				EEM_Question::instance()->allowed_question_types(),
473
+				array_flip(
474
+					array(
475
+						EEM_Question::QST_type_text,
476
+						EEM_Question::QST_type_us_phone,
477
+					)
478
+				)
479
+			);
480
+		} else {
481
+			$question_types = $question->has_answers() ? $this->_question_model->question_types_in_same_category(
482
+				$question->type()
483
+			) : $this->_question_model->allowed_question_types();
484
+		}
485
+		$this->_template_args['QST_ID'] = $ID;
486
+		$this->_template_args['question'] = $question;
487
+		$this->_template_args['question_types'] = $question_types;
488
+		$this->_template_args['max_max'] = EEM_Question::instance()->absolute_max_for_system_question(
489
+			$question->system_ID()
490
+		);
491
+		$this->_template_args['question_type_descriptions'] = $this->_get_question_type_descriptions();
492
+		$this->_set_publish_post_box_vars('id', $ID);
493
+		$this->_template_args['admin_page_content'] = EEH_Template::display_template(
494
+			REGISTRATION_FORM_TEMPLATE_PATH . 'questions_main_meta_box.template.php',
495
+			$this->_template_args,
496
+			true
497
+		);
498
+
499
+		// the details template wrapper
500
+		$this->display_admin_page_with_sidebar();
501
+	}
502
+
503
+
504
+	/**
505
+	 * @return string
506
+	 */
507
+	protected function _get_question_type_descriptions()
508
+	{
509
+		EE_Registry::instance()->load_helper('HTML');
510
+		$descriptions = '';
511
+		$question_type_descriptions = EEM_Question::instance()->question_descriptions();
512
+		foreach ($question_type_descriptions as $type => $question_type_description) {
513
+			if ($type == 'HTML_TEXTAREA') {
514
+				$html = new EE_Simple_HTML_Validation_Strategy();
515
+				$question_type_description .= sprintf(
516
+					esc_html__('%1$s(allowed tags: %2$s)', 'event_espresso'),
517
+					'<br/>',
518
+					$html->get_list_of_allowed_tags()
519
+				);
520
+			}
521
+			$descriptions .= EEH_HTML::p(
522
+				$question_type_description,
523
+				'question_type_description-' . $type,
524
+				'question_type_description description',
525
+				'display:none;'
526
+			);
527
+		}
528
+		return $descriptions;
529
+	}
530
+
531
+
532
+	/**
533
+	 * @param bool|true $new_question
534
+	 * @throws \EE_Error
535
+	 */
536
+	protected function _insert_or_update_question($new_question = true)
537
+	{
538
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
539
+		$set_column_values = $this->_set_column_values_for($this->_question_model);
540
+		if ($new_question) {
541
+			$question = EE_Question::new_instance($set_column_values);
542
+			$action_desc = 'added';
543
+		} else {
544
+			$question = EEM_Question::instance()->get_one_by_ID(absint($this->_req_data['QST_ID']));
545
+			foreach ($set_column_values as $field => $new_value) {
546
+				$question->set($field, $new_value);
547
+			}
548
+			$action_desc = 'updated';
549
+		}
550
+		$success = $question->save();
551
+		$ID = $question->ID();
552
+		if ($ID && $question->should_have_question_options()) {
553
+			// save the related options
554
+			// trash removed options, save old ones
555
+			// get list of all options
556
+			$options = $question->options();
557
+			if (! empty($options)) {
558
+				foreach ($options as $option_ID => $option) {
559
+					$option_req_index = $this->_get_option_req_data_index($option_ID);
560
+					if ($option_req_index !== false) {
561
+						$option->save($this->_req_data['question_options'][ $option_req_index ]);
562
+					} else {
563
+						// not found, remove it
564
+						$option->delete();
565
+					}
566
+				}
567
+			}
568
+			// save new related options
569
+			foreach ($this->_req_data['question_options'] as $index => $option_req_data) {
570
+				// skip $index that is from our sample
571
+				if ($index === 'xxcountxx') {
572
+					continue;
573
+				}
574
+				// note we allow saving blank options.
575
+				if (
576
+					empty($option_req_data['QSO_ID'])
577
+				) {// no ID! save it!
578
+					$new_option = EE_Question_Option::new_instance(
579
+						array(
580
+							'QSO_value' => $option_req_data['QSO_value'],
581
+							'QSO_desc'  => $option_req_data['QSO_desc'],
582
+							'QSO_order' => $option_req_data['QSO_order'],
583
+							'QST_ID'    => $question->ID(),
584
+						)
585
+					);
586
+					$new_option->save();
587
+				}
588
+			}
589
+		}
590
+		$query_args = array('action' => 'edit_question', 'QST_ID' => $ID);
591
+		if ($success !== false) {
592
+			$msg = $new_question
593
+				? sprintf(
594
+					esc_html__('The %s has been created', 'event_espresso'),
595
+					$this->_question_model->item_name()
596
+				)
597
+				: sprintf(
598
+					esc_html__('The %s has been updated', 'event_espresso'),
599
+					$this->_question_model->item_name()
600
+				);
601
+			EE_Error::add_success($msg);
602
+		}
603
+
604
+		$this->_redirect_after_action(false, '', $action_desc, $query_args, true);
605
+	}
606
+
607
+
608
+	/**
609
+	 * Upon saving a question, there should be an array of 'question_options'. This array is index numerically, but not
610
+	 * by ID
611
+	 * (this is done because new question options don't have an ID, but we may want to add multiple simultaneously).
612
+	 * So, this function gets the index in that request data array called question_options. Returns FALSE if not found.
613
+	 *
614
+	 * @param int $ID of the question option to find
615
+	 * @return int index in question_options array if successful, FALSE if unsuccessful
616
+	 */
617
+	protected function _get_option_req_data_index($ID)
618
+	{
619
+		$req_data_for_question_options = $this->_req_data['question_options'];
620
+		foreach ($req_data_for_question_options as $num => $option_data) {
621
+			if (array_key_exists('QSO_ID', $option_data) && (int) $option_data['QSO_ID'] === $ID) {
622
+				return $num;
623
+			}
624
+		}
625
+		return false;
626
+	}
627
+
628
+
629
+
630
+
631
+	/***********/
632
+	/* QUERIES */
633
+	/**
634
+	 * For internal use in getting all the query parameters
635
+	 * (because it's pretty well the same between question, question groups,
636
+	 * and for both when searching for trashed and untrashed ones)
637
+	 *
638
+	 * @param EEM_Base $model either EEM_Question or EEM_Question_Group
639
+	 * @param int      $per_page
640
+	 * @param int      $current_page
641
+	 * @return array model query params, @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md
642
+	 */
643
+	protected function get_query_params($model, $per_page = 10, $current_page = 10)
644
+	{
645
+		$query_params = array();
646
+		$offset = ($current_page - 1) * $per_page;
647
+		$query_params['limit'] = array($offset, $per_page);
648
+		$order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order']
649
+			: 'ASC';
650
+		$orderby_field = $model instanceof EEM_Question ? 'QST_ID' : 'QSG_order';
651
+		$field_to_order_by = empty($this->_req_data['orderby']) ? $orderby_field : $this->_req_data['orderby'];
652
+		$query_params['order_by'] = array($field_to_order_by => $order);
653
+		$search_string = array_key_exists('s', $this->_req_data) ? $this->_req_data['s'] : null;
654
+		if (! empty($search_string)) {
655
+			if ($model instanceof EEM_Question_Group) {
656
+				$query_params[0] = array(
657
+					'OR' => array(
658
+						'QSG_name' => array('LIKE', "%$search_string%"),
659
+						'QSG_desc' => array('LIKE', "%$search_string%"),
660
+					),
661
+				);
662
+			} else {
663
+				$query_params[0] = array(
664
+					'QST_display_text' => array('LIKE', "%$search_string%"),
665
+				);
666
+			}
667
+		}
668
+
669
+		// capability checks (just leaving this commented out for reference because it illustrates some complicated query params that could be useful when fully implemented)
670
+		/*if ( $model instanceof EEM_Question_Group ) {
671 671
             if ( ! EE_Registry::instance()->CAP->current_user_can( 'edit_others_question_groups', 'espresso_registration_form_edit_question_group' ) ) {
672 672
                 $query_params[0] = array(
673 673
                     'AND' => array(
@@ -697,59 +697,59 @@  discard block
 block discarded – undo
697 697
             }
698 698
         }/**/
699 699
 
700
-        return $query_params;
701
-    }
702
-
703
-
704
-    /**
705
-     * @param int        $per_page
706
-     * @param int        $current_page
707
-     * @param bool|false $count
708
-     * @return \EE_Soft_Delete_Base_Class[]|int
709
-     */
710
-    public function get_questions($per_page = 10, $current_page = 1, $count = false)
711
-    {
712
-        $QST = EEM_Question::instance();
713
-        $query_params = $this->get_query_params($QST, $per_page, $current_page);
714
-        if ($count) {
715
-            $where = isset($query_params[0]) ? array($query_params[0]) : array();
716
-            $results = $QST->count($where);
717
-        } else {
718
-            $results = $QST->get_all($query_params);
719
-        }
720
-        return $results;
721
-    }
722
-
723
-
724
-    /**
725
-     * @param            $per_page
726
-     * @param int        $current_page
727
-     * @param bool|false $count
728
-     * @return \EE_Soft_Delete_Base_Class[]|int
729
-     */
730
-    public function get_trashed_questions($per_page, $current_page = 1, $count = false)
731
-    {
732
-        $query_params = $this->get_query_params(EEM_Question::instance(), $per_page, $current_page);
733
-        $where = isset($query_params[0]) ? array($query_params[0]) : array();
734
-        $questions = $count ? EEM_Question::instance()->count_deleted($where)
735
-            : EEM_Question::instance()->get_all_deleted($query_params);
736
-        return $questions;
737
-    }
738
-
739
-
740
-    /**
741
-     * @param            $per_page
742
-     * @param int        $current_page
743
-     * @param bool|false $count
744
-     * @return \EE_Soft_Delete_Base_Class[]
745
-     */
746
-    public function get_question_groups($per_page, $current_page = 1, $count = false)
747
-    {
748
-        /** @type EEM_Question_Group $questionGroupModel */
749
-        $questionGroupModel = EEM_Question_Group::instance();
750
-        // note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items
751
-        return $questionGroupModel->get_all(
752
-            $this->get_query_params($questionGroupModel, $per_page, $current_page)
753
-        );
754
-    }
700
+		return $query_params;
701
+	}
702
+
703
+
704
+	/**
705
+	 * @param int        $per_page
706
+	 * @param int        $current_page
707
+	 * @param bool|false $count
708
+	 * @return \EE_Soft_Delete_Base_Class[]|int
709
+	 */
710
+	public function get_questions($per_page = 10, $current_page = 1, $count = false)
711
+	{
712
+		$QST = EEM_Question::instance();
713
+		$query_params = $this->get_query_params($QST, $per_page, $current_page);
714
+		if ($count) {
715
+			$where = isset($query_params[0]) ? array($query_params[0]) : array();
716
+			$results = $QST->count($where);
717
+		} else {
718
+			$results = $QST->get_all($query_params);
719
+		}
720
+		return $results;
721
+	}
722
+
723
+
724
+	/**
725
+	 * @param            $per_page
726
+	 * @param int        $current_page
727
+	 * @param bool|false $count
728
+	 * @return \EE_Soft_Delete_Base_Class[]|int
729
+	 */
730
+	public function get_trashed_questions($per_page, $current_page = 1, $count = false)
731
+	{
732
+		$query_params = $this->get_query_params(EEM_Question::instance(), $per_page, $current_page);
733
+		$where = isset($query_params[0]) ? array($query_params[0]) : array();
734
+		$questions = $count ? EEM_Question::instance()->count_deleted($where)
735
+			: EEM_Question::instance()->get_all_deleted($query_params);
736
+		return $questions;
737
+	}
738
+
739
+
740
+	/**
741
+	 * @param            $per_page
742
+	 * @param int        $current_page
743
+	 * @param bool|false $count
744
+	 * @return \EE_Soft_Delete_Base_Class[]
745
+	 */
746
+	public function get_question_groups($per_page, $current_page = 1, $count = false)
747
+	{
748
+		/** @type EEM_Question_Group $questionGroupModel */
749
+		$questionGroupModel = EEM_Question_Group::instance();
750
+		// note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items
751
+		return $questionGroupModel->get_all(
752
+			$this->get_query_params($questionGroupModel, $per_page, $current_page)
753
+		);
754
+	}
755 755
 }
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function __construct($routing = true)
55 55
     {
56
-        require_once(EE_MODELS . 'EEM_Question.model.php');
57
-        require_once(EE_MODELS . 'EEM_Question_Group.model.php');
56
+        require_once(EE_MODELS.'EEM_Question.model.php');
57
+        require_once(EE_MODELS.'EEM_Question_Group.model.php');
58 58
         $this->_question_model = EEM_Question::instance();
59 59
         $this->_question_group_model = EEM_Question_Group::instance();
60 60
         parent::__construct($routing);
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     {
223 223
         wp_register_style(
224 224
             'espresso_registration',
225
-            REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.css',
225
+            REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.css',
226 226
             array(),
227 227
             EVENT_ESPRESSO_VERSION
228 228
         );
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         $this->load_scripts_styles_forms();
266 266
         wp_register_script(
267 267
             'espresso_registration_form_single',
268
-            REGISTRATION_FORM_ASSETS_URL . 'espresso_registration_form_admin.js',
268
+            REGISTRATION_FORM_ASSETS_URL.'espresso_registration_form_admin.js',
269 269
             array('jquery-ui-sortable'),
270 270
             EVENT_ESPRESSO_VERSION,
271 271
             true
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
     public function recaptcha_info_help_tab()
286 286
     {
287
-        $template = REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php';
287
+        $template = REGISTRATION_FORM_TEMPLATE_PATH.'recaptcha_info_help_tab.template.php';
288 288
         EEH_Template::display_template($template, array());
289 289
     }
290 290
 
@@ -330,16 +330,16 @@  discard block
 block discarded – undo
330 330
     protected function _questions_groups_preview()
331 331
     {
332 332
         $this->_admin_page_title = esc_html__('Question Groups (Preview)', 'event_espresso');
333
-        $this->_template_args['preview_img'] = '<img src="' . REGISTRATION_FORM_ASSETS_URL . 'caf_reg_form_preview.jpg" alt="'
333
+        $this->_template_args['preview_img'] = '<img src="'.REGISTRATION_FORM_ASSETS_URL.'caf_reg_form_preview.jpg" alt="'
334 334
                                                . esc_attr__(
335 335
                                                    'Preview Question Groups Overview List Table screenshot',
336 336
                                                    'event_espresso'
337
-                                               ) . '" />';
337
+                                               ).'" />';
338 338
         $this->_template_args['preview_text'] = '<strong>'
339 339
                                                 . esc_html__(
340 340
                                                     'Question Groups is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. With the Question Groups feature you are able to create new question groups, edit existing question groups, and create and edit new questions and add them to question groups.',
341 341
                                                     'event_espresso'
342
-                                                ) . '</strong>';
342
+                                                ).'</strong>';
343 343
         $this->display_admin_caf_preview_page('question_groups_tab');
344 344
     }
345 345
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
         // some initial checks for proper values.
360 360
         // if QST_admin_only, then no matter what QST_required is we disable.
361
-        if (! empty($this->_req_data['QST_admin_only'])) {
361
+        if ( ! empty($this->_req_data['QST_admin_only'])) {
362 362
             $this->_req_data['QST_required'] = 0;
363 363
         }
364 364
         // if the question shouldn't have a max length, don't let them set one
@@ -383,16 +383,16 @@  discard block
 block discarded – undo
383 383
                 && (isset($this->_req_data['QSG_identifier']) && empty($this->_req_data['QSG_identifier']))
384 384
             ) {
385 385
                 $QSG_name = isset($this->_req_data['QSG_name']) ? $this->_req_data['QSG_name'] : '';
386
-                $set_column_values[ $fieldName ] = sanitize_title($QSG_name) . '-' . uniqid('', true);
386
+                $set_column_values[$fieldName] = sanitize_title($QSG_name).'-'.uniqid('', true);
387 387
             } elseif (
388 388
                 // if the admin label is blank, use a slug version of the question text
389 389
                 $fieldName === 'QST_admin_label'
390 390
                 && (isset($this->_req_data['QST_admin_label']) && empty($this->_req_data['QST_admin_label']))
391 391
             ) {
392 392
                 $QST_text = isset($this->_req_data['QST_display_text']) ? $this->_req_data['QST_display_text'] : '';
393
-                $set_column_values[ $fieldName ] = sanitize_title(wp_trim_words($QST_text, 10));
394
-            } elseif ($fieldName === 'QST_admin_only' && (! isset($this->_req_data['QST_admin_only']))) {
395
-                $set_column_values[ $fieldName ] = 0;
393
+                $set_column_values[$fieldName] = sanitize_title(wp_trim_words($QST_text, 10));
394
+            } elseif ($fieldName === 'QST_admin_only' && ( ! isset($this->_req_data['QST_admin_only']))) {
395
+                $set_column_values[$fieldName] = 0;
396 396
             } elseif ($fieldName === 'QST_max') {
397 397
                 $qst_system = $question_model->get_var(
398 398
                     array(
@@ -407,17 +407,17 @@  discard block
 block discarded – undo
407 407
                     empty($this->_req_data['QST_max']) ||
408 408
                     $this->_req_data['QST_max'] > $max_max
409 409
                 ) {
410
-                    $set_column_values[ $fieldName ] = $max_max;
410
+                    $set_column_values[$fieldName] = $max_max;
411 411
                 }
412 412
             }
413 413
 
414 414
 
415 415
             // only add a property to the array if it's not null (otherwise the model should just use the default value)
416 416
             if (
417
-                ! isset($set_column_values[ $fieldName ]) &&
418
-                isset($this->_req_data[ $fieldName ])
417
+                ! isset($set_column_values[$fieldName]) &&
418
+                isset($this->_req_data[$fieldName])
419 419
             ) {
420
-                $set_column_values[ $fieldName ] = $this->_req_data[ $fieldName ];
420
+                $set_column_values[$fieldName] = $this->_req_data[$fieldName];
421 421
             }
422 422
         }
423 423
         // validation fo this data to be performed by the model before insertion.
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
         }
458 458
 
459 459
         // add PRC_ID to title if editing
460
-        $this->_admin_page_title = $ID ? $this->_admin_page_title . ' # ' . $ID : $this->_admin_page_title;
460
+        $this->_admin_page_title = $ID ? $this->_admin_page_title.' # '.$ID : $this->_admin_page_title;
461 461
         if ($ID) {
462 462
             $question = $this->_question_model->get_one_by_ID($ID);
463 463
             $additional_hidden_fields = array('QST_ID' => array('type' => 'hidden', 'value' => $ID));
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
         $this->_template_args['question_type_descriptions'] = $this->_get_question_type_descriptions();
492 492
         $this->_set_publish_post_box_vars('id', $ID);
493 493
         $this->_template_args['admin_page_content'] = EEH_Template::display_template(
494
-            REGISTRATION_FORM_TEMPLATE_PATH . 'questions_main_meta_box.template.php',
494
+            REGISTRATION_FORM_TEMPLATE_PATH.'questions_main_meta_box.template.php',
495 495
             $this->_template_args,
496 496
             true
497 497
         );
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
             }
521 521
             $descriptions .= EEH_HTML::p(
522 522
                 $question_type_description,
523
-                'question_type_description-' . $type,
523
+                'question_type_description-'.$type,
524 524
                 'question_type_description description',
525 525
                 'display:none;'
526 526
             );
@@ -554,11 +554,11 @@  discard block
 block discarded – undo
554 554
             // trash removed options, save old ones
555 555
             // get list of all options
556 556
             $options = $question->options();
557
-            if (! empty($options)) {
557
+            if ( ! empty($options)) {
558 558
                 foreach ($options as $option_ID => $option) {
559 559
                     $option_req_index = $this->_get_option_req_data_index($option_ID);
560 560
                     if ($option_req_index !== false) {
561
-                        $option->save($this->_req_data['question_options'][ $option_req_index ]);
561
+                        $option->save($this->_req_data['question_options'][$option_req_index]);
562 562
                     } else {
563 563
                         // not found, remove it
564 564
                         $option->delete();
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
         $field_to_order_by = empty($this->_req_data['orderby']) ? $orderby_field : $this->_req_data['orderby'];
652 652
         $query_params['order_by'] = array($field_to_order_by => $order);
653 653
         $search_string = array_key_exists('s', $this->_req_data) ? $this->_req_data['s'] : null;
654
-        if (! empty($search_string)) {
654
+        if ( ! empty($search_string)) {
655 655
             if ($model instanceof EEM_Question_Group) {
656 656
                 $query_params[0] = array(
657 657
                     'OR' => array(
Please login to merge, or discard this patch.