Deployed c49f46f9 to 6.0 with MkDocs 1.4.2 and mike 1.1.2
[GitHub/WoltLab/woltlab.github.io.git] / 6.0 / migration / wsc55 / php / index.html
1
2 <!doctype html>
3 <html lang="en" class="no-js">
4 <head>
5
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width,initial-scale=1">
8
9
10
11 <link rel="canonical" href="https://docs.woltlab.com/6.0/migration/wsc55/php/">
12
13
14 <link rel="prev" href="../../../package/database-php-api/">
15
16
17 <link rel="next" href="../javascript/">
18
19 <link rel="icon" href="../../../assets/default.favicon.ico">
20 <meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.1.5">
21
22
23
24 <title>PHP API - WoltLab Suite Documentation</title>
25
26
27
28 <link rel="stylesheet" href="../../../assets/stylesheets/main.7a7fce14.min.css">
29
30
31 <link rel="stylesheet" href="../../../assets/stylesheets/palette.a0c5b2b5.min.css">
32
33
34
35
36
37
38
39
40
41 <link rel="stylesheet" href="../../../stylesheets/extra.css">
42
43 <script>__md_scope=new URL("../../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
44
45
46
47
48
49
50 </head>
51
52
53
54
55
56
57
58 <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="">
59
60
61
62 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
63 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
64 <label class="md-overlay" for="__drawer"></label>
65 <div data-md-component="skip">
66
67
68 <a href="#migrating-from-woltlab-suite-55-php" class="md-skip">
69 Skip to content
70 </a>
71
72 </div>
73 <div data-md-component="announce">
74
75 <aside class="md-banner">
76 <div class="md-banner__inner md-grid md-typeset">
77
78
79 <a href="https://www.woltlab.com">Back to <strong>woltlab.com</strong></a>
80
81 </div>
82
83 </aside>
84
85 </div>
86
87 <div data-md-color-scheme="default" data-md-component="outdated" hidden>
88
89 </div>
90
91
92
93
94
95
96 <header class="md-header md-header--shadow" data-md-component="header">
97 <nav class="md-header__inner md-grid" aria-label="Header">
98 <a href="../../.." title="WoltLab Suite Documentation" class="md-header__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
99
100 <img src="../../../assets/logo.png" alt="logo">
101
102 </a>
103 <label class="md-header__button md-icon" for="__drawer">
104 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
105 </label>
106 <div class="md-header__title" data-md-component="header-title">
107 <div class="md-header__ellipsis">
108 <div class="md-header__topic">
109 <span class="md-ellipsis">
110 WoltLab Suite Documentation
111 </span>
112 </div>
113 <div class="md-header__topic" data-md-component="header-topic">
114 <span class="md-ellipsis">
115
116 PHP API
117
118 </span>
119 </div>
120 </div>
121 </div>
122
123
124
125 <label class="md-header__button md-icon" for="__search">
126 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
127 </label>
128 <div class="md-search" data-md-component="search" role="dialog">
129 <label class="md-search__overlay" for="__search"></label>
130 <div class="md-search__inner" role="search">
131 <form class="md-search__form" name="search">
132 <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
133 <label class="md-search__icon md-icon" for="__search">
134 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
135 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
136 </label>
137 <nav class="md-search__options" aria-label="Search">
138
139 <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
140 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
141 </button>
142 </nav>
143
144 </form>
145 <div class="md-search__output">
146 <div class="md-search__scrollwrap" data-md-scrollfix>
147 <div class="md-search-result" data-md-component="search-result">
148 <div class="md-search-result__meta">
149 Initializing search
150 </div>
151 <ol class="md-search-result__list" role="presentation"></ol>
152 </div>
153 </div>
154 </div>
155 </div>
156 </div>
157
158
159 <div class="md-header__source">
160 <a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
161 <div class="md-source__icon md-icon">
162
163 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
164 </div>
165 <div class="md-source__repository">
166 GitHub
167 </div>
168 </a>
169 </div>
170
171 </nav>
172
173 </header>
174
175 <div class="md-container" data-md-component="container">
176
177
178
179
180
181
182 <main class="md-main" data-md-component="main">
183 <div class="md-main__inner md-grid">
184
185
186
187 <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
188 <div class="md-sidebar__scrollwrap">
189 <div class="md-sidebar__inner">
190
191
192
193 <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
194 <label class="md-nav__title" for="__drawer">
195 <a href="../../.." title="WoltLab Suite Documentation" class="md-nav__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
196
197 <img src="../../../assets/logo.png" alt="logo">
198
199 </a>
200 WoltLab Suite Documentation
201 </label>
202
203 <div class="md-nav__source">
204 <a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
205 <div class="md-source__icon md-icon">
206
207 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
208 </div>
209 <div class="md-source__repository">
210 GitHub
211 </div>
212 </a>
213 </div>
214
215 <ul class="md-nav__list" data-md-scrollfix>
216
217
218
219
220
221
222
223
224 <li class="md-nav__item">
225 <a href="../../../getting-started/" class="md-nav__link">
226 Getting Started
227 </a>
228 </li>
229
230
231
232
233
234
235
236
237
238
239
240 <li class="md-nav__item md-nav__item--nested">
241
242
243
244
245 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
246
247
248
249 <label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
250 PHP API
251 <span class="md-nav__icon md-icon"></span>
252 </label>
253
254 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
255 <label class="md-nav__title" for="__nav_2">
256 <span class="md-nav__icon md-icon"></span>
257 PHP API
258 </label>
259 <ul class="md-nav__list" data-md-scrollfix>
260
261
262
263
264
265
266 <li class="md-nav__item">
267 <a href="../../../php/pages/" class="md-nav__link">
268 Pages
269 </a>
270 </li>
271
272
273
274
275
276
277
278
279
280 <li class="md-nav__item">
281 <a href="../../../php/database-objects/" class="md-nav__link">
282 Database Objects
283 </a>
284 </li>
285
286
287
288
289
290
291
292
293
294 <li class="md-nav__item">
295 <a href="../../../php/database-access/" class="md-nav__link">
296 Database Access
297 </a>
298 </li>
299
300
301
302
303
304
305
306
307
308 <li class="md-nav__item">
309 <a href="../../../php/exceptions/" class="md-nav__link">
310 Exceptions
311 </a>
312 </li>
313
314
315
316
317
318
319
320
321
322
323 <li class="md-nav__item md-nav__item--nested">
324
325
326
327
328 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_5" >
329
330
331
332 <label class="md-nav__link" for="__nav_2_5" id="__nav_2_5_label" tabindex="0">
333 API
334 <span class="md-nav__icon md-icon"></span>
335 </label>
336
337 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_2_5_label" aria-expanded="false">
338 <label class="md-nav__title" for="__nav_2_5">
339 <span class="md-nav__icon md-icon"></span>
340 API
341 </label>
342 <ul class="md-nav__list" data-md-scrollfix>
343
344
345
346
347
348
349
350 <li class="md-nav__item md-nav__item--nested">
351
352
353
354
355 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_5_1" >
356
357
358
359 <label class="md-nav__link" for="__nav_2_5_1" id="__nav_2_5_1_label" tabindex="0">
360 Caches
361 <span class="md-nav__icon md-icon"></span>
362 </label>
363
364 <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_5_1_label" aria-expanded="false">
365 <label class="md-nav__title" for="__nav_2_5_1">
366 <span class="md-nav__icon md-icon"></span>
367 Caches
368 </label>
369 <ul class="md-nav__list" data-md-scrollfix>
370
371
372
373
374
375
376 <li class="md-nav__item">
377 <a href="../../../php/api/caches/" class="md-nav__link">
378 Overview
379 </a>
380 </li>
381
382
383
384
385
386
387
388
389
390 <li class="md-nav__item">
391 <a href="../../../php/api/caches_persistent-caches/" class="md-nav__link">
392 Persistent Caches
393 </a>
394 </li>
395
396
397
398
399
400
401
402
403
404 <li class="md-nav__item">
405 <a href="../../../php/api/caches_runtime-caches/" class="md-nav__link">
406 Runtime Caches
407 </a>
408 </li>
409
410
411
412
413 </ul>
414 </nav>
415 </li>
416
417
418
419
420
421
422
423
424
425 <li class="md-nav__item">
426 <a href="../../../php/api/comments/" class="md-nav__link">
427 Comments
428 </a>
429 </li>
430
431
432
433
434
435
436
437
438
439 <li class="md-nav__item">
440 <a href="../../../php/api/cronjobs/" class="md-nav__link">
441 Cronjobs
442 </a>
443 </li>
444
445
446
447
448
449
450
451
452
453 <li class="md-nav__item">
454 <a href="../../../php/api/events/" class="md-nav__link">
455 Events
456 </a>
457 </li>
458
459
460
461
462
463
464
465
466
467
468 <li class="md-nav__item md-nav__item--nested">
469
470
471
472
473 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_5_5" >
474
475
476
477 <label class="md-nav__link" for="__nav_2_5_5" id="__nav_2_5_5_label" tabindex="0">
478 Form Builder
479 <span class="md-nav__icon md-icon"></span>
480 </label>
481
482 <nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_5_5_label" aria-expanded="false">
483 <label class="md-nav__title" for="__nav_2_5_5">
484 <span class="md-nav__icon md-icon"></span>
485 Form Builder
486 </label>
487 <ul class="md-nav__list" data-md-scrollfix>
488
489
490
491
492
493
494 <li class="md-nav__item">
495 <a href="../../../php/api/form_builder/overview/" class="md-nav__link">
496 Overview
497 </a>
498 </li>
499
500
501
502
503
504
505
506
507
508 <li class="md-nav__item">
509 <a href="../../../php/api/form_builder/structure/" class="md-nav__link">
510 Structure
511 </a>
512 </li>
513
514
515
516
517
518
519
520
521
522 <li class="md-nav__item">
523 <a href="../../../php/api/form_builder/form_fields/" class="md-nav__link">
524 Fields
525 </a>
526 </li>
527
528
529
530
531
532
533
534
535
536 <li class="md-nav__item">
537 <a href="../../../php/api/form_builder/validation_data/" class="md-nav__link">
538 Validation and Data
539 </a>
540 </li>
541
542
543
544
545
546
547
548
549
550 <li class="md-nav__item">
551 <a href="../../../php/api/form_builder/dependencies/" class="md-nav__link">
552 Dependencies
553 </a>
554 </li>
555
556
557
558
559 </ul>
560 </nav>
561 </li>
562
563
564
565
566
567
568
569
570
571 <li class="md-nav__item">
572 <a href="../../../php/api/package_installation_plugins/" class="md-nav__link">
573 Package Installation Plugins
574 </a>
575 </li>
576
577
578
579
580
581
582
583
584
585 <li class="md-nav__item">
586 <a href="../../../php/api/user_activity_points/" class="md-nav__link">
587 User Activity Points
588 </a>
589 </li>
590
591
592
593
594
595
596
597
598
599 <li class="md-nav__item">
600 <a href="../../../php/api/user_notifications/" class="md-nav__link">
601 User Notifications
602 </a>
603 </li>
604
605
606
607
608
609
610
611
612
613 <li class="md-nav__item">
614 <a href="../../../php/api/sitemaps/" class="md-nav__link">
615 Sitemaps
616 </a>
617 </li>
618
619
620
621
622 </ul>
623 </nav>
624 </li>
625
626
627
628
629
630
631
632
633
634 <li class="md-nav__item">
635 <a href="../../../php/code-style/" class="md-nav__link">
636 Code Style
637 </a>
638 </li>
639
640
641
642
643
644
645
646
647
648 <li class="md-nav__item">
649 <a href="../../../php/apps/" class="md-nav__link">
650 Apps
651 </a>
652 </li>
653
654
655
656
657
658
659
660
661
662 <li class="md-nav__item">
663 <a href="../../../php/gdpr/" class="md-nav__link">
664 GDPR
665 </a>
666 </li>
667
668
669
670
671 </ul>
672 </nav>
673 </li>
674
675
676
677
678
679
680
681
682
683
684
685 <li class="md-nav__item md-nav__item--nested">
686
687
688
689
690 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
691
692
693
694 <label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0">
695 Languages, Templates & CSS
696 <span class="md-nav__icon md-icon"></span>
697 </label>
698
699 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
700 <label class="md-nav__title" for="__nav_3">
701 <span class="md-nav__icon md-icon"></span>
702 Languages, Templates & CSS
703 </label>
704 <ul class="md-nav__list" data-md-scrollfix>
705
706
707
708
709
710
711 <li class="md-nav__item">
712 <a href="../../../view/languages/" class="md-nav__link">
713 Languages
714 </a>
715 </li>
716
717
718
719
720
721
722
723
724
725 <li class="md-nav__item">
726 <a href="../../../view/templates/" class="md-nav__link">
727 Templates
728 </a>
729 </li>
730
731
732
733
734
735
736
737
738
739 <li class="md-nav__item">
740 <a href="../../../view/template-plugins/" class="md-nav__link">
741 Template Plugins
742 </a>
743 </li>
744
745
746
747
748
749
750
751
752
753 <li class="md-nav__item">
754 <a href="../../../view/css/" class="md-nav__link">
755 CSS
756 </a>
757 </li>
758
759
760
761
762 </ul>
763 </nav>
764 </li>
765
766
767
768
769
770
771
772
773
774
775
776 <li class="md-nav__item md-nav__item--nested">
777
778
779
780
781 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
782
783
784
785 <label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
786 TypeScript and JavaScript API
787 <span class="md-nav__icon md-icon"></span>
788 </label>
789
790 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
791 <label class="md-nav__title" for="__nav_4">
792 <span class="md-nav__icon md-icon"></span>
793 TypeScript and JavaScript API
794 </label>
795 <ul class="md-nav__list" data-md-scrollfix>
796
797
798
799
800
801
802 <li class="md-nav__item">
803 <a href="../../../javascript/general-usage/" class="md-nav__link">
804 General Usage
805 </a>
806 </li>
807
808
809
810
811
812
813
814
815
816 <li class="md-nav__item">
817 <a href="../../../javascript/typescript/" class="md-nav__link">
818 TypeScript
819 </a>
820 </li>
821
822
823
824
825
826
827
828
829
830
831 <li class="md-nav__item md-nav__item--nested">
832
833
834
835
836 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_3" >
837
838
839
840 <label class="md-nav__link" for="__nav_4_3" id="__nav_4_3_label" tabindex="0">
841 Components
842 <span class="md-nav__icon md-icon"></span>
843 </label>
844
845 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_3_label" aria-expanded="false">
846 <label class="md-nav__title" for="__nav_4_3">
847 <span class="md-nav__icon md-icon"></span>
848 Components
849 </label>
850 <ul class="md-nav__list" data-md-scrollfix>
851
852
853
854
855
856
857 <li class="md-nav__item">
858 <a href="../../../javascript/components_confirmation/" class="md-nav__link">
859 Confirmation
860 </a>
861 </li>
862
863
864
865
866
867
868
869
870
871 <li class="md-nav__item">
872 <a href="../../../javascript/components_dialog/" class="md-nav__link">
873 Dialog
874 </a>
875 </li>
876
877
878
879
880
881
882
883
884
885 <li class="md-nav__item">
886 <a href="../../../javascript/components_google_maps/" class="md-nav__link">
887 Google Maps
888 </a>
889 </li>
890
891
892
893
894
895
896
897
898
899 <li class="md-nav__item">
900 <a href="../../../javascript/components_pagination/" class="md-nav__link">
901 Pagination
902 </a>
903 </li>
904
905
906
907
908 </ul>
909 </nav>
910 </li>
911
912
913
914
915
916
917
918
919
920
921 <li class="md-nav__item md-nav__item--nested">
922
923
924
925
926 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_4" >
927
928
929
930 <label class="md-nav__link" for="__nav_4_4" id="__nav_4_4_label" tabindex="0">
931 New API
932 <span class="md-nav__icon md-icon"></span>
933 </label>
934
935 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_4_label" aria-expanded="false">
936 <label class="md-nav__title" for="__nav_4_4">
937 <span class="md-nav__icon md-icon"></span>
938 New API
939 </label>
940 <ul class="md-nav__list" data-md-scrollfix>
941
942
943
944
945
946
947 <li class="md-nav__item">
948 <a href="../../../javascript/new-api_writing-a-module/" class="md-nav__link">
949 Writing a module
950 </a>
951 </li>
952
953
954
955
956
957
958
959
960
961 <li class="md-nav__item">
962 <a href="../../../javascript/new-api_core/" class="md-nav__link">
963 Core Functions
964 </a>
965 </li>
966
967
968
969
970
971
972
973
974
975 <li class="md-nav__item">
976 <a href="../../../javascript/new-api_dom/" class="md-nav__link">
977 DOM
978 </a>
979 </li>
980
981
982
983
984
985
986
987
988
989 <li class="md-nav__item">
990 <a href="../../../javascript/new-api_events/" class="md-nav__link">
991 Event Handling
992 </a>
993 </li>
994
995
996
997
998
999
1000
1001
1002
1003 <li class="md-nav__item">
1004 <a href="../../../javascript/new-api_ajax/" class="md-nav__link">
1005 Ajax
1006 </a>
1007 </li>
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017 <li class="md-nav__item">
1018 <a href="../../../javascript/new-api_dialogs/" class="md-nav__link">
1019 Dialogs
1020 </a>
1021 </li>
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031 <li class="md-nav__item">
1032 <a href="../../../javascript/new-api_browser/" class="md-nav__link">
1033 Browser and Screen Sizes
1034 </a>
1035 </li>
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045 <li class="md-nav__item">
1046 <a href="../../../javascript/new-api_ui/" class="md-nav__link">
1047 User Interface
1048 </a>
1049 </li>
1050
1051
1052
1053
1054 </ul>
1055 </nav>
1056 </li>
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066 <li class="md-nav__item">
1067 <a href="../../../javascript/legacy-api/" class="md-nav__link">
1068 Legacy API
1069 </a>
1070 </li>
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080 <li class="md-nav__item">
1081 <a href="../../../javascript/code-snippets/" class="md-nav__link">
1082 Code Snippets
1083 </a>
1084 </li>
1085
1086
1087
1088
1089 </ul>
1090 </nav>
1091 </li>
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103 <li class="md-nav__item md-nav__item--nested">
1104
1105
1106
1107
1108 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
1109
1110
1111
1112 <label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
1113 Package Components
1114 <span class="md-nav__icon md-icon"></span>
1115 </label>
1116
1117 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
1118 <label class="md-nav__title" for="__nav_5">
1119 <span class="md-nav__icon md-icon"></span>
1120 Package Components
1121 </label>
1122 <ul class="md-nav__list" data-md-scrollfix>
1123
1124
1125
1126
1127
1128
1129 <li class="md-nav__item">
1130 <a href="../../../package/package-xml/" class="md-nav__link">
1131 package.xml
1132 </a>
1133 </li>
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144 <li class="md-nav__item md-nav__item--nested">
1145
1146
1147
1148
1149 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" >
1150
1151
1152
1153 <label class="md-nav__link" for="__nav_5_2" id="__nav_5_2_label" tabindex="0">
1154 PIPs
1155 <span class="md-nav__icon md-icon"></span>
1156 </label>
1157
1158 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_2_label" aria-expanded="false">
1159 <label class="md-nav__title" for="__nav_5_2">
1160 <span class="md-nav__icon md-icon"></span>
1161 PIPs
1162 </label>
1163 <ul class="md-nav__list" data-md-scrollfix>
1164
1165
1166
1167
1168
1169
1170 <li class="md-nav__item">
1171 <a href="../../../package/pip/" class="md-nav__link">
1172 Overview
1173 </a>
1174 </li>
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184 <li class="md-nav__item">
1185 <a href="../../../package/pip/acl-option/" class="md-nav__link">
1186 aclOption
1187 </a>
1188 </li>
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198 <li class="md-nav__item">
1199 <a href="../../../package/pip/acp-menu/" class="md-nav__link">
1200 acpMenu
1201 </a>
1202 </li>
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212 <li class="md-nav__item">
1213 <a href="../../../package/pip/acp-search-provider/" class="md-nav__link">
1214 acpSearchProvider
1215 </a>
1216 </li>
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226 <li class="md-nav__item">
1227 <a href="../../../package/pip/acp-template/" class="md-nav__link">
1228 acpTemplate
1229 </a>
1230 </li>
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240 <li class="md-nav__item">
1241 <a href="../../../package/pip/acp-template-delete/" class="md-nav__link">
1242 acpTemplateDelete
1243 </a>
1244 </li>
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254 <li class="md-nav__item">
1255 <a href="../../../package/pip/bbcode/" class="md-nav__link">
1256 bbcode
1257 </a>
1258 </li>
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268 <li class="md-nav__item">
1269 <a href="../../../package/pip/box/" class="md-nav__link">
1270 box
1271 </a>
1272 </li>
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282 <li class="md-nav__item">
1283 <a href="../../../package/pip/clipboard-action/" class="md-nav__link">
1284 clipboardAction
1285 </a>
1286 </li>
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296 <li class="md-nav__item">
1297 <a href="../../../package/pip/core-object/" class="md-nav__link">
1298 coreObject
1299 </a>
1300 </li>
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310 <li class="md-nav__item">
1311 <a href="../../../package/pip/cronjob/" class="md-nav__link">
1312 cronjob
1313 </a>
1314 </li>
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324 <li class="md-nav__item">
1325 <a href="../../../package/pip/database/" class="md-nav__link">
1326 database
1327 </a>
1328 </li>
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338 <li class="md-nav__item">
1339 <a href="../../../package/pip/event-listener/" class="md-nav__link">
1340 eventListener
1341 </a>
1342 </li>
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352 <li class="md-nav__item">
1353 <a href="../../../package/pip/file/" class="md-nav__link">
1354 file
1355 </a>
1356 </li>
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366 <li class="md-nav__item">
1367 <a href="../../../package/pip/file-delete/" class="md-nav__link">
1368 fileDelete
1369 </a>
1370 </li>
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380 <li class="md-nav__item">
1381 <a href="../../../package/pip/language/" class="md-nav__link">
1382 language
1383 </a>
1384 </li>
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394 <li class="md-nav__item">
1395 <a href="../../../package/pip/media-provider/" class="md-nav__link">
1396 mediaProvider
1397 </a>
1398 </li>
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408 <li class="md-nav__item">
1409 <a href="../../../package/pip/menu/" class="md-nav__link">
1410 menu
1411 </a>
1412 </li>
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422 <li class="md-nav__item">
1423 <a href="../../../package/pip/menu-item/" class="md-nav__link">
1424 menuItem
1425 </a>
1426 </li>
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436 <li class="md-nav__item">
1437 <a href="../../../package/pip/object-type/" class="md-nav__link">
1438 objectType
1439 </a>
1440 </li>
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450 <li class="md-nav__item">
1451 <a href="../../../package/pip/object-type-definition/" class="md-nav__link">
1452 objectTypeDefinition
1453 </a>
1454 </li>
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464 <li class="md-nav__item">
1465 <a href="../../../package/pip/option/" class="md-nav__link">
1466 option
1467 </a>
1468 </li>
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478 <li class="md-nav__item">
1479 <a href="../../../package/pip/page/" class="md-nav__link">
1480 page
1481 </a>
1482 </li>
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492 <li class="md-nav__item">
1493 <a href="../../../package/pip/pip/" class="md-nav__link">
1494 pip
1495 </a>
1496 </li>
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506 <li class="md-nav__item">
1507 <a href="../../../package/pip/script/" class="md-nav__link">
1508 script
1509 </a>
1510 </li>
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520 <li class="md-nav__item">
1521 <a href="../../../package/pip/smiley/" class="md-nav__link">
1522 smiley
1523 </a>
1524 </li>
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534 <li class="md-nav__item">
1535 <a href="../../../package/pip/sql/" class="md-nav__link">
1536 sql
1537 </a>
1538 </li>
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548 <li class="md-nav__item">
1549 <a href="../../../package/pip/style/" class="md-nav__link">
1550 style
1551 </a>
1552 </li>
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562 <li class="md-nav__item">
1563 <a href="../../../package/pip/template/" class="md-nav__link">
1564 template
1565 </a>
1566 </li>
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576 <li class="md-nav__item">
1577 <a href="../../../package/pip/template-delete/" class="md-nav__link">
1578 templateDelete
1579 </a>
1580 </li>
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590 <li class="md-nav__item">
1591 <a href="../../../package/pip/template-listener/" class="md-nav__link">
1592 templateListener
1593 </a>
1594 </li>
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604 <li class="md-nav__item">
1605 <a href="../../../package/pip/user-group-option/" class="md-nav__link">
1606 userGroupOption
1607 </a>
1608 </li>
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618 <li class="md-nav__item">
1619 <a href="../../../package/pip/user-menu/" class="md-nav__link">
1620 userMenu
1621 </a>
1622 </li>
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632 <li class="md-nav__item">
1633 <a href="../../../package/pip/user-notification-event/" class="md-nav__link">
1634 userNotificationEvent
1635 </a>
1636 </li>
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646 <li class="md-nav__item">
1647 <a href="../../../package/pip/user-option/" class="md-nav__link">
1648 userOption
1649 </a>
1650 </li>
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660 <li class="md-nav__item">
1661 <a href="../../../package/pip/user-profile-menu/" class="md-nav__link">
1662 userProfileMenu
1663 </a>
1664 </li>
1665
1666
1667
1668
1669 </ul>
1670 </nav>
1671 </li>
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681 <li class="md-nav__item">
1682 <a href="../../../package/database-php-api/" class="md-nav__link">
1683 Database PHP API
1684 </a>
1685 </li>
1686
1687
1688
1689
1690 </ul>
1691 </nav>
1692 </li>
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
1707
1708
1709
1710
1711 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" checked>
1712
1713
1714
1715 <label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
1716 Migration
1717 <span class="md-nav__icon md-icon"></span>
1718 </label>
1719
1720 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="true">
1721 <label class="md-nav__title" for="__nav_6">
1722 <span class="md-nav__icon md-icon"></span>
1723 Migration
1724 </label>
1725 <ul class="md-nav__list" data-md-scrollfix>
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
1736
1737
1738
1739
1740 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_1" checked>
1741
1742
1743
1744 <label class="md-nav__link" for="__nav_6_1" id="__nav_6_1_label" tabindex="0">
1745 From WoltLab Suite 5.5
1746 <span class="md-nav__icon md-icon"></span>
1747 </label>
1748
1749 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_1_label" aria-expanded="true">
1750 <label class="md-nav__title" for="__nav_6_1">
1751 <span class="md-nav__icon md-icon"></span>
1752 From WoltLab Suite 5.5
1753 </label>
1754 <ul class="md-nav__list" data-md-scrollfix>
1755
1756
1757
1758
1759
1760
1761
1762
1763 <li class="md-nav__item md-nav__item--active">
1764
1765 <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
1766
1767
1768
1769
1770
1771 <label class="md-nav__link md-nav__link--active" for="__toc">
1772 PHP API
1773 <span class="md-nav__icon md-icon"></span>
1774 </label>
1775
1776 <a href="./" class="md-nav__link md-nav__link--active">
1777 PHP API
1778 </a>
1779
1780
1781
1782 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
1783
1784
1785
1786
1787
1788
1789 <label class="md-nav__title" for="__toc">
1790 <span class="md-nav__icon md-icon"></span>
1791 Table of contents
1792 </label>
1793 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
1794
1795 <li class="md-nav__item">
1796 <a href="#minimum-requirements" class="md-nav__link">
1797 Minimum requirements
1798 </a>
1799
1800 </li>
1801
1802 <li class="md-nav__item">
1803 <a href="#inheritance" class="md-nav__link">
1804 Inheritance
1805 </a>
1806
1807 <nav class="md-nav" aria-label="Inheritance">
1808 <ul class="md-nav__list">
1809
1810 <li class="md-nav__item">
1811 <a href="#parameter-return-property-types" class="md-nav__link">
1812 Parameter / Return / Property Types
1813 </a>
1814
1815 </li>
1816
1817 <li class="md-nav__item">
1818 <a href="#final" class="md-nav__link">
1819 final
1820 </a>
1821
1822 </li>
1823
1824 </ul>
1825 </nav>
1826
1827 </li>
1828
1829 <li class="md-nav__item">
1830 <a href="#application-boot" class="md-nav__link">
1831 Application Boot
1832 </a>
1833
1834 <nav class="md-nav" aria-label="Application Boot">
1835 <ul class="md-nav__list">
1836
1837 <li class="md-nav__item">
1838 <a href="#request-specific-logic-will-no-longer-happen-during-boot" class="md-nav__link">
1839 Request-specific logic will no longer happen during boot
1840 </a>
1841
1842 </li>
1843
1844 <li class="md-nav__item">
1845 <a href="#bootstrap-scripts" class="md-nav__link">
1846 Bootstrap Scripts
1847 </a>
1848
1849 <nav class="md-nav" aria-label="Bootstrap Scripts">
1850 <ul class="md-nav__list">
1851
1852 <li class="md-nav__item">
1853 <a href="#registering-ievent-listeners" class="md-nav__link">
1854 Registering IEvent listeners
1855 </a>
1856
1857 </li>
1858
1859 </ul>
1860 </nav>
1861
1862 </li>
1863
1864 </ul>
1865 </nav>
1866
1867 </li>
1868
1869 <li class="md-nav__item">
1870 <a href="#request-processing" class="md-nav__link">
1871 Request Processing
1872 </a>
1873
1874 <nav class="md-nav" aria-label="Request Processing">
1875 <ul class="md-nav__list">
1876
1877 <li class="md-nav__item">
1878 <a href="#recommended-changes-for-woltlab-suite-60" class="md-nav__link">
1879 Recommended changes for WoltLab Suite 6.0
1880 </a>
1881
1882 <nav class="md-nav" aria-label="Recommended changes for WoltLab Suite 6.0">
1883 <ul class="md-nav__list">
1884
1885 <li class="md-nav__item">
1886 <a href="#querying-requesthandlerinterface-based-controllers-via-javascript" class="md-nav__link">
1887 Querying RequestHandlerInterface-based controllers via JavaScript
1888 </a>
1889
1890 </li>
1891
1892 <li class="md-nav__item">
1893 <a href="#formbuilder" class="md-nav__link">
1894 FormBuilder
1895 </a>
1896
1897 </li>
1898
1899 <li class="md-nav__item">
1900 <a href="#example" class="md-nav__link">
1901 Example
1902 </a>
1903
1904 </li>
1905
1906 </ul>
1907 </nav>
1908
1909 </li>
1910
1911 </ul>
1912 </nav>
1913
1914 </li>
1915
1916 <li class="md-nav__item">
1917 <a href="#package-system" class="md-nav__link">
1918 Package System
1919 </a>
1920
1921 <nav class="md-nav" aria-label="Package System">
1922 <ul class="md-nav__list">
1923
1924 <li class="md-nav__item">
1925 <a href="#required-minversion-for-required-packages" class="md-nav__link">
1926 Required “minversion” for required packages
1927 </a>
1928
1929 </li>
1930
1931 <li class="md-nav__item">
1932 <a href="#rejection-of-pl-versions" class="md-nav__link">
1933 Rejection of “pl” versions
1934 </a>
1935
1936 </li>
1937
1938 <li class="md-nav__item">
1939 <a href="#removal-of-api-compatibility" class="md-nav__link">
1940 Removal of API compatibility
1941 </a>
1942
1943 </li>
1944
1945 <li class="md-nav__item">
1946 <a href="#package-installation-plugins" class="md-nav__link">
1947 Package Installation Plugins
1948 </a>
1949
1950 <nav class="md-nav" aria-label="Package Installation Plugins">
1951 <ul class="md-nav__list">
1952
1953 <li class="md-nav__item">
1954 <a href="#eventlistener" class="md-nav__link">
1955 EventListener
1956 </a>
1957
1958 </li>
1959
1960 <li class="md-nav__item">
1961 <a href="#cronjob" class="md-nav__link">
1962 Cronjob
1963 </a>
1964
1965 </li>
1966
1967 <li class="md-nav__item">
1968 <a href="#database" class="md-nav__link">
1969 Database
1970 </a>
1971
1972 </li>
1973
1974 </ul>
1975 </nav>
1976
1977 </li>
1978
1979 </ul>
1980 </nav>
1981
1982 </li>
1983
1984 <li class="md-nav__item">
1985 <a href="#internationalization" class="md-nav__link">
1986 Internationalization
1987 </a>
1988
1989 </li>
1990
1991 <li class="md-nav__item">
1992 <a href="#indicating-parameters-that-hold-sensitive-information" class="md-nav__link">
1993 Indicating parameters that hold sensitive information
1994 </a>
1995
1996 </li>
1997
1998 <li class="md-nav__item">
1999 <a href="#conditions" class="md-nav__link">
2000 Conditions
2001 </a>
2002
2003 <nav class="md-nav" aria-label="Conditions">
2004 <ul class="md-nav__list">
2005
2006 <li class="md-nav__item">
2007 <a href="#abstractintegercondition" class="md-nav__link">
2008 AbstractIntegerCondition
2009 </a>
2010
2011 </li>
2012
2013 </ul>
2014 </nav>
2015
2016 </li>
2017
2018 <li class="md-nav__item">
2019 <a href="#rebuild-workers" class="md-nav__link">
2020 Rebuild Workers
2021 </a>
2022
2023 </li>
2024
2025 </ul>
2026
2027 </nav>
2028
2029 </li>
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039 <li class="md-nav__item">
2040 <a href="../javascript/" class="md-nav__link">
2041 TypeScript and JavaScript
2042 </a>
2043 </li>
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053 <li class="md-nav__item">
2054 <a href="../templates/" class="md-nav__link">
2055 Templates
2056 </a>
2057 </li>
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067 <li class="md-nav__item">
2068 <a href="../icons/" class="md-nav__link">
2069 Icons
2070 </a>
2071 </li>
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081 <li class="md-nav__item">
2082 <a href="../dialogs/" class="md-nav__link">
2083 Dialogs
2084 </a>
2085 </li>
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095 <li class="md-nav__item">
2096 <a href="../libraries/" class="md-nav__link">
2097 Third Party Libraries
2098 </a>
2099 </li>
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109 <li class="md-nav__item">
2110 <a href="../deprecations_removals/" class="md-nav__link">
2111 Deprecations and Removals
2112 </a>
2113 </li>
2114
2115
2116
2117
2118 </ul>
2119 </nav>
2120 </li>
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131 <li class="md-nav__item md-nav__item--nested">
2132
2133
2134
2135
2136 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_2" >
2137
2138
2139
2140 <label class="md-nav__link" for="__nav_6_2" id="__nav_6_2_label" tabindex="0">
2141 From WoltLab Suite 5.4
2142 <span class="md-nav__icon md-icon"></span>
2143 </label>
2144
2145 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_2_label" aria-expanded="false">
2146 <label class="md-nav__title" for="__nav_6_2">
2147 <span class="md-nav__icon md-icon"></span>
2148 From WoltLab Suite 5.4
2149 </label>
2150 <ul class="md-nav__list" data-md-scrollfix>
2151
2152
2153
2154
2155
2156
2157 <li class="md-nav__item">
2158 <a href="../../wsc54/php/" class="md-nav__link">
2159 PHP API
2160 </a>
2161 </li>
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171 <li class="md-nav__item">
2172 <a href="../../wsc54/javascript/" class="md-nav__link">
2173 TypeScript and JavaScript
2174 </a>
2175 </li>
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185 <li class="md-nav__item">
2186 <a href="../../wsc54/templates/" class="md-nav__link">
2187 Templates
2188 </a>
2189 </li>
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199 <li class="md-nav__item">
2200 <a href="../../wsc54/libraries/" class="md-nav__link">
2201 Third Party Libraries
2202 </a>
2203 </li>
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213 <li class="md-nav__item">
2214 <a href="../../wsc54/deprecations_removals/" class="md-nav__link">
2215 Deprecations and Removals
2216 </a>
2217 </li>
2218
2219
2220
2221
2222 </ul>
2223 </nav>
2224 </li>
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235 <li class="md-nav__item md-nav__item--nested">
2236
2237
2238
2239
2240 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_3" >
2241
2242
2243
2244 <label class="md-nav__link" for="__nav_6_3" id="__nav_6_3_label" tabindex="0">
2245 From WoltLab Suite 5.3
2246 <span class="md-nav__icon md-icon"></span>
2247 </label>
2248
2249 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_3_label" aria-expanded="false">
2250 <label class="md-nav__title" for="__nav_6_3">
2251 <span class="md-nav__icon md-icon"></span>
2252 From WoltLab Suite 5.3
2253 </label>
2254 <ul class="md-nav__list" data-md-scrollfix>
2255
2256
2257
2258
2259
2260
2261 <li class="md-nav__item">
2262 <a href="../../wsc53/php/" class="md-nav__link">
2263 PHP API
2264 </a>
2265 </li>
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275 <li class="md-nav__item">
2276 <a href="../../wsc53/session/" class="md-nav__link">
2277 Session Handling and Authentication
2278 </a>
2279 </li>
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289 <li class="md-nav__item">
2290 <a href="../../wsc53/javascript/" class="md-nav__link">
2291 TypeScript and JavaScript
2292 </a>
2293 </li>
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303 <li class="md-nav__item">
2304 <a href="../../wsc53/templates/" class="md-nav__link">
2305 Templates
2306 </a>
2307 </li>
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317 <li class="md-nav__item">
2318 <a href="../../wsc53/libraries/" class="md-nav__link">
2319 Third Party Libraries
2320 </a>
2321 </li>
2322
2323
2324
2325
2326 </ul>
2327 </nav>
2328 </li>
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339 <li class="md-nav__item md-nav__item--nested">
2340
2341
2342
2343
2344 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_4" >
2345
2346
2347
2348 <label class="md-nav__link" for="__nav_6_4" id="__nav_6_4_label" tabindex="0">
2349 From WoltLab Suite 5.2
2350 <span class="md-nav__icon md-icon"></span>
2351 </label>
2352
2353 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_4_label" aria-expanded="false">
2354 <label class="md-nav__title" for="__nav_6_4">
2355 <span class="md-nav__icon md-icon"></span>
2356 From WoltLab Suite 5.2
2357 </label>
2358 <ul class="md-nav__list" data-md-scrollfix>
2359
2360
2361
2362
2363
2364
2365 <li class="md-nav__item">
2366 <a href="../../wsc52/php/" class="md-nav__link">
2367 PHP API
2368 </a>
2369 </li>
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379 <li class="md-nav__item">
2380 <a href="../../wsc52/templates/" class="md-nav__link">
2381 Templates and Languages
2382 </a>
2383 </li>
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393 <li class="md-nav__item">
2394 <a href="../../wsc52/libraries/" class="md-nav__link">
2395 Third Party Libraries
2396 </a>
2397 </li>
2398
2399
2400
2401
2402 </ul>
2403 </nav>
2404 </li>
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415 <li class="md-nav__item md-nav__item--nested">
2416
2417
2418
2419
2420 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_5" >
2421
2422
2423
2424 <label class="md-nav__link" for="__nav_6_5" id="__nav_6_5_label" tabindex="0">
2425 From WoltLab Suite 3.1
2426 <span class="md-nav__icon md-icon"></span>
2427 </label>
2428
2429 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_5_label" aria-expanded="false">
2430 <label class="md-nav__title" for="__nav_6_5">
2431 <span class="md-nav__icon md-icon"></span>
2432 From WoltLab Suite 3.1
2433 </label>
2434 <ul class="md-nav__list" data-md-scrollfix>
2435
2436
2437
2438
2439
2440
2441 <li class="md-nav__item">
2442 <a href="../../wsc31/php/" class="md-nav__link">
2443 PHP API
2444 </a>
2445 </li>
2446
2447
2448
2449
2450 </ul>
2451 </nav>
2452 </li>
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463 <li class="md-nav__item md-nav__item--nested">
2464
2465
2466
2467
2468 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_6" >
2469
2470
2471
2472 <label class="md-nav__link" for="__nav_6_6" id="__nav_6_6_label" tabindex="0">
2473 From WoltLab Suite 3.0
2474 <span class="md-nav__icon md-icon"></span>
2475 </label>
2476
2477 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_6_label" aria-expanded="false">
2478 <label class="md-nav__title" for="__nav_6_6">
2479 <span class="md-nav__icon md-icon"></span>
2480 From WoltLab Suite 3.0
2481 </label>
2482 <ul class="md-nav__list" data-md-scrollfix>
2483
2484
2485
2486
2487
2488
2489 <li class="md-nav__item">
2490 <a href="../../wsc30/php/" class="md-nav__link">
2491 PHP API
2492 </a>
2493 </li>
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503 <li class="md-nav__item">
2504 <a href="../../wsc30/javascript/" class="md-nav__link">
2505 JavaScript API
2506 </a>
2507 </li>
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517 <li class="md-nav__item">
2518 <a href="../../wsc30/templates/" class="md-nav__link">
2519 Templates
2520 </a>
2521 </li>
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531 <li class="md-nav__item">
2532 <a href="../../wsc30/css/" class="md-nav__link">
2533 CSS
2534 </a>
2535 </li>
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545 <li class="md-nav__item">
2546 <a href="../../wsc30/package/" class="md-nav__link">
2547 Package Components
2548 </a>
2549 </li>
2550
2551
2552
2553
2554 </ul>
2555 </nav>
2556 </li>
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567 <li class="md-nav__item md-nav__item--nested">
2568
2569
2570
2571
2572 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_7" >
2573
2574
2575
2576 <label class="md-nav__link" for="__nav_6_7" id="__nav_6_7_label" tabindex="0">
2577 From WCF 2.1
2578 <span class="md-nav__icon md-icon"></span>
2579 </label>
2580
2581 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_7_label" aria-expanded="false">
2582 <label class="md-nav__title" for="__nav_6_7">
2583 <span class="md-nav__icon md-icon"></span>
2584 From WCF 2.1
2585 </label>
2586 <ul class="md-nav__list" data-md-scrollfix>
2587
2588
2589
2590
2591
2592
2593 <li class="md-nav__item">
2594 <a href="../../wcf21/php/" class="md-nav__link">
2595 PHP API
2596 </a>
2597 </li>
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607 <li class="md-nav__item">
2608 <a href="../../wcf21/templates/" class="md-nav__link">
2609 Templates
2610 </a>
2611 </li>
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621 <li class="md-nav__item">
2622 <a href="../../wcf21/css/" class="md-nav__link">
2623 CSS
2624 </a>
2625 </li>
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635 <li class="md-nav__item">
2636 <a href="../../wcf21/package/" class="md-nav__link">
2637 Package Components
2638 </a>
2639 </li>
2640
2641
2642
2643
2644 </ul>
2645 </nav>
2646 </li>
2647
2648
2649
2650
2651 </ul>
2652 </nav>
2653 </li>
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665 <li class="md-nav__item md-nav__item--nested">
2666
2667
2668
2669
2670 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
2671
2672
2673
2674 <label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
2675 Tutorials
2676 <span class="md-nav__icon md-icon"></span>
2677 </label>
2678
2679 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
2680 <label class="md-nav__title" for="__nav_7">
2681 <span class="md-nav__icon md-icon"></span>
2682 Tutorials
2683 </label>
2684 <ul class="md-nav__list" data-md-scrollfix>
2685
2686
2687
2688
2689
2690
2691
2692 <li class="md-nav__item md-nav__item--nested">
2693
2694
2695
2696
2697 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7_1" >
2698
2699
2700
2701 <label class="md-nav__link" for="__nav_7_1" id="__nav_7_1_label" tabindex="0">
2702 Tutorial Series
2703 <span class="md-nav__icon md-icon"></span>
2704 </label>
2705
2706 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_7_1_label" aria-expanded="false">
2707 <label class="md-nav__title" for="__nav_7_1">
2708 <span class="md-nav__icon md-icon"></span>
2709 Tutorial Series
2710 </label>
2711 <ul class="md-nav__list" data-md-scrollfix>
2712
2713
2714
2715
2716
2717
2718 <li class="md-nav__item">
2719 <a href="../../../tutorial/series/overview/" class="md-nav__link">
2720 Overview
2721 </a>
2722 </li>
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732 <li class="md-nav__item">
2733 <a href="../../../tutorial/series/part_1/" class="md-nav__link">
2734 Part 1
2735 </a>
2736 </li>
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746 <li class="md-nav__item">
2747 <a href="../../../tutorial/series/part_2/" class="md-nav__link">
2748 Part 2
2749 </a>
2750 </li>
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760 <li class="md-nav__item">
2761 <a href="../../../tutorial/series/part_3/" class="md-nav__link">
2762 Part 3
2763 </a>
2764 </li>
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774 <li class="md-nav__item">
2775 <a href="../../../tutorial/series/part_4/" class="md-nav__link">
2776 Part 4
2777 </a>
2778 </li>
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788 <li class="md-nav__item">
2789 <a href="../../../tutorial/series/part_5/" class="md-nav__link">
2790 Part 5
2791 </a>
2792 </li>
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802 <li class="md-nav__item">
2803 <a href="../../../tutorial/series/part_6/" class="md-nav__link">
2804 Part 6
2805 </a>
2806 </li>
2807
2808
2809
2810
2811 </ul>
2812 </nav>
2813 </li>
2814
2815
2816
2817
2818 </ul>
2819 </nav>
2820 </li>
2821
2822
2823
2824 </ul>
2825 </nav>
2826 </div>
2827 </div>
2828 </div>
2829
2830
2831
2832 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
2833 <div class="md-sidebar__scrollwrap">
2834 <div class="md-sidebar__inner">
2835
2836
2837 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
2838
2839
2840
2841
2842
2843
2844 <label class="md-nav__title" for="__toc">
2845 <span class="md-nav__icon md-icon"></span>
2846 Table of contents
2847 </label>
2848 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
2849
2850 <li class="md-nav__item">
2851 <a href="#minimum-requirements" class="md-nav__link">
2852 Minimum requirements
2853 </a>
2854
2855 </li>
2856
2857 <li class="md-nav__item">
2858 <a href="#inheritance" class="md-nav__link">
2859 Inheritance
2860 </a>
2861
2862 <nav class="md-nav" aria-label="Inheritance">
2863 <ul class="md-nav__list">
2864
2865 <li class="md-nav__item">
2866 <a href="#parameter-return-property-types" class="md-nav__link">
2867 Parameter / Return / Property Types
2868 </a>
2869
2870 </li>
2871
2872 <li class="md-nav__item">
2873 <a href="#final" class="md-nav__link">
2874 final
2875 </a>
2876
2877 </li>
2878
2879 </ul>
2880 </nav>
2881
2882 </li>
2883
2884 <li class="md-nav__item">
2885 <a href="#application-boot" class="md-nav__link">
2886 Application Boot
2887 </a>
2888
2889 <nav class="md-nav" aria-label="Application Boot">
2890 <ul class="md-nav__list">
2891
2892 <li class="md-nav__item">
2893 <a href="#request-specific-logic-will-no-longer-happen-during-boot" class="md-nav__link">
2894 Request-specific logic will no longer happen during boot
2895 </a>
2896
2897 </li>
2898
2899 <li class="md-nav__item">
2900 <a href="#bootstrap-scripts" class="md-nav__link">
2901 Bootstrap Scripts
2902 </a>
2903
2904 <nav class="md-nav" aria-label="Bootstrap Scripts">
2905 <ul class="md-nav__list">
2906
2907 <li class="md-nav__item">
2908 <a href="#registering-ievent-listeners" class="md-nav__link">
2909 Registering IEvent listeners
2910 </a>
2911
2912 </li>
2913
2914 </ul>
2915 </nav>
2916
2917 </li>
2918
2919 </ul>
2920 </nav>
2921
2922 </li>
2923
2924 <li class="md-nav__item">
2925 <a href="#request-processing" class="md-nav__link">
2926 Request Processing
2927 </a>
2928
2929 <nav class="md-nav" aria-label="Request Processing">
2930 <ul class="md-nav__list">
2931
2932 <li class="md-nav__item">
2933 <a href="#recommended-changes-for-woltlab-suite-60" class="md-nav__link">
2934 Recommended changes for WoltLab Suite 6.0
2935 </a>
2936
2937 <nav class="md-nav" aria-label="Recommended changes for WoltLab Suite 6.0">
2938 <ul class="md-nav__list">
2939
2940 <li class="md-nav__item">
2941 <a href="#querying-requesthandlerinterface-based-controllers-via-javascript" class="md-nav__link">
2942 Querying RequestHandlerInterface-based controllers via JavaScript
2943 </a>
2944
2945 </li>
2946
2947 <li class="md-nav__item">
2948 <a href="#formbuilder" class="md-nav__link">
2949 FormBuilder
2950 </a>
2951
2952 </li>
2953
2954 <li class="md-nav__item">
2955 <a href="#example" class="md-nav__link">
2956 Example
2957 </a>
2958
2959 </li>
2960
2961 </ul>
2962 </nav>
2963
2964 </li>
2965
2966 </ul>
2967 </nav>
2968
2969 </li>
2970
2971 <li class="md-nav__item">
2972 <a href="#package-system" class="md-nav__link">
2973 Package System
2974 </a>
2975
2976 <nav class="md-nav" aria-label="Package System">
2977 <ul class="md-nav__list">
2978
2979 <li class="md-nav__item">
2980 <a href="#required-minversion-for-required-packages" class="md-nav__link">
2981 Required “minversion” for required packages
2982 </a>
2983
2984 </li>
2985
2986 <li class="md-nav__item">
2987 <a href="#rejection-of-pl-versions" class="md-nav__link">
2988 Rejection of “pl” versions
2989 </a>
2990
2991 </li>
2992
2993 <li class="md-nav__item">
2994 <a href="#removal-of-api-compatibility" class="md-nav__link">
2995 Removal of API compatibility
2996 </a>
2997
2998 </li>
2999
3000 <li class="md-nav__item">
3001 <a href="#package-installation-plugins" class="md-nav__link">
3002 Package Installation Plugins
3003 </a>
3004
3005 <nav class="md-nav" aria-label="Package Installation Plugins">
3006 <ul class="md-nav__list">
3007
3008 <li class="md-nav__item">
3009 <a href="#eventlistener" class="md-nav__link">
3010 EventListener
3011 </a>
3012
3013 </li>
3014
3015 <li class="md-nav__item">
3016 <a href="#cronjob" class="md-nav__link">
3017 Cronjob
3018 </a>
3019
3020 </li>
3021
3022 <li class="md-nav__item">
3023 <a href="#database" class="md-nav__link">
3024 Database
3025 </a>
3026
3027 </li>
3028
3029 </ul>
3030 </nav>
3031
3032 </li>
3033
3034 </ul>
3035 </nav>
3036
3037 </li>
3038
3039 <li class="md-nav__item">
3040 <a href="#internationalization" class="md-nav__link">
3041 Internationalization
3042 </a>
3043
3044 </li>
3045
3046 <li class="md-nav__item">
3047 <a href="#indicating-parameters-that-hold-sensitive-information" class="md-nav__link">
3048 Indicating parameters that hold sensitive information
3049 </a>
3050
3051 </li>
3052
3053 <li class="md-nav__item">
3054 <a href="#conditions" class="md-nav__link">
3055 Conditions
3056 </a>
3057
3058 <nav class="md-nav" aria-label="Conditions">
3059 <ul class="md-nav__list">
3060
3061 <li class="md-nav__item">
3062 <a href="#abstractintegercondition" class="md-nav__link">
3063 AbstractIntegerCondition
3064 </a>
3065
3066 </li>
3067
3068 </ul>
3069 </nav>
3070
3071 </li>
3072
3073 <li class="md-nav__item">
3074 <a href="#rebuild-workers" class="md-nav__link">
3075 Rebuild Workers
3076 </a>
3077
3078 </li>
3079
3080 </ul>
3081
3082 </nav>
3083 </div>
3084 </div>
3085 </div>
3086
3087
3088
3089 <div class="md-content" data-md-component="content">
3090 <article class="md-content__inner md-typeset">
3091
3092
3093
3094
3095
3096
3097
3098 <h1 id="migrating-from-woltlab-suite-55-php">Migrating from WoltLab Suite 5.5 - PHP<a class="headerlink" href="#migrating-from-woltlab-suite-55-php" title="Permanent link">#</a></h1>
3099 <h2 id="minimum-requirements">Minimum requirements<a class="headerlink" href="#minimum-requirements" title="Permanent link">#</a></h2>
3100 <p>The minimum requirements have been increased to the following:</p>
3101 <ul>
3102 <li><strong>PHP:</strong> 8.1.2 (64 bit only); <code>intl</code> extension</li>
3103 <li><strong>MySQL:</strong> 8.0.29</li>
3104 <li><strong>MariaDB:</strong> 10.5.12</li>
3105 </ul>
3106 <p>It is recommended to make use of the newly introduced features whereever possible.
3107 Please refer to the PHP documentation for details.</p>
3108 <h2 id="inheritance">Inheritance<a class="headerlink" href="#inheritance" title="Permanent link">#</a></h2>
3109 <h3 id="parameter-return-property-types">Parameter / Return / Property Types<a class="headerlink" href="#parameter-return-property-types" title="Permanent link">#</a></h3>
3110 <p>Parameter, return, and property types have been added to methods of various classes/interfaces.
3111 This might cause errors during inheritance, because the types are not compatible with the newly added types in the parent class.</p>
3112 <p>Return types may already be added in package versions for older WoltLab Suite branches to be forward compatible, because return types are covariant.</p>
3113 <h3 id="final">final<a class="headerlink" href="#final" title="Permanent link">#</a></h3>
3114 <p>The <code>final</code> modifier was added to several classes that were not usefully set up for inheritance in the first place to make it explicit that inheriting from these classes is unsupported.</p>
3115 <h2 id="application-boot">Application Boot<a class="headerlink" href="#application-boot" title="Permanent link">#</a></h2>
3116 <h3 id="request-specific-logic-will-no-longer-happen-during-boot">Request-specific logic will no longer happen during boot<a class="headerlink" href="#request-specific-logic-will-no-longer-happen-during-boot" title="Permanent link">#</a></h3>
3117 <p>Historically the application boot in <code>WCF</code>’s constructor performed processing based on fundamentally request-specific values, such as the accessed URL, the request body, or cookies.
3118 This is problematic, because this makes the boot dependent on the HTTP environment which may not be be available, e.g. when using the CLI interface for maintenance jobs.
3119 The latter needs to emulate certain aspects of the HTTP environment for the boot to succeed.
3120 Furthermore one of the goals of the introduction of PSR-7/PSR-15-based request processing that <a href="../../wsc54/php/#initial-psr-7-support">was started in WoltLab Suite 5.5</a> is the removal of implicit global state in favor of explicitly provided values by means of a <code>ServerRequestInterface</code> and thus to achieve a cleaner architecture.</p>
3121 <p>To achieve a clean separation this type of request-specific logic will incrementally be moved out of the application boot in <code>WCF</code>’s constructor and into the request processing stack that is launched by <code>RequestHandler</code>, e.g. by running appropriate PSR-15 middleware.</p>
3122 <p>An example of this type of request-specific logic that was previously happening during application boot is the check that verifies whether a user is banned and denies access otherwise.
3123 This check is based on a request-specific value, namely the user’s session which in turn is based on a provided (HTTP) cookie.
3124 It is now <a href="https://github.com/WoltLab/WCF/commit/51154ba3f8f1d09b54560d5d1933f9053ef409cb">moved into the <code>CheckUserBan</code> middleware</a>.</p>
3125 <p>This move implies that custom scripts that include WoltLab Suite Core’s <code>global.php</code>, without also invoking <code>RequestHandler</code> will no longer be able to rely on this type of access control having happened and will need to implement it themselves, e.g. by manually running the appropriate middlewares.</p>
3126 <p>Notably the following checks have been moved into a middleware:</p>
3127 <ul>
3128 <li>Denying access to banned users (<a href="https://github.com/WoltLab/WCF/pull/4935">WoltLab/WCF#4935</a>)</li>
3129 <li>ACP authentication (<a href="https://github.com/WoltLab/WCF/pull/4939">WoltLab/WCF#4939</a>)</li>
3130 </ul>
3131 <p>The initialization of the session itself and dependent subsystems (e.g. the user object and thus the current language) is still running during application boot for now.
3132 However it is planned to also move the session initialization into the middleware in a future version and then providing access to the session by adding an attribute on the <code>ServerRequestInterface</code>, instead of querying the session via <code>WCF::getSession()</code>.
3133 As such you should begin to stop relying on the session and user outside of <code>RequestHandler</code>’s middleware stack and should also avoid calling <code>WCF::getUser()</code> and <code>WCF::getSession()</code> outside of a controller, instead adding a <code>User</code> parameter to your methods to allow an appropriate user to be passed from the outside.</p>
3134 <p>An example of a method that implicitly relies on these global values is the <a href="https://github.com/WoltLab/WCF/blob/7cfd5578ede22e798b770262c0cdf1e9dfe25d36/wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php#L199">VisitTracker's <code>trackObjectVisit()</code> method</a>.
3135 It only takes the object type, object ID and timestamp as the parameter and will determine the <code>userID</code> by itself.
3136 The <code>trackObjectVisitByUserIDs()</code> method on the other hand does not rely on global values.
3137 Instead the relevant user IDs need to be passed explicitly from the controller as parameters, thus making the information the method works with explicit.
3138 This also makes the method reusable for use cases where an object should be marked as visited for a user other than the active user, without needing to temporarily switch the active user in the session.</p>
3139 <p>The same is true for “permission checking” methods on <code>DatabaseObject</code>s.
3140 Instead of having a <code>$myObject-&gt;canView()</code> method that uses <code>WCF::getSession()</code> or <code>WCF::getUser()</code> internally, the user should explicitly be passed to the method as a parameter, allowing for permission checks to happen in a different context, for example send sending notification emails.</p>
3141 <p>Likewise event listeners should not access these request-specific values at all, because they are unable to know whether the event was fired based on these request-specific values or whether some programmatic action fired the event for another arbitrary user.
3142 Instead they must retrieve the appropriate information from the event data only.</p>
3143 <h3 id="bootstrap-scripts">Bootstrap Scripts<a class="headerlink" href="#bootstrap-scripts" title="Permanent link">#</a></h3>
3144 <p>WoltLab Suite 6.0 adds package-specific bootstrap scripts allowing a package to execute logic during the application boot to prepare the environment before the request is passed through the middleware pipeline into the controller in <code>RequestHandler</code>.</p>
3145 <p>Bootstrap scripts are stored in the <code>lib/bootstrap/</code> directory of WoltLab Suite Core with the package identifier as the file name.
3146 They do not need to be registered explicitly, as one future goal of the bootstrap scripts is reducing the amount of system state that needs to be stored within the database.
3147 Instead WoltLab Suite Core will automatically create a bootstrap loader that includes all installed bootstrap scripts as part of the package installation and uninstallation process.</p>
3148 <p>Bootstrap scripts will be loaded and the bootstrap functions will executed based on a topological sorting of all installed packages.
3149 A package can rely on all bootstrap scripts of its dependencies being loaded before its own bootstrap script is loaded.
3150 It can also rely on all bootstrap functions of its dependencies having executed before its own bootstrap functions is executed.
3151 However it cannot rely on any specific loading and execution order of non-dependencies.</p>
3152 <p>As hinted at in the previous paragraph, executing the bootstrap scripts happens in two phases:</p>
3153 <ol>
3154 <li>All bootstrap scripts will be <code>include()</code>d in topological order. The script is expected to return a <code>Closure</code> that is executed in phase 2.</li>
3155 <li>Once all bootstrap scripts have been included, the returned <code>Closure</code>s will be executed in the same order the bootstrap scripts were loaded.</li>
3156 </ol>
3157 <div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">files/lib/bootstrap/com.example.foo.php</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3158 <span class="normal">2</span>
3159 <span class="normal">3</span>
3160 <span class="normal">4</span>
3161 <span class="normal">5</span>
3162 <span class="normal">6</span>
3163 <span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
3164
3165 <span class="c1">// Phase (1).</span>
3166
3167 <span class="k">return</span> <span class="k">static</span> <span class="k">function</span> <span class="p">()</span><span class="o">:</span> <span class="nx">void</span> <span class="p">{</span>
3168 <span class="c1">// Phase (2).</span>
3169 <span class="p">};</span>
3170 </code></pre></div></td></tr></table></div>
3171 <p>For the vast majority of packages it is expected that the phase (1) bootstrapping is not used, except to return the <code>Closure</code>.
3172 Instead the logic should reside in the <code>Closure</code>s body that is executed in phase (2).</p>
3173 <h4 id="registering-ievent-listeners">Registering <code>IEvent</code> listeners<a class="headerlink" href="#registering-ievent-listeners" title="Permanent link">#</a></h4>
3174 <p>An example use case for bootstrap scripts with WoltLab Suite 6.0 is registering event listeners for <code>IEvent</code>-based events that <a href="../../wsc54/php/#events">were added with WoltLab Suite 5.5</a>, instead of using the <a href="../../../package/pip/event-listener/">eventListener PIP</a>.
3175 Registering event listeners within the bootstrap script allows you to leverage your IDE’s autocompletion for class names and and prevents forgetting the explicit uninstallation of old event listeners during a package upgrade.</p>
3176 <div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">files/lib/bootstrap/com.example.bar.php</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
3177 <span class="normal"> 2</span>
3178 <span class="normal"> 3</span>
3179 <span class="normal"> 4</span>
3180 <span class="normal"> 5</span>
3181 <span class="normal"> 6</span>
3182 <span class="normal"> 7</span>
3183 <span class="normal"> 8</span>
3184 <span class="normal"> 9</span>
3185 <span class="normal">10</span>
3186 <span class="normal">11</span>
3187 <span class="normal">12</span>
3188 <span class="normal">13</span>
3189 <span class="normal">14</span>
3190 <span class="normal">15</span>
3191 <span class="normal">16</span>
3192 <span class="normal">17</span>
3193 <span class="normal">18</span>
3194 <span class="normal">19</span>
3195 <span class="normal">20</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
3196
3197 <span class="k">use</span> <span class="nx">wcf\system\event\EventHandler</span><span class="p">;</span>
3198 <span class="k">use</span> <span class="nx">wcf\system\event\listener\ValueDumpListener</span><span class="p">;</span>
3199 <span class="k">use</span> <span class="nx">wcf\system\foo\event\ValueAvailable</span><span class="p">;</span>
3200
3201 <span class="k">return</span> <span class="k">static</span> <span class="k">function</span> <span class="p">()</span><span class="o">:</span> <span class="nx">void</span> <span class="p">{</span>
3202 <span class="nx">EventHandler</span><span class="o">::</span><span class="na">getInstance</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">register</span><span class="p">(</span>
3203 <span class="nx">ValueAvailable</span><span class="o">::</span><span class="na">class</span><span class="p">,</span>
3204 <span class="nx">ValueDumpListener</span><span class="o">::</span><span class="na">class</span>
3205 <span class="p">);</span>
3206
3207 <span class="nx">EventHandler</span><span class="o">::</span><span class="na">getInstance</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">register</span><span class="p">(</span>
3208 <span class="nx">ValueAvailable</span><span class="o">::</span><span class="na">class</span><span class="p">,</span>
3209 <span class="k">static</span> <span class="k">function</span> <span class="p">(</span><span class="nx">ValueAvailable</span> <span class="nv">$event</span><span class="p">)</span><span class="o">:</span> <span class="nx">void</span> <span class="p">{</span>
3210 <span class="c1">// For simple use cases a `Closure` instead of a class name may be used.</span>
3211 <span class="nx">\var_dump</span><span class="p">(</span><span class="nv">$event</span><span class="o">-&gt;</span><span class="na">getValue</span><span class="p">());</span>
3212 <span class="p">}</span>
3213 <span class="p">);</span>
3214 <span class="p">};</span>
3215 </code></pre></div></td></tr></table></div>
3216 <h2 id="request-processing">Request Processing<a class="headerlink" href="#request-processing" title="Permanent link">#</a></h2>
3217 <p>As previously mentioned in the <a href="#application-boot">Application Boot</a> section, WoltLab Suite 6.0 improves support for PSR-7/PSR-15-based request processing <a href="../../wsc54/php/#initial-psr-7-support">that was initially announced with WoltLab Suite 5.5</a>.</p>
3218 <p>WoltLab Suite 5.5 added support for returning a PSR-7 <code>ResponseInterface</code> from a controller and recommended to migrate existing controllers based on <code>AbstractAction</code> to make use of <code>RedirectResponse</code> and <code>JsonResponse</code> instead of using <code>HeaderUtil::redirect()</code> or manually emitting JSON with appropriate headers.
3219 Processing the request values still used PHP’s superglobals (specifically <code>$_GET</code> and <code>$_POST</code>).</p>
3220 <p>WoltLab Suite 6.0 adds support for controllers based on PSR-15’s <code>RequestHandlerInterface</code>, supporting request processing based on a provided PSR-7 <code>ServerRequestInterface</code> object.</p>
3221 <h3 id="recommended-changes-for-woltlab-suite-60">Recommended changes for WoltLab Suite 6.0<a class="headerlink" href="#recommended-changes-for-woltlab-suite-60" title="Permanent link">#</a></h3>
3222 <p>It is recommended to use <code>RequestHandlerInterface</code>-based controllers whenever an <code>AbstractAction</code> would previously be used.
3223 Furthermore any AJAX-based logic that would previously rely on <code>AJAXProxyAction</code> combined with a method in an <code>AbstractDatabaseObjectAction</code> should also be implemented using a dedicated <code>RequestHandlerInterface</code>-based controller.
3224 Both <code>AbstractAction</code> and <code>AJAXProxyAction</code>-based AJAX requests should be considered soft-deprecated going forward.</p>
3225 <p>When creating a <code>RequestHandlerInterface</code>-based controller, care should be taken to ensure no mutable state is stored in object properties of the controller itself.
3226 The state of the controller object must be identical before, during and after a request was processed.
3227 Any required values must be passed explicitly by means of method parameters and return values.
3228 Likewise any functionality called by the controller’s <code>handle()</code> method should not rely on implicit global values, such as <code>WCF::getUser()</code>, as was explained in the previous <a href="#request-specific-logic-will-no-longer-happen-during-boot">section about request-specific logic</a>.</p>
3229 <p>The recommended pattern for a <code>RequestHandlerInterface</code>-based controller looks as follows:</p>
3230 <div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">files/lib/action/MyFancyAction.class.php</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
3231 <span class="normal"> 2</span>
3232 <span class="normal"> 3</span>
3233 <span class="normal"> 4</span>
3234 <span class="normal"> 5</span>
3235 <span class="normal"> 6</span>
3236 <span class="normal"> 7</span>
3237 <span class="normal"> 8</span>
3238 <span class="normal"> 9</span>
3239 <span class="normal">10</span>
3240 <span class="normal">11</span>
3241 <span class="normal">12</span>
3242 <span class="normal">13</span>
3243 <span class="normal">14</span>
3244 <span class="normal">15</span>
3245 <span class="normal">16</span>
3246 <span class="normal">17</span>
3247 <span class="normal">18</span>
3248 <span class="normal">19</span>
3249 <span class="normal">20</span>
3250 <span class="normal">21</span>
3251 <span class="normal">22</span>
3252 <span class="normal">23</span>
3253 <span class="normal">24</span>
3254 <span class="normal">25</span>
3255 <span class="normal">26</span>
3256 <span class="normal">27</span>
3257 <span class="normal">28</span>
3258 <span class="normal">29</span>
3259 <span class="normal">30</span>
3260 <span class="normal">31</span>
3261 <span class="normal">32</span>
3262 <span class="normal">33</span>
3263 <span class="normal">34</span>
3264 <span class="normal">35</span>
3265 <span class="normal">36</span>
3266 <span class="normal">37</span>
3267 <span class="normal">38</span>
3268 <span class="normal">39</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
3269
3270 <span class="k">namespace</span> <span class="nx">wcf\action</span><span class="p">;</span>
3271
3272 <span class="k">use</span> <span class="nx">Laminas\Diactoros\Response</span><span class="p">;</span>
3273 <span class="k">use</span> <span class="nx">Psr\Http\Message\ServerRequestInterface</span><span class="p">;</span>
3274 <span class="k">use</span> <span class="nx">Psr\Http\Message\ResponseInterface</span><span class="p">;</span>
3275 <span class="k">use</span> <span class="nx">Psr\Http\Server\RequestHandlerInterface</span><span class="p">;</span>
3276
3277 <span class="k">final</span> <span class="k">class</span> <span class="nc">MyFancyAction</span> <span class="k">implements</span> <span class="nx">RequestHandlerInterface</span>
3278 <span class="p">{</span>
3279 <span class="k">public</span> <span class="k">function</span> <span class="fm">__construct</span><span class="p">()</span>
3280 <span class="p">{</span>
3281 <span class="cm">/* 0. Explicitly register services used by the controller, to</span>
3282 <span class="cm"> * make dependencies explicit and to avoid accidentally using</span>
3283 <span class="cm"> * global state outside of a controller.</span>
3284 <span class="cm"> */</span>
3285 <span class="p">}</span>
3286
3287 <span class="k">public</span> <span class="k">function</span> <span class="nf">handle</span><span class="p">(</span><span class="nx">ServerRequestInterface</span> <span class="nv">$request</span><span class="p">)</span><span class="o">:</span> <span class="nx">ResponseInterface</span>
3288 <span class="p">{</span>
3289 <span class="cm">/* 1. Perform permission checks and input validation. */</span>
3290
3291 <span class="cm">/* 2. Perform the action. The action must not rely on global state,</span>
3292 <span class="cm"> * but instead only on explicitly passed values. It should assume</span>
3293 <span class="cm"> * that permissions have already been validated by the controller,</span>
3294 <span class="cm"> * allowing it to be reusable programmatically.</span>
3295 <span class="cm"> */</span>
3296
3297 <span class="cm">/* 3. Perform post processing. */</span>
3298
3299 <span class="cm">/* 4. Prepare the response, e.g. by querying an updated object from</span>
3300 <span class="cm"> * the database.</span>
3301 <span class="cm"> */</span>
3302
3303 <span class="cm">/* 5. Send the response. */</span>
3304 <span class="k">return</span> <span class="k">new</span> <span class="nx">Response</span><span class="p">();</span>
3305 <span class="p">}</span>
3306 <span class="p">}</span>
3307 </code></pre></div></td></tr></table></div>
3308 <p>It is recommended to leverage <a href="../libraries/#input-validation">Valinor</a> for structural validation of input values if using the <a href="../../../php/api/form_builder/overview/">FormBuilder</a> is not a good fit, specifically for any values that are provided implicitly and are expected to be correct.
3309 WoltLab Suite includes a middleware that will automatically convert unhandled <code>MappingError</code>s into a response with status HTTP 400 Bad Request.</p>
3310 <p>XSRF validation will implicitly be performed for any request that uses a HTTP verb other than <code>GET</code>.
3311 Likewise any requests with a JSON body will automatically be decoded by a middleware and stored as the <code>ServerRequestInterface</code>’s parsed body.</p>
3312 <h4 id="querying-requesthandlerinterface-based-controllers-via-javascript">Querying RequestHandlerInterface-based controllers via JavaScript<a class="headerlink" href="#querying-requesthandlerinterface-based-controllers-via-javascript" title="Permanent link">#</a></h4>
3313 <p>The new <code>WoltLabSuite/Core/Ajax/Backend</code> module may be used to easily query a <code>RequestHandlerInterface</code>-based controller.
3314 The JavaScript code must not make any assumptions about the URI structure to reach the controller.
3315 Instead the endpoint must be generated using <code>LinkHandler</code> and explicitly provided, e.g. by storing it in a <code>data-endpoint</code> attribute:</p>
3316 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3317 <span class="normal">2</span>
3318 <span class="normal">3</span>
3319 <span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="x">&lt;button</span>
3320 <span class="x"> class=&quot;button fancyButton&quot;</span>
3321 <span class="x"> data-endpoint=&quot;</span><span class="cp">{</span><span class="nf">link</span> <span class="na">controller</span><span class="o">=</span><span class="s1">&#39;MyFancy&#39;</span><span class="cp">}{</span><span class="nf">/link</span><span class="cp">}</span><span class="x">&quot;</span>
3322 <span class="x">&gt;Click me!&lt;/button&gt;</span>
3323 </code></pre></div></td></tr></table></div>
3324 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3325 <span class="normal">2</span>
3326 <span class="normal">3</span>
3327 <span class="normal">4</span>
3328 <span class="normal">5</span>
3329 <span class="normal">6</span>
3330 <span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="kd">const</span><span class="w"> </span><span class="nx">button</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">document</span><span class="p">.</span><span class="nx">querySelector</span><span class="p">(</span><span class="s1">&#39;.fancyButton&#39;</span><span class="p">);</span>
3331 <span class="nx">button</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span><span class="s1">&#39;click&#39;</span><span class="p">,</span><span class="w"> </span><span class="k">async</span><span class="w"> </span><span class="p">(</span><span class="nx">event</span><span class="p">)</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="p">{</span>
3332 <span class="w"> </span><span class="kd">const</span><span class="w"> </span><span class="nx">request</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">prepareRequest</span><span class="p">(</span><span class="nx">button</span><span class="p">.</span><span class="nx">dataset</span><span class="p">.</span><span class="nx">endpoint</span><span class="p">)</span>
3333 <span class="w"> </span><span class="p">.</span><span class="nx">get</span><span class="p">();</span><span class="w"> </span><span class="c1">// or: .post(…)</span>
3334
3335 <span class="w"> </span><span class="kd">const</span><span class="w"> </span><span class="nx">response</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">request</span><span class="p">.</span><span class="nx">fetchAsResponse</span><span class="p">();</span><span class="w"> </span><span class="c1">// or: .fetchAsJson()</span>
3336 <span class="p">});</span>
3337 </code></pre></div></td></tr></table></div>
3338 <h4 id="formbuilder">FormBuilder<a class="headerlink" href="#formbuilder" title="Permanent link">#</a></h4>
3339 <p>The <code>Psr15DialogForm</code> class combined with the <code>usingFormBuilder()</code> method of <a href="../dialogs/"><code>dialogFactory()</code></a> provides a “batteries-included” solution to create a AJAX- and <a href="../../../php/api/form_builder/overview/">FormBuilder</a>-based <code>RequestHandlerInterface</code>-based controller.</p>
3340 <p>Within the JavaScript code the endpoint is queried using:</p>
3341 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3342 <span class="normal">2</span>
3343 <span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="kd">const</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">ok</span><span class="p">,</span><span class="w"> </span><span class="nx">result</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">dialogFactory</span><span class="p">()</span>
3344 <span class="w"> </span><span class="p">.</span><span class="nx">usingFormBuilder</span><span class="p">()</span>
3345 <span class="w"> </span><span class="p">.</span><span class="nx">fromEndpoint</span><span class="p">(</span><span class="nx">url</span><span class="p">);</span>
3346 </code></pre></div></td></tr></table></div>
3347 <p>The returned <code>Promise</code> will resolve when the dialog is closed, either by successfully submitting the form or by manually closing it and thus aborting the process.
3348 If the form was submitted successfully <code>ok</code> will be <code>true</code> and <code>result</code> will contain the controller’s response.
3349 If the dialog was closed without successfully submitting the form, <code>ok</code> will be <code>false</code> and <code>result</code> will be set to <code>undefined</code>.</p>
3350 <p>Within the PHP code, the form may be created as usual, but use <code>Psr15DialogForm</code> as the form document.
3351 The controller must return <code>$dialogForm-&gt;toJsonResponse()</code> for <code>GET</code> requests and validate the <code>ServerRequestInterface</code> using <code>$dialogForm-&gt;validateRequest($request)</code> for <code>POST</code> requests.
3352 The latter will return a <code>ResponseInterface</code> to be returned if the validation fails, otherwise <code>null</code> is returned.
3353 If validation succeeded, the controller must perform the resulting action and return a <code>JsonResponse</code> with the <code>result</code> key:</p>
3354 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
3355 <span class="normal"> 2</span>
3356 <span class="normal"> 3</span>
3357 <span class="normal"> 4</span>
3358 <span class="normal"> 5</span>
3359 <span class="normal"> 6</span>
3360 <span class="normal"> 7</span>
3361 <span class="normal"> 8</span>
3362 <span class="normal"> 9</span>
3363 <span class="normal">10</span>
3364 <span class="normal">11</span>
3365 <span class="normal">12</span>
3366 <span class="normal">13</span>
3367 <span class="normal">14</span>
3368 <span class="normal">15</span>
3369 <span class="normal">16</span>
3370 <span class="normal">17</span>
3371 <span class="normal">18</span>
3372 <span class="normal">19</span>
3373 <span class="normal">20</span>
3374 <span class="normal">21</span>
3375 <span class="normal">22</span>
3376 <span class="normal">23</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">if</span> <span class="p">(</span><span class="nv">$request</span><span class="o">-&gt;</span><span class="na">getMethod</span><span class="p">()</span> <span class="o">===</span> <span class="s1">&#39;GET&#39;</span><span class="p">)</span> <span class="p">{</span>
3377 <span class="k">return</span> <span class="nv">$dialogForm</span><span class="o">-&gt;</span><span class="na">toResponse</span><span class="p">();</span>
3378 <span class="p">}</span> <span class="k">elseif</span> <span class="p">(</span><span class="nv">$request</span><span class="o">-&gt;</span><span class="na">getMethod</span><span class="p">()</span> <span class="o">===</span> <span class="s1">&#39;POST&#39;</span><span class="p">)</span> <span class="p">{</span>
3379 <span class="nv">$response</span> <span class="o">=</span> <span class="nv">$dialogForm</span><span class="o">-&gt;</span><span class="na">validateRequest</span><span class="p">(</span><span class="nv">$request</span><span class="p">);</span>
3380 <span class="k">if</span> <span class="p">(</span><span class="nv">$response</span> <span class="o">!==</span> <span class="k">null</span><span class="p">)</span> <span class="p">{</span>
3381 <span class="k">return</span> <span class="nv">$response</span><span class="p">;</span>
3382 <span class="p">}</span>
3383
3384 <span class="nv">$data</span> <span class="o">=</span> <span class="nv">$dialogForm</span><span class="o">-&gt;</span><span class="na">getData</span><span class="p">();</span>
3385
3386 <span class="c1">// Use $data.</span>
3387
3388 <span class="k">return</span> <span class="k">new</span> <span class="nx">JsonResponse</span><span class="p">([</span>
3389 <span class="s1">&#39;result&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span>
3390 <span class="s1">&#39;some&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;value&#39;</span><span class="p">,</span>
3391 <span class="p">],</span>
3392 <span class="p">]);</span>
3393 <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
3394 <span class="c1">// The used method is validated by a middleware. Methods that are not</span>
3395 <span class="c1">// GET or POST need to be explicitly allowed using the &#39;AllowHttpMethod&#39;</span>
3396 <span class="c1">// attribute.</span>
3397 <span class="k">throw</span> <span class="k">new</span> <span class="nx">\LogicException</span><span class="p">(</span><span class="s1">&#39;Unreachable&#39;</span><span class="p">);</span>
3398 <span class="p">}</span>
3399 </code></pre></div></td></tr></table></div>
3400 <h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">#</a></h4>
3401 <p>A complete example, showcasing all the patterns can be found in <a href="https://github.com/WoltLab/WCF/pull/5106">WoltLab/WCF#5106</a>.
3402 This example showcases how to:</p>
3403 <ul>
3404 <li>Store used services within the controller’s constructor.</li>
3405 <li>Perform validation of inputs using Valinor.</li>
3406 <li>Perform permission checks.</li>
3407 <li>Use the FormBuilder.</li>
3408 <li>Delegate the actual processing to a reusable command that does not rely on global state.</li>
3409 <li>Store the request endpoint as a <code>data-*</code> attribute.</li>
3410 </ul>
3411 <h2 id="package-system">Package System<a class="headerlink" href="#package-system" title="Permanent link">#</a></h2>
3412 <h3 id="required-minversion-for-required-packages">Required “minversion” for required packages<a class="headerlink" href="#required-minversion-for-required-packages" title="Permanent link">#</a></h3>
3413 <p>The <code>minversion</code> attribute of the <code>&lt;requiredpackage&gt;</code> tag is now required.</p>
3414 <h3 id="rejection-of-pl-versions">Rejection of “pl” versions<a class="headerlink" href="#rejection-of-pl-versions" title="Permanent link">#</a></h3>
3415 <p>Woltlab Suite 6.0 no longer accepts package versions with the “pl” suffix as valid.</p>
3416 <h3 id="removal-of-api-compatibility">Removal of API compatibility<a class="headerlink" href="#removal-of-api-compatibility" title="Permanent link">#</a></h3>
3417 <p>WoltLab Suite 6.0 removes support for the deprecated API compatibility functionality.
3418 Any packages with a <code>&lt;compatibility&gt;</code> tag in their package.xml are assumed to not have been updated for WoltLab Suite 6.0 and will be rejected during installation.
3419 Furthermore any packages without an explicit requirement for <code>com.woltlab.wcf</code> in at least version <code>5.4.22</code> are also assumed to not have been updated for WoltLab Suite 6.0 and will also be rejected.
3420 The latter check is intended to reject old and most likely incompatible packages where the author forgot to add either an <code>&lt;excludedpackage&gt;</code> or a <code>&lt;compatibility&gt;</code> tag before releasing it.</p>
3421 <h3 id="package-installation-plugins">Package Installation Plugins<a class="headerlink" href="#package-installation-plugins" title="Permanent link">#</a></h3>
3422 <h4 id="eventlistener">EventListener<a class="headerlink" href="#eventlistener" title="Permanent link">#</a></h4>
3423 <p>Installing unnamed event listeners is no longer supported.
3424 The <code>name</code> attribute needs to be specified for all event listeners.</p>
3425 <p>Deleting unnamed event listeners still is possible to allow for a clean migration of existing listeners.</p>
3426 <h4 id="cronjob">Cronjob<a class="headerlink" href="#cronjob" title="Permanent link">#</a></h4>
3427 <p>Installing unnamed cronjobs is no longer supported.
3428 The <code>name</code> attribute needs to be specified for all event listeners.</p>
3429 <p>Deleting unnamed cronjobs still is possible to allow for a clean migration of existing cronjobs.</p>
3430 <p>The cronjob PIP now supports the <code>&lt;expression&gt;</code> element, allowing to define the cronjob schedule using a full expression instead of specifying the five elements separately.</p>
3431 <h4 id="database">Database<a class="headerlink" href="#database" title="Permanent link">#</a></h4>
3432 <p>The <code>$name</code> parameter of <code>DatabaseTableIndex::create()</code> is no longer optional.
3433 Relying on the auto-generated index name is strongly discouraged, because of unfixable inconsistent behavior between the SQL PIP and the PHP DDL API.
3434 See <a href="https://github.com/WoltLab/WCF/issues/4505">WoltLab/WCF#4505</a> for further background information.</p>
3435 <p>The autogenerated name can still be requested by passing an empty string as the <code>$name</code>.
3436 This should only be done for backwards compatibility purposes and to migrate an index with an autogenerated name to an index with an explicit name.
3437 An example script can be found in <a href="https://github.com/WoltLab/com.woltlab.wcf.conversation/commit/a33677ca051f76e1ddda1de7f8dc62a5484de16e">WoltLab/com.woltlab.wcf.conversation@a33677ca051f</a>.</p>
3438 <h2 id="internationalization">Internationalization<a class="headerlink" href="#internationalization" title="Permanent link">#</a></h2>
3439 <p>WoltLab Suite 6.0 <a href="#minimum-requirements">increases the System Requirements</a> to require <a href="https://www.php.net/manual/en/book.intl.php">PHP’s intl extension</a> to be installed and enabled, allowing you to rely on the functionality provided by it to better match the rules and conventions of the different languages and regions of the world.</p>
3440 <p>One example would be the formatting of numbers.
3441 WoltLab Suite included a feature to group digits within large numbers since early versions using the <code>StringUtil::addThousandsSeparator()</code> method.
3442 While this method was able to account for <em>some</em> language-specific differences, e.g. by selecting an appropriate separator character based on a phrase, it failed to account for all the differences in number formatting across countries and cultures.</p>
3443 <p>As an example, English as written in the United States of America uses commas to create groups of three digits within large numbers: 123,456,789.
3444 English as written in India on the other hand also uses commas, but digits are not grouped into groups of three.
3445 Instead the right-most three digits form a group and then another comma is added every <em>two</em> digits: 12,34,56,789.</p>
3446 <p>Another example would be German as used within Germany and Switzerland.
3447 While both countries use groups of three, the separator character differs.
3448 Germany uses a dot (123.456.789), whereas Switzerland uses an apostrophe (123456789).
3449 The correct choice of separator could already be configured using the afore-mentioned phrase, but this is both inconvenient and fails to account for other differences between the two countries.
3450 It also made it hard to keep the behavior up to date when rules change.</p>
3451 <p>PHP’s intl extension on the other hand builds on the official Unicode rules, by relying on the ICU library published by the Unicode consortium.
3452 As such it is aware of the rules of all relevant languages and regions of the world and it is already kept up to date by the operating system’s package manager.</p>
3453 <p>For the four example regions (en_US, en_IN, de_DE, de_CH) intl’s <code>NumberFormatter</code> class will format the number 123456789 as follows, correctly implementing the rules:</p>
3454 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3455 <span class="normal">2</span>
3456 <span class="normal">3</span>
3457 <span class="normal">4</span>
3458 <span class="normal">5</span>
3459 <span class="normal">6</span>
3460 <span class="normal">7</span>
3461 <span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span><code>php &gt; var_dump((new NumberFormatter(&#39;en_US&#39;, \NumberFormatter::DEFAULT_STYLE))-&gt;format(123_456_789));
3462 string(11) &quot;123,456,789&quot;
3463 php &gt; var_dump((new NumberFormatter(&#39;en_IN&#39;, \NumberFormatter::DEFAULT_STYLE))-&gt;format(123_456_789));
3464 string(12) &quot;12,34,56,789&quot;
3465 php &gt; var_dump((new NumberFormatter(&#39;de_DE&#39;, \NumberFormatter::DEFAULT_STYLE))-&gt;format(123_456_789));
3466 string(11) &quot;123.456.789&quot;
3467 php &gt; var_dump((new NumberFormatter(&#39;de_CH&#39;, \NumberFormatter::DEFAULT_STYLE))-&gt;format(123_456_789));
3468 string(15) &quot;123456789&quot;
3469 </code></pre></div></td></tr></table></div>
3470 <p>WoltLab Suite’s <code>StringUtil::formatNumeric()</code> method is updated to leverage the <code>NumberFormatter</code> internally.
3471 However your package might have special requirements regarding formatting, for example when formatting currencies where the position of the currency symbol differs across languages.
3472 In those cases your package should manually create an appropriately configured class from Intl’s feature set.
3473 The correct locale can be queried by the new <code>Language::getLocale()</code> method.</p>
3474 <p>Another use case that showcases the <code>Language::getLocale()</code> method might be localizing a country name using <a href="https://www.php.net/manual/en/locale.getdisplayregion.php"><code>locale_get_display_region()</code></a>:</p>
3475 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
3476 <span class="normal"> 2</span>
3477 <span class="normal"> 3</span>
3478 <span class="normal"> 4</span>
3479 <span class="normal"> 5</span>
3480 <span class="normal"> 6</span>
3481 <span class="normal"> 7</span>
3482 <span class="normal"> 8</span>
3483 <span class="normal"> 9</span>
3484 <span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span><code>php &gt; var_dump(\wcf\system\WCF::getLanguage()-&gt;getLocale());
3485 string(5) &quot;en_US&quot;
3486 php &gt; var_dump(locale_get_display_region(&#39;_DE&#39;, \wcf\system\WCF::getLanguage()-&gt;getLocale()));
3487 string(7) &quot;Germany&quot;
3488 php &gt; var_dump(locale_get_display_region(&#39;_US&#39;, \wcf\system\WCF::getLanguage()-&gt;getLocale()));
3489 string(13) &quot;United States&quot;
3490 php &gt; var_dump(locale_get_display_region(&#39;_IN&#39;, \wcf\system\WCF::getLanguage()-&gt;getLocale()));
3491 string(5) &quot;India&quot;
3492 php &gt; var_dump(locale_get_display_region(&#39;_BR&#39;, \wcf\system\WCF::getLanguage()-&gt;getLocale()));
3493 string(6) &quot;Brazil&quot;
3494 </code></pre></div></td></tr></table></div>
3495 <p>See <a href="https://github.com/WoltLab/WCF/pull/5048">WoltLab/WCF#5048</a> for details.</p>
3496 <h2 id="indicating-parameters-that-hold-sensitive-information">Indicating parameters that hold sensitive information<a class="headerlink" href="#indicating-parameters-that-hold-sensitive-information" title="Permanent link">#</a></h2>
3497 <p>PHP 8.2 adds native support for redacting parameters holding sensitive information in stack traces.
3498 Parameters with the <code>#[\SensitiveParameter]</code> attribute will show a placeholder value within the stack trace and the error log.</p>
3499 <p>WoltLab Suite’s exception handler contains logic to manually apply the sanitization for PHP versions before 8.2.</p>
3500 <p>It is strongly recommended to add this attribute to all parameters holding sensitive information.
3501 Examples for sensitive parameters include passwords/passphrases, access tokens, plaintext values to be encrypted, or private keys.</p>
3502 <p>As attributes are fully backwards and forwards compatible it is possible to apply the attribute to packages targeting older WoltLab Suite or PHP versions without causing errors.</p>
3503 <p>Example:</p>
3504 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3505 <span class="normal">2</span>
3506 <span class="normal">3</span>
3507 <span class="normal">4</span>
3508 <span class="normal">5</span>
3509 <span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">function</span> <span class="nf">checkPassword</span><span class="p">(</span>
3510 <span class="p">#[</span><span class="nd">\SensitiveParameter</span><span class="p">]</span>
3511 <span class="nv">$password</span><span class="p">,</span>
3512 <span class="p">)</span><span class="o">:</span> <span class="nx">bool</span> <span class="p">{</span>
3513 <span class="c1">// …</span>
3514 <span class="p">}</span>
3515 </code></pre></div></td></tr></table></div>
3516 <p>See the <a href="https://wiki.php.net/rfc/redact_parameters_in_back_traces">PHP RFC: Redacting parameters in back traces</a> for more details.</p>
3517 <h2 id="conditions">Conditions<a class="headerlink" href="#conditions" title="Permanent link">#</a></h2>
3518 <h3 id="abstractintegercondition">AbstractIntegerCondition<a class="headerlink" href="#abstractintegercondition" title="Permanent link">#</a></h3>
3519 <p>Deriving from <code>AbstractIntegerCondition</code> now requires to explicitly implement <code>protected function getIdentifier(): string</code>, instead of setting the <code>$identifier</code> property.
3520 This is to ensure that all conditions specify a unique identifier, instead of accidentally relying on a default value.
3521 The <code>$identifier</code> property will no longer be used and may be removed.</p>
3522 <p>See <a href="https://github.com/WoltLab/WCF/pull/5077">WoltLab/WCF#5077</a> for details.</p>
3523 <h2 id="rebuild-workers">Rebuild Workers<a class="headerlink" href="#rebuild-workers" title="Permanent link">#</a></h2>
3524 <p>Rebuild workers should no longer be registered using the <code>com.woltlab.wcf.rebuildData</code> object type definition.
3525 You can attach an event listener to the <code>wcf\system\worker\event\RebuildWorkerCollecting</code> event inside a <a href="#bootstrap-scripts">bootstrap script</a> to lazily register workers.
3526 The class name of the worker is registered using the event’s <code>register()</code> method:</p>
3527 <div class="highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">files/lib/bootstrap/com.example.bar.php</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
3528 <span class="normal"> 2</span>
3529 <span class="normal"> 3</span>
3530 <span class="normal"> 4</span>
3531 <span class="normal"> 5</span>
3532 <span class="normal"> 6</span>
3533 <span class="normal"> 7</span>
3534 <span class="normal"> 8</span>
3535 <span class="normal"> 9</span>
3536 <span class="normal">10</span>
3537 <span class="normal">11</span>
3538 <span class="normal">12</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
3539
3540 <span class="k">use</span> <span class="nx">wcf\system\event\EventHandler</span><span class="p">;</span>
3541 <span class="k">use</span> <span class="nx">wcf\system\worker\event\RebuildWorkerCollecting</span><span class="p">;</span>
3542
3543 <span class="k">return</span> <span class="k">static</span> <span class="k">function</span> <span class="p">()</span><span class="o">:</span> <span class="nx">void</span> <span class="p">{</span>
3544 <span class="nv">$eventHandler</span> <span class="o">=</span> <span class="nx">EventHandler</span><span class="o">::</span><span class="na">getInstance</span><span class="p">();</span>
3545
3546 <span class="nv">$eventHandler</span><span class="o">-&gt;</span><span class="na">register</span><span class="p">(</span><span class="nx">RebuildWorkerCollecting</span><span class="o">::</span><span class="na">class</span><span class="p">,</span> <span class="k">static</span> <span class="k">function</span> <span class="p">(</span><span class="nx">RebuildWorkerCollecting</span> <span class="nv">$event</span><span class="p">)</span> <span class="p">{</span>
3547 <span class="nv">$event</span><span class="o">-&gt;</span><span class="na">register</span><span class="p">(</span><span class="nx">\bar\system\worker\BazWorker</span><span class="o">::</span><span class="na">class</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
3548 <span class="p">});</span>
3549 <span class="p">};</span>
3550 </code></pre></div></td></tr></table></div>
3551
3552 <hr>
3553 <div class="md-source-file">
3554 <small>
3555
3556 Last update:
3557 2023-02-24
3558
3559 </small>
3560 </div>
3561
3562
3563
3564
3565
3566
3567 </article>
3568 </div>
3569
3570
3571 </div>
3572
3573 </main>
3574
3575 <footer class="md-footer">
3576
3577 <div class="md-footer-meta md-typeset">
3578 <div class="md-footer-meta__inner md-grid">
3579 <div class="md-copyright">
3580
3581 <div class="md-copyright__highlight">
3582 Copyright © 2020 WoltLab GmbH
3583 </div>
3584
3585
3586 Made with
3587 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
3588 Material for MkDocs
3589 </a>
3590
3591 </div>
3592
3593 <div class="md-copyright">
3594 <a href="https://www.woltlab.com/legal-notice/">Legal Notice</a>
3595 <a href="https://www.woltlab.com/privacy-policy/">Privacy Policy</a>
3596 </div>
3597
3598 </div>
3599 </div>
3600 </footer>
3601
3602 </div>
3603 <div class="md-dialog" data-md-component="dialog">
3604 <div class="md-dialog__inner md-typeset"></div>
3605 </div>
3606
3607 <script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.tracking"], "search": "../../../assets/javascripts/workers/search.208ed371.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script>
3608
3609
3610 <script src="../../../assets/javascripts/bundle.407015b8.min.js"></script>
3611
3612
3613 </body>
3614 </html>