-
Notifications
You must be signed in to change notification settings - Fork 169
/
sites.php
447 lines (436 loc) · 15.5 KB
/
sites.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<?php
function jquery_sites() {
static $sites;
if ( isset( $sites ) )
return $sites;
# Historical: Formerly hosted plugins.jquery.com
# Historical: Formerly hosted qunitjs.com
# Historical: Formerly hosted sizzlejs.com
# Historical: Formerly hosted api.qunitjs.com
# Historical: Formerly hosted books.jquery.com
# Historical: Formerly hosted events.jquery.org
# Historical: Formerly hosted irc.jquery.org.
# Historical: Formerly hosted codeorigin.jquery.com
$sites = array(
'jquery.com' => array(
'cookie_domain' => '.jquery.com',
'options' => array(
'blogname' => 'jQuery',
'stylesheet' => 'jquery.com',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'jquery_xfn_rel_me' => 'https://social.lfx.dev/@jquery',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jquery_com',
),
),
'blog.jquery.com' => array(
'cookie_domain' => '.jquery.com',
'options' => array(
'blogname' => 'Official jQuery Blog',
'blogdescription' => 'New Wave JavaScript',
'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/',
'stylesheet' => 'jquery.com',
'jquery_body_class' => 'jquery',
'jquery_is_blog' => true,
'jquery_author' => 'jQuery Team',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'jquery_xfn_rel_me' => 'https://social.lfx.dev/@jquery',
),
),
'api.jquery.com' => array(
'cookie_domain' => '.jquery.com',
'options' => array(
'blogname' => 'jQuery API Documentation',
'stylesheet' => 'api.jquery.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
),
'jquery_body_class' => 'jquery',
'jquery_logo_link'=> 'https://jquery.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jquery_com',
),
),
'learn.jquery.com' => array(
'cookie_domain' => '.jquery.com',
'options' => array(
'blogname' => 'jQuery Learning Center',
'stylesheet' => 'learn.jquery.com',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery-learn',
),
),
'jqueryui.com' => array(
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI',
'jquery_description' => 'jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you\'re building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.',
'stylesheet' => 'jqueryui.com',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery-ui',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jqueryui_com',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'blog.jqueryui.com' => array(
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI Blog',
'blogdescription' => 'All news about jQuery UI',
'permalink_structure' => '/%year%/%monthnum%/%postname%/',
'stylesheet' => 'jqueryui.com',
'jquery_body_class' => 'jquery-ui',
'jquery_is_blog' => true,
'jquery_author' => 'jQuery Team',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com' => array(
'subsites' => true, // Has one level of sub-sites (api.jqueryui.com/([^/]+))
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI API Documentation',
'stylesheet' => 'api.jqueryui.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
),
'jquery_body_class' => 'jquery-ui',
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jqueryui_com',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com/1.8' => array(
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI 1.8 Documentation',
'stylesheet' => 'api.jqueryui.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
'jquery-api-versioned-links.php',
),
'jquery_body_class' => 'jquery-ui',
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jqueryui_com',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com/1.9' => array(
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI 1.9 Documentation',
'stylesheet' => 'api.jqueryui.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
'jquery-api-versioned-links.php',
),
'jquery_body_class' => 'jquery-ui',
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jqueryui_com',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'jquery.org' => array(
'cookie_domain' => '.jquery.org',
'options' => array(
'blogname' => 'jQuery Foundation',
'stylesheet' => 'jquery.org',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery-foundation',
),
),
'jquerymobile.com' => array(
'cookie_domain' => '.jquerymobile.com',
'options' => array(
'blogname' => 'jQuery Mobile',
'stylesheet' => 'jquerymobile.com',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery-mobile',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jquerymobile_com',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'api.jquerymobile.com' => array(
'subsites' => true, // Has one level of sub-sites (api.jquerymobile.com/([^/]+))
'cookie_domain' => '.jquerymobile.com',
'options' => array(
'blogname' => 'jQuery Mobile API Documentation',
'stylesheet' => 'api.jquerymobile.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
),
'jquery_body_class' => 'jquery-mobile',
'jquery_logo_link'=> 'https://jquerymobile.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jquerymobile_com',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'blog.jquerymobile.com' => array(
'cookie_domain' => '.jquerymobile.com',
'options' => array(
'blogname' => 'jQuery Mobile Blog',
'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/',
'stylesheet' => 'jquerymobile.com',
'jquery_body_class' => 'jquery-mobile',
'jquery_is_blog' => true,
'jquery_author' => 'jQuery Team',
'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'brand.jquery.org' => array(
'cookie_domain' => '.jquery.org',
'options' => array(
'blogname' => 'jQuery Brand Guidelines',
'stylesheet' => 'brand.jquery.org',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery-foundation',
),
),
'contribute.jquery.org' => array(
'cookie_domain' => '.jquery.org',
'options' => array(
'blogname' => 'Contribute to jQuery',
'stylesheet' => 'contribute.jquery.org',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery-foundation',
),
),
'meetings.jquery.org' => array(
'cookie_domain' => '.jquery.org',
'options' => array(
'blogname' => 'jQuery Meetings',
'stylesheet' => 'meetings.jquery.org',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery-foundation',
),
),
'api.jquerymobile.com/1.3' => array(
'cookie_domain' => '.jquerymobile.com',
'options' => array(
'blogname' => 'jQuery Mobile 1.3 Documentation',
'stylesheet' => 'api.jquerymobile.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
'jquery-api-versioned-links.php',
),
'jquery_body_class' => 'jquery-mobile',
'jquery_logo_link'=> 'https://jquerymobile.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jquerymobile_com',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'api.jqueryui.com/1.10' => array(
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI 1.10 Documentation',
'stylesheet' => 'api.jqueryui.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
'jquery-api-versioned-links.php',
),
'jquery_body_class' => 'jquery-ui',
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jqueryui_com',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com/1.12' => array(
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI 1.12 Documentation',
'stylesheet' => 'api.jqueryui.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
'jquery-api-versioned-links.php',
),
'jquery_body_class' => 'jquery-ui',
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jqueryui_com',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com/1.11' => array(
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI 1.11 Documentation',
'stylesheet' => 'api.jqueryui.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
'jquery-api-versioned-links.php',
),
'jquery_body_class' => 'jquery-ui',
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jqueryui_com',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jquerymobile.com/1.4' => array(
'cookie_domain' => '.jquerymobile.com',
'options' => array(
'blogname' => 'jQuery Mobile 1.4 Documentation',
'stylesheet' => 'api.jquerymobile.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
'jquery-api-versioned-links.php',
),
'jquery_body_class' => 'jquery-mobile',
'jquery_logo_link'=> 'https://jquerymobile.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jquerymobile_com',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'releases.jquery.com' => array(
'cookie_domain' => '.jquery.com',
'options' => array(
'blogname' => 'jQuery CDN',
'jquery_description' => 'Worldwide distribution of jQuery releases.',
'stylesheet' => 'releases.jquery.com',
'active_plugins' => array(
'jquery-static-index.php',
),
'jquery_body_class' => 'jquery',
),
),
'api.jqueryui.com/1.13' => array(
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI 1.13 Documentation',
'stylesheet' => 'api.jqueryui.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
'jquery-api-versioned-links.php',
),
'jquery_body_class' => 'jquery-ui',
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jqueryui_com',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com/1.14' => array(
'cookie_domain' => '.jqueryui.com',
'options' => array(
'blogname' => 'jQuery UI 1.14 Documentation',
'stylesheet' => 'api.jqueryui.com',
'active_plugins' => array(
'jquery-api-category-listing.php',
'jquery-api-versioned-links.php',
),
'jquery_body_class' => 'jquery-ui',
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz',
'jquery_typesense_collection' => 'jqueryui_com',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
);
return $sites;
}
/**
* Resolve a canonical site (e.g. JQUERY_LIVE_SITE) into one for
* the current environment. This exists to automatically change
* the site hostname if JQUERY_STAGING is true.
*
* This is cheap and can be applied at the last minute as-needed.
*
* @param string $site
* @return string
*/
function jquery_site_expand( $site ) {
if ( JQUERY_STAGING ) {
return strtr( JQUERY_STAGING_FORMAT, [ '%s' => $site ] );
}
return $site;
}
/**
* @param string $site E.g. `$_SERVER['HTTP_HOST']`
* @return string
*/
function jquery_site_extract( $hostname ) {
$live_site = preg_replace( '/:\d+$/', '', strtolower( $hostname ) );
if ( JQUERY_STAGING ) {
// Convert the format into a regex that matches the placeholder
// Strip port from both because the webserver may internally have
// a different port from the public one
$rPortless = preg_quote( preg_replace( '/:\d+$/', '', JQUERY_STAGING_FORMAT ), '/' );
$rPortless = strtr( $rPortless, [ '%s' => '(.+)' ] );
$rPortless = "/^{$rPortless}$/";
if ( preg_match( $rPortless, $live_site, $m ) ) {
$live_site = $m[1];
}
}
return $live_site;
}
function jquery_default_site_options() {
$defaults = array(
'enable_xmlrpc' => 1,
'template' => 'jquery',
'blogdescription' => '',
'permalink_structure' => '/%postname%/',
'use_smilies' => 0,
'close_comments_days_old' => 14,
'close_comments_for_old_posts' => 1,
'comment_moderation' => 1,
'comments_notify' => 0,
'default_comment_status' => 'closed',
'default_ping_status' => 'closed',
'show_comments_cookies_opt_in' => 0,
// The one site where comments are sometimes enabled (blog.jquery.com)
// has always had thread_comments turned off.
//
// Other sites like api.jquery.com implement their pages as posts,
// but naturally don't support comments at all. Turn this off to
// remove the WordPress comment-reply script from pages by default.
'thread_comments' => 0,
);
// Production databases set the home values in corresponding site options tables.
// However, sites that use jquery-static-index.php cause index pages
// to redirect to live sites in local development. This filter does not
// prevent the redirect, but changes the redirect to the local site.
//
// WordPress/wp-login.php requires 'home' to use a full URL.
// If it uses a protocol-relative URL, it uses the entire URL as the "path="
// and thus cause cookies to never be sent by the browser. This doesn't matter
// much for the public stage sites where we don't login, but it matters for
// jquery-wp-docker.
//
// To ensure canonical URLs work correctly on public stage sites and avoid
// HTTP-403 errors, apply set_url_scheme() which will change it to stay on
// HTTPS if you're already on HTTPS.
if ( JQUERY_STAGING ) {
$defaults['home'] = set_url_scheme( 'http://' . jquery_site_expand( JQUERY_LIVE_SITE ) );
$defaults['siteurl'] = set_url_scheme( 'http://' . jquery_site_expand( JQUERY_LIVE_SITE ) );
}
return $defaults;
}