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