Deployed 2f13e501 to 6.0 with MkDocs 1.4.3 and mike 1.1.2
[GitHub/WoltLab/woltlab.github.io.git] / 6.0 / migration / wsc55 / php / index.html
1
2 <!doctype html>
3 <html lang="en" class="no-js">
4 <head>
5
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width,initial-scale=1">
8
9
10
11 <link rel="canonical" href="https://docs.woltlab.com/6.0/migration/wsc55/php/">
12
13
14 <link rel="prev" href="../../../package/database-php-api/">
15
16
17 <link rel="next" href="../javascript/">
18
19 <link rel="icon" href="../../../assets/default.favicon.ico">
20 <meta name="generator" content="mkdocs-1.4.3, mkdocs-material-9.1.15">
21
22
23
24 <title>PHP API - WoltLab Suite Documentation</title>
25
26
27
28 <link rel="stylesheet" href="../../../assets/stylesheets/main.26e3688c.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_confirmation/" class="md-nav__link">
875 Confirmation
876 </a>
877 </li>
878
879
880
881
882
883
884
885
886
887 <li class="md-nav__item">
888 <a href="../../../javascript/components_dialog/" class="md-nav__link">
889 Dialog
890 </a>
891 </li>
892
893
894
895
896
897
898
899
900
901 <li class="md-nav__item">
902 <a href="../../../javascript/components_google_maps/" class="md-nav__link">
903 Google Maps
904 </a>
905 </li>
906
907
908
909
910
911
912
913
914
915 <li class="md-nav__item">
916 <a href="../../../javascript/components_pagination/" class="md-nav__link">
917 Pagination
918 </a>
919 </li>
920
921
922
923
924 </ul>
925 </nav>
926 </li>
927
928
929
930
931
932
933
934
935
936
937 <li class="md-nav__item md-nav__item--nested">
938
939
940
941
942 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_4" >
943
944
945
946 <label class="md-nav__link" for="__nav_4_4" id="__nav_4_4_label" tabindex="0">
947 New API
948 <span class="md-nav__icon md-icon"></span>
949 </label>
950
951 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_4_label" aria-expanded="false">
952 <label class="md-nav__title" for="__nav_4_4">
953 <span class="md-nav__icon md-icon"></span>
954 New API
955 </label>
956 <ul class="md-nav__list" data-md-scrollfix>
957
958
959
960
961
962
963 <li class="md-nav__item">
964 <a href="../../../javascript/new-api_writing-a-module/" class="md-nav__link">
965 Writing a module
966 </a>
967 </li>
968
969
970
971
972
973
974
975
976
977 <li class="md-nav__item">
978 <a href="../../../javascript/new-api_core/" class="md-nav__link">
979 Core Functions
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_dom/" class="md-nav__link">
993 DOM
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_events/" class="md-nav__link">
1007 Event Handling
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_ajax/" class="md-nav__link">
1021 Ajax
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_dialogs/" class="md-nav__link">
1035 Dialogs
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_browser/" class="md-nav__link">
1049 Browser and Screen Sizes
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_ui/" class="md-nav__link">
1063 User Interface
1064 </a>
1065 </li>
1066
1067
1068
1069
1070 </ul>
1071 </nav>
1072 </li>
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082 <li class="md-nav__item">
1083 <a href="../../../javascript/legacy-api/" class="md-nav__link">
1084 Legacy API
1085 </a>
1086 </li>
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096 <li class="md-nav__item">
1097 <a href="../../../javascript/code-snippets/" class="md-nav__link">
1098 Code Snippets
1099 </a>
1100 </li>
1101
1102
1103
1104
1105 </ul>
1106 </nav>
1107 </li>
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119 <li class="md-nav__item md-nav__item--nested">
1120
1121
1122
1123
1124 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
1125
1126
1127
1128 <label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
1129 Package Components
1130 <span class="md-nav__icon md-icon"></span>
1131 </label>
1132
1133 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
1134 <label class="md-nav__title" for="__nav_5">
1135 <span class="md-nav__icon md-icon"></span>
1136 Package Components
1137 </label>
1138 <ul class="md-nav__list" data-md-scrollfix>
1139
1140
1141
1142
1143
1144
1145 <li class="md-nav__item">
1146 <a href="../../../package/package-xml/" class="md-nav__link">
1147 package.xml
1148 </a>
1149 </li>
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160 <li class="md-nav__item md-nav__item--nested">
1161
1162
1163
1164
1165 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_2" >
1166
1167
1168
1169 <label class="md-nav__link" for="__nav_5_2" id="__nav_5_2_label" tabindex="0">
1170 PIPs
1171 <span class="md-nav__icon md-icon"></span>
1172 </label>
1173
1174 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_2_label" aria-expanded="false">
1175 <label class="md-nav__title" for="__nav_5_2">
1176 <span class="md-nav__icon md-icon"></span>
1177 PIPs
1178 </label>
1179 <ul class="md-nav__list" data-md-scrollfix>
1180
1181
1182
1183
1184
1185
1186 <li class="md-nav__item">
1187 <a href="../../../package/pip/" class="md-nav__link">
1188 Overview
1189 </a>
1190 </li>
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200 <li class="md-nav__item">
1201 <a href="../../../package/pip/acl-option/" class="md-nav__link">
1202 aclOption
1203 </a>
1204 </li>
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214 <li class="md-nav__item">
1215 <a href="../../../package/pip/acp-menu/" class="md-nav__link">
1216 acpMenu
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-search-provider/" class="md-nav__link">
1230 acpSearchProvider
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-template/" class="md-nav__link">
1244 acpTemplate
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-delete/" class="md-nav__link">
1258 acpTemplateDelete
1259 </a>
1260 </li>
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270 <li class="md-nav__item">
1271 <a href="../../../package/pip/bbcode/" class="md-nav__link">
1272 bbcode
1273 </a>
1274 </li>
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284 <li class="md-nav__item">
1285 <a href="../../../package/pip/box/" class="md-nav__link">
1286 box
1287 </a>
1288 </li>
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298 <li class="md-nav__item">
1299 <a href="../../../package/pip/clipboard-action/" class="md-nav__link">
1300 clipboardAction
1301 </a>
1302 </li>
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312 <li class="md-nav__item">
1313 <a href="../../../package/pip/core-object/" class="md-nav__link">
1314 coreObject
1315 </a>
1316 </li>
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326 <li class="md-nav__item">
1327 <a href="../../../package/pip/cronjob/" class="md-nav__link">
1328 cronjob
1329 </a>
1330 </li>
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340 <li class="md-nav__item">
1341 <a href="../../../package/pip/database/" class="md-nav__link">
1342 database
1343 </a>
1344 </li>
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354 <li class="md-nav__item">
1355 <a href="../../../package/pip/event-listener/" class="md-nav__link">
1356 eventListener
1357 </a>
1358 </li>
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368 <li class="md-nav__item">
1369 <a href="../../../package/pip/file/" class="md-nav__link">
1370 file
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-delete/" class="md-nav__link">
1384 fileDelete
1385 </a>
1386 </li>
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396 <li class="md-nav__item">
1397 <a href="../../../package/pip/language/" class="md-nav__link">
1398 language
1399 </a>
1400 </li>
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410 <li class="md-nav__item">
1411 <a href="../../../package/pip/media-provider/" class="md-nav__link">
1412 mediaProvider
1413 </a>
1414 </li>
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424 <li class="md-nav__item">
1425 <a href="../../../package/pip/menu/" class="md-nav__link">
1426 menu
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-item/" class="md-nav__link">
1440 menuItem
1441 </a>
1442 </li>
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452 <li class="md-nav__item">
1453 <a href="../../../package/pip/object-type/" class="md-nav__link">
1454 objectType
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-definition/" class="md-nav__link">
1468 objectTypeDefinition
1469 </a>
1470 </li>
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480 <li class="md-nav__item">
1481 <a href="../../../package/pip/option/" class="md-nav__link">
1482 option
1483 </a>
1484 </li>
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494 <li class="md-nav__item">
1495 <a href="../../../package/pip/page/" class="md-nav__link">
1496 page
1497 </a>
1498 </li>
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508 <li class="md-nav__item">
1509 <a href="../../../package/pip/pip/" class="md-nav__link">
1510 pip
1511 </a>
1512 </li>
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522 <li class="md-nav__item">
1523 <a href="../../../package/pip/script/" class="md-nav__link">
1524 script
1525 </a>
1526 </li>
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536 <li class="md-nav__item">
1537 <a href="../../../package/pip/smiley/" class="md-nav__link">
1538 smiley
1539 </a>
1540 </li>
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550 <li class="md-nav__item">
1551 <a href="../../../package/pip/sql/" class="md-nav__link">
1552 sql
1553 </a>
1554 </li>
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564 <li class="md-nav__item">
1565 <a href="../../../package/pip/style/" class="md-nav__link">
1566 style
1567 </a>
1568 </li>
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578 <li class="md-nav__item">
1579 <a href="../../../package/pip/template/" class="md-nav__link">
1580 template
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-delete/" class="md-nav__link">
1594 templateDelete
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-listener/" class="md-nav__link">
1608 templateListener
1609 </a>
1610 </li>
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620 <li class="md-nav__item">
1621 <a href="../../../package/pip/user-group-option/" class="md-nav__link">
1622 userGroupOption
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-menu/" class="md-nav__link">
1636 userMenu
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-notification-event/" class="md-nav__link">
1650 userNotificationEvent
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-option/" class="md-nav__link">
1664 userOption
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-profile-menu/" class="md-nav__link">
1678 userProfileMenu
1679 </a>
1680 </li>
1681
1682
1683
1684
1685 </ul>
1686 </nav>
1687 </li>
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697 <li class="md-nav__item">
1698 <a href="../../../package/database-php-api/" class="md-nav__link">
1699 Database PHP API
1700 </a>
1701 </li>
1702
1703
1704
1705
1706 </ul>
1707 </nav>
1708 </li>
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
1723
1724
1725
1726
1727 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" checked>
1728
1729
1730
1731 <label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
1732 Migration
1733 <span class="md-nav__icon md-icon"></span>
1734 </label>
1735
1736 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="true">
1737 <label class="md-nav__title" for="__nav_6">
1738 <span class="md-nav__icon md-icon"></span>
1739 Migration
1740 </label>
1741 <ul class="md-nav__list" data-md-scrollfix>
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
1752
1753
1754
1755
1756 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_1" checked>
1757
1758
1759
1760 <label class="md-nav__link" for="__nav_6_1" id="__nav_6_1_label" tabindex="0">
1761 From WoltLab Suite 5.5
1762 <span class="md-nav__icon md-icon"></span>
1763 </label>
1764
1765 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_1_label" aria-expanded="true">
1766 <label class="md-nav__title" for="__nav_6_1">
1767 <span class="md-nav__icon md-icon"></span>
1768 From WoltLab Suite 5.5
1769 </label>
1770 <ul class="md-nav__list" data-md-scrollfix>
1771
1772
1773
1774
1775
1776
1777
1778
1779 <li class="md-nav__item md-nav__item--active">
1780
1781 <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
1782
1783
1784
1785
1786
1787 <label class="md-nav__link md-nav__link--active" for="__toc">
1788 PHP API
1789 <span class="md-nav__icon md-icon"></span>
1790 </label>
1791
1792 <a href="./" class="md-nav__link md-nav__link--active">
1793 PHP API
1794 </a>
1795
1796
1797
1798 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
1799
1800
1801
1802
1803
1804
1805 <label class="md-nav__title" for="__toc">
1806 <span class="md-nav__icon md-icon"></span>
1807 Table of contents
1808 </label>
1809 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
1810
1811 <li class="md-nav__item">
1812 <a href="#minimum-requirements" class="md-nav__link">
1813 Minimum requirements
1814 </a>
1815
1816 </li>
1817
1818 <li class="md-nav__item">
1819 <a href="#inheritance" class="md-nav__link">
1820 Inheritance
1821 </a>
1822
1823 <nav class="md-nav" aria-label="Inheritance">
1824 <ul class="md-nav__list">
1825
1826 <li class="md-nav__item">
1827 <a href="#parameter-return-property-types" class="md-nav__link">
1828 Parameter / Return / Property Types
1829 </a>
1830
1831 </li>
1832
1833 <li class="md-nav__item">
1834 <a href="#final" class="md-nav__link">
1835 final
1836 </a>
1837
1838 </li>
1839
1840 </ul>
1841 </nav>
1842
1843 </li>
1844
1845 <li class="md-nav__item">
1846 <a href="#application-boot" class="md-nav__link">
1847 Application Boot
1848 </a>
1849
1850 <nav class="md-nav" aria-label="Application Boot">
1851 <ul class="md-nav__list">
1852
1853 <li class="md-nav__item">
1854 <a href="#request-specific-logic-will-no-longer-happen-during-boot" class="md-nav__link">
1855 Request-specific logic will no longer happen during boot
1856 </a>
1857
1858 </li>
1859
1860 <li class="md-nav__item">
1861 <a href="#bootstrap-scripts" class="md-nav__link">
1862 Bootstrap Scripts
1863 </a>
1864
1865 <nav class="md-nav" aria-label="Bootstrap Scripts">
1866 <ul class="md-nav__list">
1867
1868 <li class="md-nav__item">
1869 <a href="#registering-ievent-listeners" class="md-nav__link">
1870 Registering IEvent listeners
1871 </a>
1872
1873 </li>
1874
1875 </ul>
1876 </nav>
1877
1878 </li>
1879
1880 </ul>
1881 </nav>
1882
1883 </li>
1884
1885 <li class="md-nav__item">
1886 <a href="#request-processing" class="md-nav__link">
1887 Request Processing
1888 </a>
1889
1890 <nav class="md-nav" aria-label="Request Processing">
1891 <ul class="md-nav__list">
1892
1893 <li class="md-nav__item">
1894 <a href="#recommended-changes-for-woltlab-suite-60" class="md-nav__link">
1895 Recommended changes for WoltLab Suite 6.0
1896 </a>
1897
1898 <nav class="md-nav" aria-label="Recommended changes for WoltLab Suite 6.0">
1899 <ul class="md-nav__list">
1900
1901 <li class="md-nav__item">
1902 <a href="#querying-requesthandlerinterface-based-controllers-via-javascript" class="md-nav__link">
1903 Querying RequestHandlerInterface-based controllers via JavaScript
1904 </a>
1905
1906 </li>
1907
1908 <li class="md-nav__item">
1909 <a href="#formbuilder" class="md-nav__link">
1910 FormBuilder
1911 </a>
1912
1913 </li>
1914
1915 <li class="md-nav__item">
1916 <a href="#example" class="md-nav__link">
1917 Example
1918 </a>
1919
1920 </li>
1921
1922 </ul>
1923 </nav>
1924
1925 </li>
1926
1927 </ul>
1928 </nav>
1929
1930 </li>
1931
1932 <li class="md-nav__item">
1933 <a href="#package-system" class="md-nav__link">
1934 Package System
1935 </a>
1936
1937 <nav class="md-nav" aria-label="Package System">
1938 <ul class="md-nav__list">
1939
1940 <li class="md-nav__item">
1941 <a href="#required-minversion-for-required-packages" class="md-nav__link">
1942 Required “minversion” for required packages
1943 </a>
1944
1945 </li>
1946
1947 <li class="md-nav__item">
1948 <a href="#rejection-of-pl-versions" class="md-nav__link">
1949 Rejection of “pl” versions
1950 </a>
1951
1952 </li>
1953
1954 <li class="md-nav__item">
1955 <a href="#removal-of-api-compatibility" class="md-nav__link">
1956 Removal of API compatibility
1957 </a>
1958
1959 </li>
1960
1961 <li class="md-nav__item">
1962 <a href="#package-installation-plugins" class="md-nav__link">
1963 Package Installation Plugins
1964 </a>
1965
1966 <nav class="md-nav" aria-label="Package Installation Plugins">
1967 <ul class="md-nav__list">
1968
1969 <li class="md-nav__item">
1970 <a href="#eventlistener" class="md-nav__link">
1971 EventListener
1972 </a>
1973
1974 </li>
1975
1976 <li class="md-nav__item">
1977 <a href="#cronjob" class="md-nav__link">
1978 Cronjob
1979 </a>
1980
1981 </li>
1982
1983 <li class="md-nav__item">
1984 <a href="#database" class="md-nav__link">
1985 Database
1986 </a>
1987
1988 </li>
1989
1990 </ul>
1991 </nav>
1992
1993 </li>
1994
1995 </ul>
1996 </nav>
1997
1998 </li>
1999
2000 <li class="md-nav__item">
2001 <a href="#internationalization" class="md-nav__link">
2002 Internationalization
2003 </a>
2004
2005 </li>
2006
2007 <li class="md-nav__item">
2008 <a href="#indicating-parameters-that-hold-sensitive-information" class="md-nav__link">
2009 Indicating parameters that hold sensitive information
2010 </a>
2011
2012 </li>
2013
2014 <li class="md-nav__item">
2015 <a href="#conditions" class="md-nav__link">
2016 Conditions
2017 </a>
2018
2019 <nav class="md-nav" aria-label="Conditions">
2020 <ul class="md-nav__list">
2021
2022 <li class="md-nav__item">
2023 <a href="#abstractintegercondition" class="md-nav__link">
2024 AbstractIntegerCondition
2025 </a>
2026
2027 </li>
2028
2029 </ul>
2030 </nav>
2031
2032 </li>
2033
2034 <li class="md-nav__item">
2035 <a href="#rebuild-workers" class="md-nav__link">
2036 Rebuild Workers
2037 </a>
2038
2039 </li>
2040
2041 </ul>
2042
2043 </nav>
2044
2045 </li>
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055 <li class="md-nav__item">
2056 <a href="../javascript/" class="md-nav__link">
2057 TypeScript and JavaScript
2058 </a>
2059 </li>
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069 <li class="md-nav__item">
2070 <a href="../templates/" class="md-nav__link">
2071 Templates
2072 </a>
2073 </li>
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083 <li class="md-nav__item">
2084 <a href="../icons/" class="md-nav__link">
2085 Icons
2086 </a>
2087 </li>
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097 <li class="md-nav__item">
2098 <a href="../dialogs/" class="md-nav__link">
2099 Dialogs
2100 </a>
2101 </li>
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111 <li class="md-nav__item">
2112 <a href="../libraries/" class="md-nav__link">
2113 Third Party Libraries
2114 </a>
2115 </li>
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125 <li class="md-nav__item">
2126 <a href="../deprecations_removals/" class="md-nav__link">
2127 Deprecations and Removals
2128 </a>
2129 </li>
2130
2131
2132
2133
2134 </ul>
2135 </nav>
2136 </li>
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147 <li class="md-nav__item md-nav__item--nested">
2148
2149
2150
2151
2152 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_2" >
2153
2154
2155
2156 <label class="md-nav__link" for="__nav_6_2" id="__nav_6_2_label" tabindex="0">
2157 From WoltLab Suite 5.4
2158 <span class="md-nav__icon md-icon"></span>
2159 </label>
2160
2161 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_2_label" aria-expanded="false">
2162 <label class="md-nav__title" for="__nav_6_2">
2163 <span class="md-nav__icon md-icon"></span>
2164 From WoltLab Suite 5.4
2165 </label>
2166 <ul class="md-nav__list" data-md-scrollfix>
2167
2168
2169
2170
2171
2172
2173 <li class="md-nav__item">
2174 <a href="../../wsc54/php/" class="md-nav__link">
2175 PHP API
2176 </a>
2177 </li>
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187 <li class="md-nav__item">
2188 <a href="../../wsc54/javascript/" class="md-nav__link">
2189 TypeScript and JavaScript
2190 </a>
2191 </li>
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201 <li class="md-nav__item">
2202 <a href="../../wsc54/templates/" class="md-nav__link">
2203 Templates
2204 </a>
2205 </li>
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215 <li class="md-nav__item">
2216 <a href="../../wsc54/libraries/" class="md-nav__link">
2217 Third Party Libraries
2218 </a>
2219 </li>
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229 <li class="md-nav__item">
2230 <a href="../../wsc54/deprecations_removals/" class="md-nav__link">
2231 Deprecations and Removals
2232 </a>
2233 </li>
2234
2235
2236
2237
2238 </ul>
2239 </nav>
2240 </li>
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251 <li class="md-nav__item md-nav__item--nested">
2252
2253
2254
2255
2256 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_3" >
2257
2258
2259
2260 <label class="md-nav__link" for="__nav_6_3" id="__nav_6_3_label" tabindex="0">
2261 From WoltLab Suite 5.3
2262 <span class="md-nav__icon md-icon"></span>
2263 </label>
2264
2265 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_3_label" aria-expanded="false">
2266 <label class="md-nav__title" for="__nav_6_3">
2267 <span class="md-nav__icon md-icon"></span>
2268 From WoltLab Suite 5.3
2269 </label>
2270 <ul class="md-nav__list" data-md-scrollfix>
2271
2272
2273
2274
2275
2276
2277 <li class="md-nav__item">
2278 <a href="../../wsc53/php/" class="md-nav__link">
2279 PHP API
2280 </a>
2281 </li>
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291 <li class="md-nav__item">
2292 <a href="../../wsc53/session/" class="md-nav__link">
2293 Session Handling and Authentication
2294 </a>
2295 </li>
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305 <li class="md-nav__item">
2306 <a href="../../wsc53/javascript/" class="md-nav__link">
2307 TypeScript and JavaScript
2308 </a>
2309 </li>
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319 <li class="md-nav__item">
2320 <a href="../../wsc53/templates/" class="md-nav__link">
2321 Templates
2322 </a>
2323 </li>
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333 <li class="md-nav__item">
2334 <a href="../../wsc53/libraries/" class="md-nav__link">
2335 Third Party Libraries
2336 </a>
2337 </li>
2338
2339
2340
2341
2342 </ul>
2343 </nav>
2344 </li>
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355 <li class="md-nav__item md-nav__item--nested">
2356
2357
2358
2359
2360 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_4" >
2361
2362
2363
2364 <label class="md-nav__link" for="__nav_6_4" id="__nav_6_4_label" tabindex="0">
2365 From WoltLab Suite 5.2
2366 <span class="md-nav__icon md-icon"></span>
2367 </label>
2368
2369 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_4_label" aria-expanded="false">
2370 <label class="md-nav__title" for="__nav_6_4">
2371 <span class="md-nav__icon md-icon"></span>
2372 From WoltLab Suite 5.2
2373 </label>
2374 <ul class="md-nav__list" data-md-scrollfix>
2375
2376
2377
2378
2379
2380
2381 <li class="md-nav__item">
2382 <a href="../../wsc52/php/" class="md-nav__link">
2383 PHP API
2384 </a>
2385 </li>
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395 <li class="md-nav__item">
2396 <a href="../../wsc52/templates/" class="md-nav__link">
2397 Templates and Languages
2398 </a>
2399 </li>
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409 <li class="md-nav__item">
2410 <a href="../../wsc52/libraries/" class="md-nav__link">
2411 Third Party Libraries
2412 </a>
2413 </li>
2414
2415
2416
2417
2418 </ul>
2419 </nav>
2420 </li>
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431 <li class="md-nav__item md-nav__item--nested">
2432
2433
2434
2435
2436 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_5" >
2437
2438
2439
2440 <label class="md-nav__link" for="__nav_6_5" id="__nav_6_5_label" tabindex="0">
2441 From WoltLab Suite 3.1
2442 <span class="md-nav__icon md-icon"></span>
2443 </label>
2444
2445 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_5_label" aria-expanded="false">
2446 <label class="md-nav__title" for="__nav_6_5">
2447 <span class="md-nav__icon md-icon"></span>
2448 From WoltLab Suite 3.1
2449 </label>
2450 <ul class="md-nav__list" data-md-scrollfix>
2451
2452
2453
2454
2455
2456
2457 <li class="md-nav__item">
2458 <a href="../../wsc31/php/" class="md-nav__link">
2459 PHP API
2460 </a>
2461 </li>
2462
2463
2464
2465
2466 </ul>
2467 </nav>
2468 </li>
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479 <li class="md-nav__item md-nav__item--nested">
2480
2481
2482
2483
2484 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_6" >
2485
2486
2487
2488 <label class="md-nav__link" for="__nav_6_6" id="__nav_6_6_label" tabindex="0">
2489 From WoltLab Suite 3.0
2490 <span class="md-nav__icon md-icon"></span>
2491 </label>
2492
2493 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_6_label" aria-expanded="false">
2494 <label class="md-nav__title" for="__nav_6_6">
2495 <span class="md-nav__icon md-icon"></span>
2496 From WoltLab Suite 3.0
2497 </label>
2498 <ul class="md-nav__list" data-md-scrollfix>
2499
2500
2501
2502
2503
2504
2505 <li class="md-nav__item">
2506 <a href="../../wsc30/php/" class="md-nav__link">
2507 PHP API
2508 </a>
2509 </li>
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519 <li class="md-nav__item">
2520 <a href="../../wsc30/javascript/" class="md-nav__link">
2521 JavaScript API
2522 </a>
2523 </li>
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533 <li class="md-nav__item">
2534 <a href="../../wsc30/templates/" class="md-nav__link">
2535 Templates
2536 </a>
2537 </li>
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547 <li class="md-nav__item">
2548 <a href="../../wsc30/css/" class="md-nav__link">
2549 CSS
2550 </a>
2551 </li>
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561 <li class="md-nav__item">
2562 <a href="../../wsc30/package/" class="md-nav__link">
2563 Package Components
2564 </a>
2565 </li>
2566
2567
2568
2569
2570 </ul>
2571 </nav>
2572 </li>
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583 <li class="md-nav__item md-nav__item--nested">
2584
2585
2586
2587
2588 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_7" >
2589
2590
2591
2592 <label class="md-nav__link" for="__nav_6_7" id="__nav_6_7_label" tabindex="0">
2593 From WCF 2.1
2594 <span class="md-nav__icon md-icon"></span>
2595 </label>
2596
2597 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_7_label" aria-expanded="false">
2598 <label class="md-nav__title" for="__nav_6_7">
2599 <span class="md-nav__icon md-icon"></span>
2600 From WCF 2.1
2601 </label>
2602 <ul class="md-nav__list" data-md-scrollfix>
2603
2604
2605
2606
2607
2608
2609 <li class="md-nav__item">
2610 <a href="../../wcf21/php/" class="md-nav__link">
2611 PHP API
2612 </a>
2613 </li>
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623 <li class="md-nav__item">
2624 <a href="../../wcf21/templates/" class="md-nav__link">
2625 Templates
2626 </a>
2627 </li>
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637 <li class="md-nav__item">
2638 <a href="../../wcf21/css/" class="md-nav__link">
2639 CSS
2640 </a>
2641 </li>
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651 <li class="md-nav__item">
2652 <a href="../../wcf21/package/" class="md-nav__link">
2653 Package Components
2654 </a>
2655 </li>
2656
2657
2658
2659
2660 </ul>
2661 </nav>
2662 </li>
2663
2664
2665
2666
2667 </ul>
2668 </nav>
2669 </li>
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681 <li class="md-nav__item md-nav__item--nested">
2682
2683
2684
2685
2686 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
2687
2688
2689
2690 <label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
2691 Tutorials
2692 <span class="md-nav__icon md-icon"></span>
2693 </label>
2694
2695 <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
2696 <label class="md-nav__title" for="__nav_7">
2697 <span class="md-nav__icon md-icon"></span>
2698 Tutorials
2699 </label>
2700 <ul class="md-nav__list" data-md-scrollfix>
2701
2702
2703
2704
2705
2706
2707
2708 <li class="md-nav__item md-nav__item--nested">
2709
2710
2711
2712
2713 <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7_1" >
2714
2715
2716
2717 <label class="md-nav__link" for="__nav_7_1" id="__nav_7_1_label" tabindex="0">
2718 Tutorial Series
2719 <span class="md-nav__icon md-icon"></span>
2720 </label>
2721
2722 <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_7_1_label" aria-expanded="false">
2723 <label class="md-nav__title" for="__nav_7_1">
2724 <span class="md-nav__icon md-icon"></span>
2725 Tutorial Series
2726 </label>
2727 <ul class="md-nav__list" data-md-scrollfix>
2728
2729
2730
2731
2732
2733
2734 <li class="md-nav__item">
2735 <a href="../../../tutorial/series/overview/" class="md-nav__link">
2736 Overview
2737 </a>
2738 </li>
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748 <li class="md-nav__item">
2749 <a href="../../../tutorial/series/part_1/" class="md-nav__link">
2750 Part 1
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_2/" class="md-nav__link">
2764 Part 2
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_3/" class="md-nav__link">
2778 Part 3
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_4/" class="md-nav__link">
2792 Part 4
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_5/" class="md-nav__link">
2806 Part 5
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_6/" class="md-nav__link">
2820 Part 6
2821 </a>
2822 </li>
2823
2824
2825
2826
2827 </ul>
2828 </nav>
2829 </li>
2830
2831
2832
2833
2834 </ul>
2835 </nav>
2836 </li>
2837
2838
2839
2840 </ul>
2841 </nav>
2842 </div>
2843 </div>
2844 </div>
2845
2846
2847
2848 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
2849 <div class="md-sidebar__scrollwrap">
2850 <div class="md-sidebar__inner">
2851
2852
2853 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
2854
2855
2856
2857
2858
2859
2860 <label class="md-nav__title" for="__toc">
2861 <span class="md-nav__icon md-icon"></span>
2862 Table of contents
2863 </label>
2864 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
2865
2866 <li class="md-nav__item">
2867 <a href="#minimum-requirements" class="md-nav__link">
2868 Minimum requirements
2869 </a>
2870
2871 </li>
2872
2873 <li class="md-nav__item">
2874 <a href="#inheritance" class="md-nav__link">
2875 Inheritance
2876 </a>
2877
2878 <nav class="md-nav" aria-label="Inheritance">
2879 <ul class="md-nav__list">
2880
2881 <li class="md-nav__item">
2882 <a href="#parameter-return-property-types" class="md-nav__link">
2883 Parameter / Return / Property Types
2884 </a>
2885
2886 </li>
2887
2888 <li class="md-nav__item">
2889 <a href="#final" class="md-nav__link">
2890 final
2891 </a>
2892
2893 </li>
2894
2895 </ul>
2896 </nav>
2897
2898 </li>
2899
2900 <li class="md-nav__item">
2901 <a href="#application-boot" class="md-nav__link">
2902 Application Boot
2903 </a>
2904
2905 <nav class="md-nav" aria-label="Application Boot">
2906 <ul class="md-nav__list">
2907
2908 <li class="md-nav__item">
2909 <a href="#request-specific-logic-will-no-longer-happen-during-boot" class="md-nav__link">
2910 Request-specific logic will no longer happen during boot
2911 </a>
2912
2913 </li>
2914
2915 <li class="md-nav__item">
2916 <a href="#bootstrap-scripts" class="md-nav__link">
2917 Bootstrap Scripts
2918 </a>
2919
2920 <nav class="md-nav" aria-label="Bootstrap Scripts">
2921 <ul class="md-nav__list">
2922
2923 <li class="md-nav__item">
2924 <a href="#registering-ievent-listeners" class="md-nav__link">
2925 Registering IEvent listeners
2926 </a>
2927
2928 </li>
2929
2930 </ul>
2931 </nav>
2932
2933 </li>
2934
2935 </ul>
2936 </nav>
2937
2938 </li>
2939
2940 <li class="md-nav__item">
2941 <a href="#request-processing" class="md-nav__link">
2942 Request Processing
2943 </a>
2944
2945 <nav class="md-nav" aria-label="Request Processing">
2946 <ul class="md-nav__list">
2947
2948 <li class="md-nav__item">
2949 <a href="#recommended-changes-for-woltlab-suite-60" class="md-nav__link">
2950 Recommended changes for WoltLab Suite 6.0
2951 </a>
2952
2953 <nav class="md-nav" aria-label="Recommended changes for WoltLab Suite 6.0">
2954 <ul class="md-nav__list">
2955
2956 <li class="md-nav__item">
2957 <a href="#querying-requesthandlerinterface-based-controllers-via-javascript" class="md-nav__link">
2958 Querying RequestHandlerInterface-based controllers via JavaScript
2959 </a>
2960
2961 </li>
2962
2963 <li class="md-nav__item">
2964 <a href="#formbuilder" class="md-nav__link">
2965 FormBuilder
2966 </a>
2967
2968 </li>
2969
2970 <li class="md-nav__item">
2971 <a href="#example" class="md-nav__link">
2972 Example
2973 </a>
2974
2975 </li>
2976
2977 </ul>
2978 </nav>
2979
2980 </li>
2981
2982 </ul>
2983 </nav>
2984
2985 </li>
2986
2987 <li class="md-nav__item">
2988 <a href="#package-system" class="md-nav__link">
2989 Package System
2990 </a>
2991
2992 <nav class="md-nav" aria-label="Package System">
2993 <ul class="md-nav__list">
2994
2995 <li class="md-nav__item">
2996 <a href="#required-minversion-for-required-packages" class="md-nav__link">
2997 Required “minversion” for required packages
2998 </a>
2999
3000 </li>
3001
3002 <li class="md-nav__item">
3003 <a href="#rejection-of-pl-versions" class="md-nav__link">
3004 Rejection of “pl” versions
3005 </a>
3006
3007 </li>
3008
3009 <li class="md-nav__item">
3010 <a href="#removal-of-api-compatibility" class="md-nav__link">
3011 Removal of API compatibility
3012 </a>
3013
3014 </li>
3015
3016 <li class="md-nav__item">
3017 <a href="#package-installation-plugins" class="md-nav__link">
3018 Package Installation Plugins
3019 </a>
3020
3021 <nav class="md-nav" aria-label="Package Installation Plugins">
3022 <ul class="md-nav__list">
3023
3024 <li class="md-nav__item">
3025 <a href="#eventlistener" class="md-nav__link">
3026 EventListener
3027 </a>
3028
3029 </li>
3030
3031 <li class="md-nav__item">
3032 <a href="#cronjob" class="md-nav__link">
3033 Cronjob
3034 </a>
3035
3036 </li>
3037
3038 <li class="md-nav__item">
3039 <a href="#database" class="md-nav__link">
3040 Database
3041 </a>
3042
3043 </li>
3044
3045 </ul>
3046 </nav>
3047
3048 </li>
3049
3050 </ul>
3051 </nav>
3052
3053 </li>
3054
3055 <li class="md-nav__item">
3056 <a href="#internationalization" class="md-nav__link">
3057 Internationalization
3058 </a>
3059
3060 </li>
3061
3062 <li class="md-nav__item">
3063 <a href="#indicating-parameters-that-hold-sensitive-information" class="md-nav__link">
3064 Indicating parameters that hold sensitive information
3065 </a>
3066
3067 </li>
3068
3069 <li class="md-nav__item">
3070 <a href="#conditions" class="md-nav__link">
3071 Conditions
3072 </a>
3073
3074 <nav class="md-nav" aria-label="Conditions">
3075 <ul class="md-nav__list">
3076
3077 <li class="md-nav__item">
3078 <a href="#abstractintegercondition" class="md-nav__link">
3079 AbstractIntegerCondition
3080 </a>
3081
3082 </li>
3083
3084 </ul>
3085 </nav>
3086
3087 </li>
3088
3089 <li class="md-nav__item">
3090 <a href="#rebuild-workers" class="md-nav__link">
3091 Rebuild Workers
3092 </a>
3093
3094 </li>
3095
3096 </ul>
3097
3098 </nav>
3099 </div>
3100 </div>
3101 </div>
3102
3103
3104
3105 <div class="md-content" data-md-component="content">
3106 <article class="md-content__inner md-typeset">
3107
3108
3109
3110
3111
3112
3113
3114 <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>
3115 <h2 id="minimum-requirements">Minimum requirements<a class="headerlink" href="#minimum-requirements" title="Permanent link">#</a></h2>
3116 <p>The minimum requirements have been increased to the following:</p>
3117 <ul>
3118 <li><strong>PHP:</strong> 8.1.2 (64 bit only); <code>intl</code> extension</li>
3119 <li><strong>MySQL:</strong> 8.0.29</li>
3120 <li><strong>MariaDB:</strong> 10.5.12</li>
3121 </ul>
3122 <p>It is recommended to make use of the newly introduced features whereever possible.
3123 Please refer to the PHP documentation for details.</p>
3124 <h2 id="inheritance">Inheritance<a class="headerlink" href="#inheritance" title="Permanent link">#</a></h2>
3125 <h3 id="parameter-return-property-types">Parameter / Return / Property Types<a class="headerlink" href="#parameter-return-property-types" title="Permanent link">#</a></h3>
3126 <p>Parameter, return, and property types have been added to methods of various classes/interfaces.
3127 This might cause errors during inheritance, because the types are not compatible with the newly added types in the parent class.</p>
3128 <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>
3129 <h3 id="final">final<a class="headerlink" href="#final" title="Permanent link">#</a></h3>
3130 <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>
3131 <h2 id="application-boot">Application Boot<a class="headerlink" href="#application-boot" title="Permanent link">#</a></h2>
3132 <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>
3133 <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.
3134 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.
3135 The latter needs to emulate certain aspects of the HTTP environment for the boot to succeed.
3136 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>
3137 <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>
3138 <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.
3139 This check is based on a request-specific value, namely the user’s session which in turn is based on a provided (HTTP) cookie.
3140 It is now <a href="https://github.com/WoltLab/WCF/commit/51154ba3f8f1d09b54560d5d1933f9053ef409cb">moved into the <code>CheckUserBan</code> middleware</a>.</p>
3141 <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>
3142 <p>Notably the following checks have been moved into a middleware:</p>
3143 <ul>
3144 <li>Denying access to banned users (<a href="https://github.com/WoltLab/WCF/pull/4935">WoltLab/WCF#4935</a>)</li>
3145 <li>ACP authentication (<a href="https://github.com/WoltLab/WCF/pull/4939">WoltLab/WCF#4939</a>)</li>
3146 </ul>
3147 <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.
3148 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>.
3149 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>
3150 <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>.
3151 It only takes the object type, object ID and timestamp as the parameter and will determine the <code>userID</code> by itself.
3152 The <code>trackObjectVisitByUserIDs()</code> method on the other hand does not rely on global values.
3153 Instead the relevant user IDs need to be passed explicitly from the controller as parameters, thus making the information the method works with explicit.
3154 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>
3155 <p>The same is true for “permission checking” methods on <code>DatabaseObject</code>s.
3156 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>
3157 <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.
3158 Instead they must retrieve the appropriate information from the event data only.</p>
3159 <h3 id="bootstrap-scripts">Bootstrap Scripts<a class="headerlink" href="#bootstrap-scripts" title="Permanent link">#</a></h3>
3160 <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>
3161 <p>Bootstrap scripts are stored in the <code>lib/bootstrap/</code> directory of WoltLab Suite Core with the package identifier as the file name.
3162 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.
3163 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>
3164 <p>Bootstrap scripts will be loaded and the bootstrap functions will executed based on a topological sorting of all installed packages.
3165 A package can rely on all bootstrap scripts of its dependencies being loaded before its own bootstrap script is loaded.
3166 It can also rely on all bootstrap functions of its dependencies having executed before its own bootstrap functions is executed.
3167 However it cannot rely on any specific loading and execution order of non-dependencies.</p>
3168 <p>As hinted at in the previous paragraph, executing the bootstrap scripts happens in two phases:</p>
3169 <ol>
3170 <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>
3171 <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>
3172 </ol>
3173 <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>
3174 <span class="normal">2</span>
3175 <span class="normal">3</span>
3176 <span class="normal">4</span>
3177 <span class="normal">5</span>
3178 <span class="normal">6</span>
3179 <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>
3180
3181 <span class="c1">// Phase (1).</span>
3182
3183 <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>
3184 <span class="c1">// Phase (2).</span>
3185 <span class="p">};</span>
3186 </code></pre></div></td></tr></table></div>
3187 <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>.
3188 Instead the logic should reside in the <code>Closure</code>s body that is executed in phase (2).</p>
3189 <h4 id="registering-ievent-listeners">Registering <code>IEvent</code> listeners<a class="headerlink" href="#registering-ievent-listeners" title="Permanent link">#</a></h4>
3190 <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>.
3191 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>
3192 <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>
3193 <span class="normal"> 2</span>
3194 <span class="normal"> 3</span>
3195 <span class="normal"> 4</span>
3196 <span class="normal"> 5</span>
3197 <span class="normal"> 6</span>
3198 <span class="normal"> 7</span>
3199 <span class="normal"> 8</span>
3200 <span class="normal"> 9</span>
3201 <span class="normal">10</span>
3202 <span class="normal">11</span>
3203 <span class="normal">12</span>
3204 <span class="normal">13</span>
3205 <span class="normal">14</span>
3206 <span class="normal">15</span>
3207 <span class="normal">16</span>
3208 <span class="normal">17</span>
3209 <span class="normal">18</span>
3210 <span class="normal">19</span>
3211 <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>
3212
3213 <span class="k">use</span> <span class="nx">wcf\system\event\EventHandler</span><span class="p">;</span>
3214 <span class="k">use</span> <span class="nx">wcf\system\event\listener\ValueDumpListener</span><span class="p">;</span>
3215 <span class="k">use</span> <span class="nx">wcf\system\foo\event\ValueAvailable</span><span class="p">;</span>
3216
3217 <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>
3218 <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>
3219 <span class="nx">ValueAvailable</span><span class="o">::</span><span class="na">class</span><span class="p">,</span>
3220 <span class="nx">ValueDumpListener</span><span class="o">::</span><span class="na">class</span>
3221 <span class="p">);</span>
3222
3223 <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>
3224 <span class="nx">ValueAvailable</span><span class="o">::</span><span class="na">class</span><span class="p">,</span>
3225 <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>
3226 <span class="c1">// For simple use cases a `Closure` instead of a class name may be used.</span>
3227 <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>
3228 <span class="p">}</span>
3229 <span class="p">);</span>
3230 <span class="p">};</span>
3231 </code></pre></div></td></tr></table></div>
3232 <h2 id="request-processing">Request Processing<a class="headerlink" href="#request-processing" title="Permanent link">#</a></h2>
3233 <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>
3234 <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.
3235 Processing the request values still used PHP’s superglobals (specifically <code>$_GET</code> and <code>$_POST</code>).</p>
3236 <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>
3237 <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>
3238 <p>It is recommended to use <code>RequestHandlerInterface</code>-based controllers whenever an <code>AbstractAction</code> would previously be used.
3239 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.
3240 Both <code>AbstractAction</code> and <code>AJAXProxyAction</code>-based AJAX requests should be considered soft-deprecated going forward.</p>
3241 <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.
3242 The state of the controller object must be identical before, during and after a request was processed.
3243 Any required values must be passed explicitly by means of method parameters and return values.
3244 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>
3245 <p>The recommended pattern for a <code>RequestHandlerInterface</code>-based controller looks as follows:</p>
3246 <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>
3247 <span class="normal"> 2</span>
3248 <span class="normal"> 3</span>
3249 <span class="normal"> 4</span>
3250 <span class="normal"> 5</span>
3251 <span class="normal"> 6</span>
3252 <span class="normal"> 7</span>
3253 <span class="normal"> 8</span>
3254 <span class="normal"> 9</span>
3255 <span class="normal">10</span>
3256 <span class="normal">11</span>
3257 <span class="normal">12</span>
3258 <span class="normal">13</span>
3259 <span class="normal">14</span>
3260 <span class="normal">15</span>
3261 <span class="normal">16</span>
3262 <span class="normal">17</span>
3263 <span class="normal">18</span>
3264 <span class="normal">19</span>
3265 <span class="normal">20</span>
3266 <span class="normal">21</span>
3267 <span class="normal">22</span>
3268 <span class="normal">23</span>
3269 <span class="normal">24</span>
3270 <span class="normal">25</span>
3271 <span class="normal">26</span>
3272 <span class="normal">27</span>
3273 <span class="normal">28</span>
3274 <span class="normal">29</span>
3275 <span class="normal">30</span>
3276 <span class="normal">31</span>
3277 <span class="normal">32</span>
3278 <span class="normal">33</span>
3279 <span class="normal">34</span>
3280 <span class="normal">35</span>
3281 <span class="normal">36</span>
3282 <span class="normal">37</span>
3283 <span class="normal">38</span>
3284 <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>
3285
3286 <span class="k">namespace</span> <span class="nx">wcf\action</span><span class="p">;</span>
3287
3288 <span class="k">use</span> <span class="nx">Laminas\Diactoros\Response</span><span class="p">;</span>
3289 <span class="k">use</span> <span class="nx">Psr\Http\Message\ServerRequestInterface</span><span class="p">;</span>
3290 <span class="k">use</span> <span class="nx">Psr\Http\Message\ResponseInterface</span><span class="p">;</span>
3291 <span class="k">use</span> <span class="nx">Psr\Http\Server\RequestHandlerInterface</span><span class="p">;</span>
3292
3293 <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>
3294 <span class="p">{</span>
3295 <span class="k">public</span> <span class="k">function</span> <span class="fm">__construct</span><span class="p">()</span>
3296 <span class="p">{</span>
3297 <span class="cm">/* 0. Explicitly register services used by the controller, to</span>
3298 <span class="cm"> * make dependencies explicit and to avoid accidentally using</span>
3299 <span class="cm"> * global state outside of a controller.</span>
3300 <span class="cm"> */</span>
3301 <span class="p">}</span>
3302
3303 <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>
3304 <span class="p">{</span>
3305 <span class="cm">/* 1. Perform permission checks and input validation. */</span>
3306
3307 <span class="cm">/* 2. Perform the action. The action must not rely on global state,</span>
3308 <span class="cm"> * but instead only on explicitly passed values. It should assume</span>
3309 <span class="cm"> * that permissions have already been validated by the controller,</span>
3310 <span class="cm"> * allowing it to be reusable programmatically.</span>
3311 <span class="cm"> */</span>
3312
3313 <span class="cm">/* 3. Perform post processing. */</span>
3314
3315 <span class="cm">/* 4. Prepare the response, e.g. by querying an updated object from</span>
3316 <span class="cm"> * the database.</span>
3317 <span class="cm"> */</span>
3318
3319 <span class="cm">/* 5. Send the response. */</span>
3320 <span class="k">return</span> <span class="k">new</span> <span class="nx">Response</span><span class="p">();</span>
3321 <span class="p">}</span>
3322 <span class="p">}</span>
3323 </code></pre></div></td></tr></table></div>
3324 <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.
3325 WoltLab Suite includes a middleware that will automatically convert unhandled <code>MappingError</code>s into a response with status HTTP 400 Bad Request.</p>
3326 <p>XSRF validation will implicitly be performed for any request that uses a HTTP verb other than <code>GET</code>.
3327 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>
3328 <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>
3329 <p>The new <code>WoltLabSuite/Core/Ajax/Backend</code> module may be used to easily query a <code>RequestHandlerInterface</code>-based controller.
3330 The JavaScript code must not make any assumptions about the URI structure to reach the controller.
3331 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>
3332 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3333 <span class="normal">2</span>
3334 <span class="normal">3</span>
3335 <span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="x">&lt;button</span>
3336 <span class="x"> class=&quot;button fancyButton&quot;</span>
3337 <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>
3338 <span class="x">&gt;Click me!&lt;/button&gt;</span>
3339 </code></pre></div></td></tr></table></div>
3340 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3341 <span class="normal">2</span>
3342 <span class="normal">3</span>
3343 <span class="normal">4</span>
3344 <span class="normal">5</span>
3345 <span class="normal">6</span>
3346 <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>
3347 <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>
3348 <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>
3349 <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>
3350
3351 <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>
3352 <span class="p">});</span>
3353 </code></pre></div></td></tr></table></div>
3354 <h4 id="formbuilder">FormBuilder<a class="headerlink" href="#formbuilder" title="Permanent link">#</a></h4>
3355 <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>
3356 <p>Within the JavaScript code the endpoint is queried using:</p>
3357 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3358 <span class="normal">2</span>
3359 <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>
3360 <span class="w"> </span><span class="p">.</span><span class="nx">usingFormBuilder</span><span class="p">()</span>
3361 <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>
3362 </code></pre></div></td></tr></table></div>
3363 <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.
3364 If the form was submitted successfully <code>ok</code> will be <code>true</code> and <code>result</code> will contain the controller’s response.
3365 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>
3366 <p>Within the PHP code, the form may be created as usual, but use <code>Psr15DialogForm</code> as the form document.
3367 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.
3368 The latter will return a <code>ResponseInterface</code> to be returned if the validation fails, otherwise <code>null</code> is returned.
3369 If validation succeeded, the controller must perform the resulting action and return a <code>JsonResponse</code> with the <code>result</code> key:</p>
3370 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
3371 <span class="normal"> 2</span>
3372 <span class="normal"> 3</span>
3373 <span class="normal"> 4</span>
3374 <span class="normal"> 5</span>
3375 <span class="normal"> 6</span>
3376 <span class="normal"> 7</span>
3377 <span class="normal"> 8</span>
3378 <span class="normal"> 9</span>
3379 <span class="normal">10</span>
3380 <span class="normal">11</span>
3381 <span class="normal">12</span>
3382 <span class="normal">13</span>
3383 <span class="normal">14</span>
3384 <span class="normal">15</span>
3385 <span class="normal">16</span>
3386 <span class="normal">17</span>
3387 <span class="normal">18</span>
3388 <span class="normal">19</span>
3389 <span class="normal">20</span>
3390 <span class="normal">21</span>
3391 <span class="normal">22</span>
3392 <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>
3393 <span class="k">return</span> <span class="nv">$dialogForm</span><span class="o">-&gt;</span><span class="na">toResponse</span><span class="p">();</span>
3394 <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>
3395 <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>
3396 <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>
3397 <span class="k">return</span> <span class="nv">$response</span><span class="p">;</span>
3398 <span class="p">}</span>
3399
3400 <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>
3401
3402 <span class="c1">// Use $data.</span>
3403
3404 <span class="k">return</span> <span class="k">new</span> <span class="nx">JsonResponse</span><span class="p">([</span>
3405 <span class="s1">&#39;result&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span>
3406 <span class="s1">&#39;some&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;value&#39;</span><span class="p">,</span>
3407 <span class="p">],</span>
3408 <span class="p">]);</span>
3409 <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
3410 <span class="c1">// The used method is validated by a middleware. Methods that are not</span>
3411 <span class="c1">// GET or POST need to be explicitly allowed using the &#39;AllowHttpMethod&#39;</span>
3412 <span class="c1">// attribute.</span>
3413 <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>
3414 <span class="p">}</span>
3415 </code></pre></div></td></tr></table></div>
3416 <h4 id="example">Example<a class="headerlink" href="#example" title="Permanent link">#</a></h4>
3417 <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>.
3418 This example showcases how to:</p>
3419 <ul>
3420 <li>Store used services within the controller’s constructor.</li>
3421 <li>Perform validation of inputs using Valinor.</li>
3422 <li>Perform permission checks.</li>
3423 <li>Use the FormBuilder.</li>
3424 <li>Delegate the actual processing to a reusable command that does not rely on global state.</li>
3425 <li>Store the request endpoint as a <code>data-*</code> attribute.</li>
3426 </ul>
3427 <h2 id="package-system">Package System<a class="headerlink" href="#package-system" title="Permanent link">#</a></h2>
3428 <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>
3429 <p>The <code>minversion</code> attribute of the <code>&lt;requiredpackage&gt;</code> tag is now required.</p>
3430 <h3 id="rejection-of-pl-versions">Rejection of “pl” versions<a class="headerlink" href="#rejection-of-pl-versions" title="Permanent link">#</a></h3>
3431 <p>Woltlab Suite 6.0 no longer accepts package versions with the “pl” suffix as valid.</p>
3432 <h3 id="removal-of-api-compatibility">Removal of API compatibility<a class="headerlink" href="#removal-of-api-compatibility" title="Permanent link">#</a></h3>
3433 <p>WoltLab Suite 6.0 removes support for the deprecated API compatibility functionality.
3434 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.
3435 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.
3436 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>
3437 <h3 id="package-installation-plugins">Package Installation Plugins<a class="headerlink" href="#package-installation-plugins" title="Permanent link">#</a></h3>
3438 <h4 id="eventlistener">EventListener<a class="headerlink" href="#eventlistener" title="Permanent link">#</a></h4>
3439 <p>Installing unnamed event listeners is no longer supported.
3440 The <code>name</code> attribute needs to be specified for all event listeners.</p>
3441 <p>Deleting unnamed event listeners still is possible to allow for a clean migration of existing listeners.</p>
3442 <h4 id="cronjob">Cronjob<a class="headerlink" href="#cronjob" title="Permanent link">#</a></h4>
3443 <p>Installing unnamed cronjobs is no longer supported.
3444 The <code>name</code> attribute needs to be specified for all event listeners.</p>
3445 <p>Deleting unnamed cronjobs still is possible to allow for a clean migration of existing cronjobs.</p>
3446 <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>
3447 <h4 id="database">Database<a class="headerlink" href="#database" title="Permanent link">#</a></h4>
3448 <p>The <code>$name</code> parameter of <code>DatabaseTableIndex::create()</code> is no longer optional.
3449 Relying on the auto-generated index name is strongly discouraged, because of unfixable inconsistent behavior between the SQL PIP and the PHP DDL API.
3450 See <a href="https://github.com/WoltLab/WCF/issues/4505">WoltLab/WCF#4505</a> for further background information.</p>
3451 <p>The autogenerated name can still be requested by passing an empty string as the <code>$name</code>.
3452 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.
3453 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>
3454 <h2 id="internationalization">Internationalization<a class="headerlink" href="#internationalization" title="Permanent link">#</a></h2>
3455 <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>
3456 <p>One example would be the formatting of numbers.
3457 WoltLab Suite included a feature to group digits within large numbers since early versions using the <code>StringUtil::addThousandsSeparator()</code> method.
3458 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>
3459 <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.
3460 English as written in India on the other hand also uses commas, but digits are not grouped into groups of three.
3461 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>
3462 <p>Another example would be German as used within Germany and Switzerland.
3463 While both countries use groups of three, the separator character differs.
3464 Germany uses a dot (123.456.789), whereas Switzerland uses an apostrophe (123456789).
3465 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.
3466 It also made it hard to keep the behavior up to date when rules change.</p>
3467 <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.
3468 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>
3469 <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>
3470 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3471 <span class="normal">2</span>
3472 <span class="normal">3</span>
3473 <span class="normal">4</span>
3474 <span class="normal">5</span>
3475 <span class="normal">6</span>
3476 <span class="normal">7</span>
3477 <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));
3478 string(11) &quot;123,456,789&quot;
3479 php &gt; var_dump((new NumberFormatter(&#39;en_IN&#39;, \NumberFormatter::DEFAULT_STYLE))-&gt;format(123_456_789));
3480 string(12) &quot;12,34,56,789&quot;
3481 php &gt; var_dump((new NumberFormatter(&#39;de_DE&#39;, \NumberFormatter::DEFAULT_STYLE))-&gt;format(123_456_789));
3482 string(11) &quot;123.456.789&quot;
3483 php &gt; var_dump((new NumberFormatter(&#39;de_CH&#39;, \NumberFormatter::DEFAULT_STYLE))-&gt;format(123_456_789));
3484 string(15) &quot;123456789&quot;
3485 </code></pre></div></td></tr></table></div>
3486 <p>WoltLab Suite’s <code>StringUtil::formatNumeric()</code> method is updated to leverage the <code>NumberFormatter</code> internally.
3487 However your package might have special requirements regarding formatting, for example when formatting currencies where the position of the currency symbol differs across languages.
3488 In those cases your package should manually create an appropriately configured class from Intl’s feature set.
3489 The correct locale can be queried by the new <code>Language::getLocale()</code> method.</p>
3490 <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>
3491 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
3492 <span class="normal"> 2</span>
3493 <span class="normal"> 3</span>
3494 <span class="normal"> 4</span>
3495 <span class="normal"> 5</span>
3496 <span class="normal"> 6</span>
3497 <span class="normal"> 7</span>
3498 <span class="normal"> 8</span>
3499 <span class="normal"> 9</span>
3500 <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());
3501 string(5) &quot;en_US&quot;
3502 php &gt; var_dump(locale_get_display_region(&#39;_DE&#39;, \wcf\system\WCF::getLanguage()-&gt;getLocale()));
3503 string(7) &quot;Germany&quot;
3504 php &gt; var_dump(locale_get_display_region(&#39;_US&#39;, \wcf\system\WCF::getLanguage()-&gt;getLocale()));
3505 string(13) &quot;United States&quot;
3506 php &gt; var_dump(locale_get_display_region(&#39;_IN&#39;, \wcf\system\WCF::getLanguage()-&gt;getLocale()));
3507 string(5) &quot;India&quot;
3508 php &gt; var_dump(locale_get_display_region(&#39;_BR&#39;, \wcf\system\WCF::getLanguage()-&gt;getLocale()));
3509 string(6) &quot;Brazil&quot;
3510 </code></pre></div></td></tr></table></div>
3511 <p>See <a href="https://github.com/WoltLab/WCF/pull/5048">WoltLab/WCF#5048</a> for details.</p>
3512 <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>
3513 <p>PHP 8.2 adds native support for redacting parameters holding sensitive information in stack traces.
3514 Parameters with the <code>#[\SensitiveParameter]</code> attribute will show a placeholder value within the stack trace and the error log.</p>
3515 <p>WoltLab Suite’s exception handler contains logic to manually apply the sanitization for PHP versions before 8.2.</p>
3516 <p>It is strongly recommended to add this attribute to all parameters holding sensitive information.
3517 Examples for sensitive parameters include passwords/passphrases, access tokens, plaintext values to be encrypted, or private keys.</p>
3518 <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>
3519 <p>Example:</p>
3520 <div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
3521 <span class="normal">2</span>
3522 <span class="normal">3</span>
3523 <span class="normal">4</span>
3524 <span class="normal">5</span>
3525 <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>
3526 <span class="p">#[</span><span class="nd">\SensitiveParameter</span><span class="p">]</span>
3527 <span class="nv">$password</span><span class="p">,</span>
3528 <span class="p">)</span><span class="o">:</span> <span class="nx">bool</span> <span class="p">{</span>
3529 <span class="c1">// …</span>
3530 <span class="p">}</span>
3531 </code></pre></div></td></tr></table></div>
3532 <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>
3533 <h2 id="conditions">Conditions<a class="headerlink" href="#conditions" title="Permanent link">#</a></h2>
3534 <h3 id="abstractintegercondition">AbstractIntegerCondition<a class="headerlink" href="#abstractintegercondition" title="Permanent link">#</a></h3>
3535 <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.
3536 This is to ensure that all conditions specify a unique identifier, instead of accidentally relying on a default value.
3537 The <code>$identifier</code> property will no longer be used and may be removed.</p>
3538 <p>See <a href="https://github.com/WoltLab/WCF/pull/5077">WoltLab/WCF#5077</a> for details.</p>
3539 <h2 id="rebuild-workers">Rebuild Workers<a class="headerlink" href="#rebuild-workers" title="Permanent link">#</a></h2>
3540 <p>Rebuild workers should no longer be registered using the <code>com.woltlab.wcf.rebuildData</code> object type definition.
3541 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.
3542 The class name of the worker is registered using the event’s <code>register()</code> method:</p>
3543 <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>
3544 <span class="normal"> 2</span>
3545 <span class="normal"> 3</span>
3546 <span class="normal"> 4</span>
3547 <span class="normal"> 5</span>
3548 <span class="normal"> 6</span>
3549 <span class="normal"> 7</span>
3550 <span class="normal"> 8</span>
3551 <span class="normal"> 9</span>
3552 <span class="normal">10</span>
3553 <span class="normal">11</span>
3554 <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>
3555
3556 <span class="k">use</span> <span class="nx">wcf\system\event\EventHandler</span><span class="p">;</span>
3557 <span class="k">use</span> <span class="nx">wcf\system\worker\event\RebuildWorkerCollecting</span><span class="p">;</span>
3558
3559 <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>
3560 <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>
3561
3562 <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>
3563 <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>
3564 <span class="p">});</span>
3565 <span class="p">};</span>
3566 </code></pre></div></td></tr></table></div>
3567
3568 <hr>
3569 <div class="md-source-file">
3570 <small>
3571
3572 Last update:
3573 2023-02-24
3574
3575 </small>
3576 </div>
3577
3578
3579
3580
3581
3582
3583 </article>
3584 </div>
3585
3586
3587 </div>
3588
3589 </main>
3590
3591 <footer class="md-footer">
3592
3593 <div class="md-footer-meta md-typeset">
3594 <div class="md-footer-meta__inner md-grid">
3595 <div class="md-copyright">
3596
3597 <div class="md-copyright__highlight">
3598 Copyright © 2020 WoltLab GmbH
3599 </div>
3600
3601
3602 Made with
3603 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
3604 Material for MkDocs
3605 </a>
3606
3607 </div>
3608
3609 <div class="md-copyright">
3610 <a href="https://www.woltlab.com/legal-notice/">Legal Notice</a>
3611 <a href="https://www.woltlab.com/privacy-policy/">Privacy Policy</a>
3612 </div>
3613
3614 </div>
3615 </div>
3616 </footer>
3617
3618 </div>
3619 <div class="md-dialog" data-md-component="dialog">
3620 <div class="md-dialog__inner md-typeset"></div>
3621 </div>
3622
3623 <script id="__config" type="application/json">{"base": "../../..", "features": ["navigation.tracking"], "search": "../../../assets/javascripts/workers/search.208ed371.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script>
3624
3625
3626 <script src="../../../assets/javascripts/bundle.b4d07000.min.js"></script>
3627
3628
3629 </body>
3630 </html>