3 <html lang=
"en" class=
"no-js">
7 <meta name=
"viewport" content=
"width=device-width,initial-scale=1">
12 <link rel=
"icon" href=
"../../../assets/default.favicon.ico">
13 <meta name=
"generator" content=
"mkdocs-1.1.2, mkdocs-material-7.1.0">
17 <title>PHP API - WoltLab Suite Documentation
</title>
21 <link rel=
"stylesheet" href=
"../../../assets/stylesheets/main.33e2939f.min.css">
24 <link rel=
"stylesheet" href=
"../../../assets/stylesheets/palette.ef6f36e2.min.css">
28 <meta name=
"theme-color" content=
"#009485">
38 <link rel=
"stylesheet" href=
"../../../stylesheets/extra.css">
52 <body dir=
"ltr" data-md-color-scheme=
"" data-md-color-primary=
"teal" data-md-color-accent=
"">
55 <script>function __prefix(e){return new URL(
"../../..",location).pathname+
"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}
</script>
57 <input class=
"md-toggle" data-md-toggle=
"drawer" type=
"checkbox" id=
"__drawer" autocomplete=
"off">
58 <input class=
"md-toggle" data-md-toggle=
"search" type=
"checkbox" id=
"__search" autocomplete=
"off">
59 <label class=
"md-overlay" for=
"__drawer"></label>
60 <div data-md-component=
"skip">
63 <a href=
"#migrating-from-wsc-52-php" class=
"md-skip">
68 <div data-md-component=
"announce">
70 <aside class=
"md-announce">
71 <div class=
"md-announce__inner md-grid md-typeset">
73 <a href=
"https://www.woltlab.com">Back to
<strong>woltlab.com
</strong></a>
80 <header class=
"md-header" data-md-component=
"header">
81 <nav class=
"md-header__inner md-grid" aria-label=
"Header">
82 <a href=
"../../.." title=
"WoltLab Suite Documentation" class=
"md-header__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
84 <img src=
"../../../assets/logo.png" alt=
"logo">
87 <label class=
"md-header__button md-icon" for=
"__drawer">
88 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
90 <div class=
"md-header__title" data-md-component=
"header-title">
91 <div class=
"md-header__ellipsis">
92 <div class=
"md-header__topic">
93 <span class=
"md-ellipsis">
94 WoltLab Suite Documentation
97 <div class=
"md-header__topic" data-md-component=
"header-topic">
98 <span class=
"md-ellipsis">
109 <label class=
"md-header__button md-icon" for=
"__search">
110 <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>
113 <div class=
"md-search" data-md-component=
"search" role=
"dialog">
114 <label class=
"md-search__overlay" for=
"__search"></label>
115 <div class=
"md-search__inner" role=
"search">
116 <form class=
"md-search__form" name=
"search">
117 <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" data-md-state=
"active" required
>
118 <label class=
"md-search__icon md-icon" for=
"__search">
119 <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>
120 <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>
122 <button type=
"reset" class=
"md-search__icon md-icon" aria-label=
"Clear" tabindex=
"-1">
123 <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>
126 <div class=
"md-search__output">
127 <div class=
"md-search__scrollwrap" data-md-scrollfix
>
128 <div class=
"md-search-result" data-md-component=
"search-result">
129 <div class=
"md-search-result__meta">
132 <ol class=
"md-search-result__list"></ol>
140 <div class=
"md-header__source">
142 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
143 <div class=
"md-source__icon md-icon">
145 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><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>
147 <div class=
"md-source__repository">
156 <div class=
"md-container" data-md-component=
"container">
161 <main class=
"md-main" data-md-component=
"main">
162 <div class=
"md-main__inner md-grid">
166 <div class=
"md-sidebar md-sidebar--primary" data-md-component=
"sidebar" data-md-type=
"navigation" >
167 <div class=
"md-sidebar__scrollwrap">
168 <div class=
"md-sidebar__inner">
172 <nav class=
"md-nav md-nav--primary" aria-label=
"Navigation" data-md-level=
"0">
173 <label class=
"md-nav__title" for=
"__drawer">
174 <a href=
"../../.." title=
"WoltLab Suite Documentation" class=
"md-nav__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
176 <img src=
"../../../assets/logo.png" alt=
"logo">
179 WoltLab Suite Documentation
182 <div class=
"md-nav__source">
184 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
185 <div class=
"md-source__icon md-icon">
187 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><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>
189 <div class=
"md-source__repository">
195 <ul class=
"md-nav__list" data-md-scrollfix
>
204 <li class=
"md-nav__item">
205 <a href=
"../../../getting-started/" class=
"md-nav__link">
220 <li class=
"md-nav__item md-nav__item--nested">
223 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2" type=
"checkbox" id=
"__nav_2" >
225 <label class=
"md-nav__link" for=
"__nav_2">
227 <span class=
"md-nav__icon md-icon"></span>
229 <nav class=
"md-nav" aria-label=
"PHP API" data-md-level=
"1">
230 <label class=
"md-nav__title" for=
"__nav_2">
231 <span class=
"md-nav__icon md-icon"></span>
234 <ul class=
"md-nav__list" data-md-scrollfix
>
240 <li class=
"md-nav__item">
241 <a href=
"../../../php/pages/" class=
"md-nav__link">
252 <li class=
"md-nav__item">
253 <a href=
"../../../php/database-objects/" class=
"md-nav__link">
264 <li class=
"md-nav__item">
265 <a href=
"../../../php/database-access/" class=
"md-nav__link">
276 <li class=
"md-nav__item">
277 <a href=
"../../../php/exceptions/" class=
"md-nav__link">
289 <li class=
"md-nav__item md-nav__item--nested">
292 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5" type=
"checkbox" id=
"__nav_2_5" >
294 <label class=
"md-nav__link" for=
"__nav_2_5">
296 <span class=
"md-nav__icon md-icon"></span>
298 <nav class=
"md-nav" aria-label=
"API" data-md-level=
"2">
299 <label class=
"md-nav__title" for=
"__nav_2_5">
300 <span class=
"md-nav__icon md-icon"></span>
303 <ul class=
"md-nav__list" data-md-scrollfix
>
309 <li class=
"md-nav__item">
310 <a href=
"../../../php/api/caches/" class=
"md-nav__link">
321 <li class=
"md-nav__item">
322 <a href=
"../../../php/api/comments/" class=
"md-nav__link">
333 <li class=
"md-nav__item">
334 <a href=
"../../../php/api/cronjobs/" class=
"md-nav__link">
345 <li class=
"md-nav__item">
346 <a href=
"../../../php/api/events/" class=
"md-nav__link">
358 <li class=
"md-nav__item md-nav__item--nested">
361 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_5" type=
"checkbox" id=
"__nav_2_5_5" >
363 <label class=
"md-nav__link" for=
"__nav_2_5_5">
365 <span class=
"md-nav__icon md-icon"></span>
367 <nav class=
"md-nav" aria-label=
"Form Builder" data-md-level=
"3">
368 <label class=
"md-nav__title" for=
"__nav_2_5_5">
369 <span class=
"md-nav__icon md-icon"></span>
372 <ul class=
"md-nav__list" data-md-scrollfix
>
378 <li class=
"md-nav__item">
379 <a href=
"../../../php/api/form_builder/overview/" class=
"md-nav__link">
390 <li class=
"md-nav__item">
391 <a href=
"../../../php/api/form_builder/structure/" class=
"md-nav__link">
402 <li class=
"md-nav__item">
403 <a href=
"../../../php/api/form_builder/form_fields/" class=
"md-nav__link">
414 <li class=
"md-nav__item">
415 <a href=
"../../../php/api/form_builder/validation_data/" class=
"md-nav__link">
426 <li class=
"md-nav__item">
427 <a href=
"../../../php/api/form_builder/dependencies/" class=
"md-nav__link">
444 <li class=
"md-nav__item">
445 <a href=
"../../../php/api/package_installation_plugins/" class=
"md-nav__link">
446 Package Installation Plugins
456 <li class=
"md-nav__item">
457 <a href=
"../../../php/api/user_activity_points/" class=
"md-nav__link">
468 <li class=
"md-nav__item">
469 <a href=
"../../../php/api/user_notifications/" class=
"md-nav__link">
480 <li class=
"md-nav__item">
481 <a href=
"../../../php/api/sitemaps/" class=
"md-nav__link">
498 <li class=
"md-nav__item">
499 <a href=
"../../../php/code-style/" class=
"md-nav__link">
510 <li class=
"md-nav__item">
511 <a href=
"../../../php/apps/" class=
"md-nav__link">
522 <li class=
"md-nav__item">
523 <a href=
"../../../php/gdpr/" class=
"md-nav__link">
544 <li class=
"md-nav__item md-nav__item--nested">
547 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_3" type=
"checkbox" id=
"__nav_3" >
549 <label class=
"md-nav__link" for=
"__nav_3">
550 Languages, Templates & CSS
551 <span class=
"md-nav__icon md-icon"></span>
553 <nav class=
"md-nav" aria-label=
"Languages, Templates & CSS" data-md-level=
"1">
554 <label class=
"md-nav__title" for=
"__nav_3">
555 <span class=
"md-nav__icon md-icon"></span>
556 Languages, Templates & CSS
558 <ul class=
"md-nav__list" data-md-scrollfix
>
564 <li class=
"md-nav__item">
565 <a href=
"../../../view/languages/" class=
"md-nav__link">
576 <li class=
"md-nav__item">
577 <a href=
"../../../view/templates/" class=
"md-nav__link">
588 <li class=
"md-nav__item">
589 <a href=
"../../../view/css/" class=
"md-nav__link">
610 <li class=
"md-nav__item md-nav__item--nested">
613 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4" type=
"checkbox" id=
"__nav_4" >
615 <label class=
"md-nav__link" for=
"__nav_4">
617 <span class=
"md-nav__icon md-icon"></span>
619 <nav class=
"md-nav" aria-label=
"JavaScript API" data-md-level=
"1">
620 <label class=
"md-nav__title" for=
"__nav_4">
621 <span class=
"md-nav__icon md-icon"></span>
624 <ul class=
"md-nav__list" data-md-scrollfix
>
630 <li class=
"md-nav__item">
631 <a href=
"../../../javascript/general-usage/" class=
"md-nav__link">
643 <li class=
"md-nav__item md-nav__item--nested">
646 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4_2" type=
"checkbox" id=
"__nav_4_2" >
648 <label class=
"md-nav__link" for=
"__nav_4_2">
650 <span class=
"md-nav__icon md-icon"></span>
652 <nav class=
"md-nav" aria-label=
"New API" data-md-level=
"2">
653 <label class=
"md-nav__title" for=
"__nav_4_2">
654 <span class=
"md-nav__icon md-icon"></span>
657 <ul class=
"md-nav__list" data-md-scrollfix
>
663 <li class=
"md-nav__item">
664 <a href=
"../../../javascript/new-api_writing-a-module/" class=
"md-nav__link">
675 <li class=
"md-nav__item">
676 <a href=
"../../../javascript/new-api_data-structures/" class=
"md-nav__link">
687 <li class=
"md-nav__item">
688 <a href=
"../../../javascript/new-api_core/" class=
"md-nav__link">
699 <li class=
"md-nav__item">
700 <a href=
"../../../javascript/new-api_dom/" class=
"md-nav__link">
711 <li class=
"md-nav__item">
712 <a href=
"../../../javascript/new-api_events/" class=
"md-nav__link">
723 <li class=
"md-nav__item">
724 <a href=
"../../../javascript/new-api_ajax/" class=
"md-nav__link">
735 <li class=
"md-nav__item">
736 <a href=
"../../../javascript/new-api_dialogs/" class=
"md-nav__link">
747 <li class=
"md-nav__item">
748 <a href=
"../../../javascript/new-api_browser/" class=
"md-nav__link">
749 Browser and Screen Sizes
759 <li class=
"md-nav__item">
760 <a href=
"../../../javascript/new-api_ui/" class=
"md-nav__link">
777 <li class=
"md-nav__item">
778 <a href=
"../../../javascript/legacy-api/" class=
"md-nav__link">
789 <li class=
"md-nav__item">
790 <a href=
"../../../javascript/helper-functions/" class=
"md-nav__link">
801 <li class=
"md-nav__item">
802 <a href=
"../../../javascript/code-snippets/" class=
"md-nav__link">
823 <li class=
"md-nav__item md-nav__item--nested">
826 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5" type=
"checkbox" id=
"__nav_5" >
828 <label class=
"md-nav__link" for=
"__nav_5">
830 <span class=
"md-nav__icon md-icon"></span>
832 <nav class=
"md-nav" aria-label=
"Package Components" data-md-level=
"1">
833 <label class=
"md-nav__title" for=
"__nav_5">
834 <span class=
"md-nav__icon md-icon"></span>
837 <ul class=
"md-nav__list" data-md-scrollfix
>
843 <li class=
"md-nav__item">
844 <a href=
"../../../package/package-xml/" class=
"md-nav__link">
856 <li class=
"md-nav__item md-nav__item--nested">
859 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5_2" type=
"checkbox" id=
"__nav_5_2" >
861 <label class=
"md-nav__link" for=
"__nav_5_2">
863 <span class=
"md-nav__icon md-icon"></span>
865 <nav class=
"md-nav" aria-label=
"PIPs" data-md-level=
"2">
866 <label class=
"md-nav__title" for=
"__nav_5_2">
867 <span class=
"md-nav__icon md-icon"></span>
870 <ul class=
"md-nav__list" data-md-scrollfix
>
876 <li class=
"md-nav__item">
877 <a href=
"../../../package/pip/" class=
"md-nav__link">
888 <li class=
"md-nav__item">
889 <a href=
"../../../package/pip/acl-option/" class=
"md-nav__link">
900 <li class=
"md-nav__item">
901 <a href=
"../../../package/pip/acp-menu/" class=
"md-nav__link">
912 <li class=
"md-nav__item">
913 <a href=
"../../../package/pip/acp-search-provider/" class=
"md-nav__link">
924 <li class=
"md-nav__item">
925 <a href=
"../../../package/pip/acp-template/" class=
"md-nav__link">
936 <li class=
"md-nav__item">
937 <a href=
"../../../package/pip/bbcode/" class=
"md-nav__link">
948 <li class=
"md-nav__item">
949 <a href=
"../../../package/pip/box/" class=
"md-nav__link">
960 <li class=
"md-nav__item">
961 <a href=
"../../../package/pip/clipboard-action/" class=
"md-nav__link">
972 <li class=
"md-nav__item">
973 <a href=
"../../../package/pip/core-object/" class=
"md-nav__link">
984 <li class=
"md-nav__item">
985 <a href=
"../../../package/pip/cronjob/" class=
"md-nav__link">
996 <li class=
"md-nav__item">
997 <a href=
"../../../package/pip/event-listener/" class=
"md-nav__link">
1008 <li class=
"md-nav__item">
1009 <a href=
"../../../package/pip/file/" class=
"md-nav__link">
1020 <li class=
"md-nav__item">
1021 <a href=
"../../../package/pip/language/" class=
"md-nav__link">
1032 <li class=
"md-nav__item">
1033 <a href=
"../../../package/pip/media-provider/" class=
"md-nav__link">
1044 <li class=
"md-nav__item">
1045 <a href=
"../../../package/pip/menu/" class=
"md-nav__link">
1056 <li class=
"md-nav__item">
1057 <a href=
"../../../package/pip/menu-item/" class=
"md-nav__link">
1068 <li class=
"md-nav__item">
1069 <a href=
"../../../package/pip/object-type/" class=
"md-nav__link">
1080 <li class=
"md-nav__item">
1081 <a href=
"../../../package/pip/object-type-definition/" class=
"md-nav__link">
1082 objectTypeDefinition
1092 <li class=
"md-nav__item">
1093 <a href=
"../../../package/pip/option/" class=
"md-nav__link">
1104 <li class=
"md-nav__item">
1105 <a href=
"../../../package/pip/page/" class=
"md-nav__link">
1116 <li class=
"md-nav__item">
1117 <a href=
"../../../package/pip/pip/" class=
"md-nav__link">
1128 <li class=
"md-nav__item">
1129 <a href=
"../../../package/pip/script/" class=
"md-nav__link">
1140 <li class=
"md-nav__item">
1141 <a href=
"../../../package/pip/smiley/" class=
"md-nav__link">
1152 <li class=
"md-nav__item">
1153 <a href=
"../../../package/pip/sql/" class=
"md-nav__link">
1164 <li class=
"md-nav__item">
1165 <a href=
"../../../package/pip/style/" class=
"md-nav__link">
1176 <li class=
"md-nav__item">
1177 <a href=
"../../../package/pip/template/" class=
"md-nav__link">
1188 <li class=
"md-nav__item">
1189 <a href=
"../../../package/pip/template-listener/" class=
"md-nav__link">
1200 <li class=
"md-nav__item">
1201 <a href=
"../../../package/pip/user-group-option/" class=
"md-nav__link">
1212 <li class=
"md-nav__item">
1213 <a href=
"../../../package/pip/user-menu/" class=
"md-nav__link">
1224 <li class=
"md-nav__item">
1225 <a href=
"../../../package/pip/user-notification-event/" class=
"md-nav__link">
1226 userNotificationEvent
1236 <li class=
"md-nav__item">
1237 <a href=
"../../../package/pip/user-option/" class=
"md-nav__link">
1248 <li class=
"md-nav__item">
1249 <a href=
"../../../package/pip/user-profile-menu/" class=
"md-nav__link">
1266 <li class=
"md-nav__item">
1267 <a href=
"../../../package/database-php-api/" class=
"md-nav__link">
1290 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
1293 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6" type=
"checkbox" id=
"__nav_6" checked
>
1295 <label class=
"md-nav__link" for=
"__nav_6">
1297 <span class=
"md-nav__icon md-icon"></span>
1299 <nav class=
"md-nav" aria-label=
"Migration" data-md-level=
"1">
1300 <label class=
"md-nav__title" for=
"__nav_6">
1301 <span class=
"md-nav__icon md-icon"></span>
1304 <ul class=
"md-nav__list" data-md-scrollfix
>
1311 <li class=
"md-nav__item md-nav__item--nested">
1314 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_1" type=
"checkbox" id=
"__nav_6_1" >
1316 <label class=
"md-nav__link" for=
"__nav_6_1">
1317 Migrating from WSC
5.3
1318 <span class=
"md-nav__icon md-icon"></span>
1320 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.3" data-md-level=
"2">
1321 <label class=
"md-nav__title" for=
"__nav_6_1">
1322 <span class=
"md-nav__icon md-icon"></span>
1323 Migrating from WSC
5.3
1325 <ul class=
"md-nav__list" data-md-scrollfix
>
1331 <li class=
"md-nav__item">
1332 <a href=
"../../wsc53/php/" class=
"md-nav__link">
1343 <li class=
"md-nav__item">
1344 <a href=
"../../wsc53/session/" class=
"md-nav__link">
1345 Session Handling and Authentication
1355 <li class=
"md-nav__item">
1356 <a href=
"../../wsc53/javascript/" class=
"md-nav__link">
1367 <li class=
"md-nav__item">
1368 <a href=
"../../wsc53/templates/" class=
"md-nav__link">
1379 <li class=
"md-nav__item">
1380 <a href=
"../../wsc53/libraries/" class=
"md-nav__link">
1381 Third Party Libraries
1400 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
1403 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_2" type=
"checkbox" id=
"__nav_6_2" checked
>
1405 <label class=
"md-nav__link" for=
"__nav_6_2">
1406 Migrating from WSC
5.2
1407 <span class=
"md-nav__icon md-icon"></span>
1409 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.2" data-md-level=
"2">
1410 <label class=
"md-nav__title" for=
"__nav_6_2">
1411 <span class=
"md-nav__icon md-icon"></span>
1412 Migrating from WSC
5.2
1414 <ul class=
"md-nav__list" data-md-scrollfix
>
1422 <li class=
"md-nav__item md-nav__item--active">
1424 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"toc" type=
"checkbox" id=
"__toc">
1429 <label class=
"md-nav__link md-nav__link--active" for=
"__toc">
1431 <span class=
"md-nav__icon md-icon"></span>
1434 <a href=
"./" class=
"md-nav__link md-nav__link--active">
1439 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
1445 <label class=
"md-nav__title" for=
"__toc">
1446 <span class=
"md-nav__icon md-icon"></span>
1449 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
1451 <li class=
"md-nav__item">
1452 <a href=
"#comments" class=
"md-nav__link">
1458 <li class=
"md-nav__item">
1459 <a href=
"#event-listeners" class=
"md-nav__link">
1465 <li class=
"md-nav__item">
1466 <a href=
"#email-activation" class=
"md-nav__link">
1472 <li class=
"md-nav__item">
1473 <a href=
"#addform" class=
"md-nav__link">
1479 <li class=
"md-nav__item">
1480 <a href=
"#user-generated-links" class=
"md-nav__link">
1481 User Generated Links
1486 <li class=
"md-nav__item">
1487 <a href=
"#resource-management-when-scaling-images" class=
"md-nav__link">
1488 Resource Management When Scaling Images
1493 <li class=
"md-nav__item">
1494 <a href=
"#toggle-for-accelerated-mobile-pages-amp" class=
"md-nav__link">
1495 Toggle for Accelerated Mobile Pages (AMP)
1512 <li class=
"md-nav__item">
1513 <a href=
"../templates/" class=
"md-nav__link">
1514 Templates and Languages
1524 <li class=
"md-nav__item">
1525 <a href=
"../libraries/" class=
"md-nav__link">
1526 Third Party Libraries
1543 <li class=
"md-nav__item md-nav__item--nested">
1546 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_3" type=
"checkbox" id=
"__nav_6_3" >
1548 <label class=
"md-nav__link" for=
"__nav_6_3">
1549 Migrating from WSC
3.1
1550 <span class=
"md-nav__icon md-icon"></span>
1552 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.1" data-md-level=
"2">
1553 <label class=
"md-nav__title" for=
"__nav_6_3">
1554 <span class=
"md-nav__icon md-icon"></span>
1555 Migrating from WSC
3.1
1557 <ul class=
"md-nav__list" data-md-scrollfix
>
1563 <li class=
"md-nav__item">
1564 <a href=
"../../wsc31/php/" class=
"md-nav__link">
1582 <li class=
"md-nav__item md-nav__item--nested">
1585 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_4" type=
"checkbox" id=
"__nav_6_4" >
1587 <label class=
"md-nav__link" for=
"__nav_6_4">
1588 Migrating from WSC
3.0
1589 <span class=
"md-nav__icon md-icon"></span>
1591 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.0" data-md-level=
"2">
1592 <label class=
"md-nav__title" for=
"__nav_6_4">
1593 <span class=
"md-nav__icon md-icon"></span>
1594 Migrating from WSC
3.0
1596 <ul class=
"md-nav__list" data-md-scrollfix
>
1602 <li class=
"md-nav__item">
1603 <a href=
"../../wsc30/php/" class=
"md-nav__link">
1614 <li class=
"md-nav__item">
1615 <a href=
"../../wsc30/javascript/" class=
"md-nav__link">
1626 <li class=
"md-nav__item">
1627 <a href=
"../../wsc30/templates/" class=
"md-nav__link">
1638 <li class=
"md-nav__item">
1639 <a href=
"../../wsc30/css/" class=
"md-nav__link">
1650 <li class=
"md-nav__item">
1651 <a href=
"../../wsc30/package/" class=
"md-nav__link">
1669 <li class=
"md-nav__item md-nav__item--nested">
1672 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_5" type=
"checkbox" id=
"__nav_6_5" >
1674 <label class=
"md-nav__link" for=
"__nav_6_5">
1675 Migrating from WCF
2.1
1676 <span class=
"md-nav__icon md-icon"></span>
1678 <nav class=
"md-nav" aria-label=
"Migrating from WCF 2.1" data-md-level=
"2">
1679 <label class=
"md-nav__title" for=
"__nav_6_5">
1680 <span class=
"md-nav__icon md-icon"></span>
1681 Migrating from WCF
2.1
1683 <ul class=
"md-nav__list" data-md-scrollfix
>
1689 <li class=
"md-nav__item">
1690 <a href=
"../../wcf21/php/" class=
"md-nav__link">
1701 <li class=
"md-nav__item">
1702 <a href=
"../../wcf21/templates/" class=
"md-nav__link">
1713 <li class=
"md-nav__item">
1714 <a href=
"../../wcf21/css/" class=
"md-nav__link">
1725 <li class=
"md-nav__item">
1726 <a href=
"../../wcf21/package/" class=
"md-nav__link">
1753 <li class=
"md-nav__item md-nav__item--nested">
1756 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7" type=
"checkbox" id=
"__nav_7" >
1758 <label class=
"md-nav__link" for=
"__nav_7">
1760 <span class=
"md-nav__icon md-icon"></span>
1762 <nav class=
"md-nav" aria-label=
"Tutorials" data-md-level=
"1">
1763 <label class=
"md-nav__title" for=
"__nav_7">
1764 <span class=
"md-nav__icon md-icon"></span>
1767 <ul class=
"md-nav__list" data-md-scrollfix
>
1774 <li class=
"md-nav__item md-nav__item--nested">
1777 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7_1" type=
"checkbox" id=
"__nav_7_1" >
1779 <label class=
"md-nav__link" for=
"__nav_7_1">
1781 <span class=
"md-nav__icon md-icon"></span>
1783 <nav class=
"md-nav" aria-label=
"Tutorial Series" data-md-level=
"2">
1784 <label class=
"md-nav__title" for=
"__nav_7_1">
1785 <span class=
"md-nav__icon md-icon"></span>
1788 <ul class=
"md-nav__list" data-md-scrollfix
>
1794 <li class=
"md-nav__item">
1795 <a href=
"../../../tutorial/series/overview/" class=
"md-nav__link">
1806 <li class=
"md-nav__item">
1807 <a href=
"../../../tutorial/series/part_1/" class=
"md-nav__link">
1818 <li class=
"md-nav__item">
1819 <a href=
"../../../tutorial/series/part_2/" class=
"md-nav__link">
1830 <li class=
"md-nav__item">
1831 <a href=
"../../../tutorial/series/part_3/" class=
"md-nav__link">
1858 <div class=
"md-sidebar md-sidebar--secondary" data-md-component=
"sidebar" data-md-type=
"toc" >
1859 <div class=
"md-sidebar__scrollwrap">
1860 <div class=
"md-sidebar__inner">
1862 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
1868 <label class=
"md-nav__title" for=
"__toc">
1869 <span class=
"md-nav__icon md-icon"></span>
1872 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
1874 <li class=
"md-nav__item">
1875 <a href=
"#comments" class=
"md-nav__link">
1881 <li class=
"md-nav__item">
1882 <a href=
"#event-listeners" class=
"md-nav__link">
1888 <li class=
"md-nav__item">
1889 <a href=
"#email-activation" class=
"md-nav__link">
1895 <li class=
"md-nav__item">
1896 <a href=
"#addform" class=
"md-nav__link">
1902 <li class=
"md-nav__item">
1903 <a href=
"#user-generated-links" class=
"md-nav__link">
1904 User Generated Links
1909 <li class=
"md-nav__item">
1910 <a href=
"#resource-management-when-scaling-images" class=
"md-nav__link">
1911 Resource Management When Scaling Images
1916 <li class=
"md-nav__item">
1917 <a href=
"#toggle-for-accelerated-mobile-pages-amp" class=
"md-nav__link">
1918 Toggle for Accelerated Mobile Pages (AMP)
1931 <div class=
"md-content" data-md-component=
"content">
1932 <article class=
"md-content__inner md-typeset">
1935 <a href=
"https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/migration/wsc52/php.md" title=
"Edit this page" class=
"md-content__button md-icon">
1936 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
1940 <h1 id=
"migrating-from-wsc-52-php">Migrating from WSC
5.2 - PHP
<a class=
"headerlink" href=
"#migrating-from-wsc-52-php" title=
"Permanent link">#
</a></h1>
1941 <h2 id=
"comments">Comments
<a class=
"headerlink" href=
"#comments" title=
"Permanent link">#
</a></h2>
1942 <p>The
<a href=
"https://github.com/WoltLab/WCF/blob/aa96d34130d58c150a35ebd8936f09c830ccd685/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php#L151-L158"><code>ICommentManager::isContentAuthor(Comment|CommentResponse): bool
</code></a> method was added.
1943 A default implementation that always returns
<code>false
</code> is available when inheriting from
<code>AbstractCommentManager
</code>.
</p>
1944 <p>It is strongly recommended to implement
<code>isContentAuthor
</code> within your custom comment manager.
1945 An example implementation
<a href=
"https://github.com/WoltLab/WCF/blob/aa96d34130d58c150a35ebd8936f09c830ccd685/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php#L213-L219">can be found in
<code>ArticleCommentManager
</code></a>.
</p>
1946 <h2 id=
"event-listeners">Event Listeners
<a class=
"headerlink" href=
"#event-listeners" title=
"Permanent link">#
</a></h2>
1947 <p>The
<a href=
"https://github.com/WoltLab/WCF/blob/75631516d45f9355f6c73d6375bf804d2abd587e/wcfsetup/install/files/lib/system/event/listener/AbstractEventListener.class.php"><code>AbstractEventListener
</code></a> class was added.
1948 <code>AbstractEventListener
</code> contains an implementation of
<code>execute()
</code> that will dispatch the event handling to dedicated methods based on the
<code>$eventName
</code> and, in case of the event object being an
<code>AbstractDatabaseObjectAction
</code>, the action name.
</p>
1949 <p>Find the details of the dispatch behavior within the class comment of
<code>AbstractEventListener
</code>.
</p>
1950 <h2 id=
"email-activation">Email Activation
<a class=
"headerlink" href=
"#email-activation" title=
"Permanent link">#
</a></h2>
1951 <p>Starting with WoltLab Suite
5.3 the user activation status is independent of the email activation status.
1952 A user can be activated even though their email address has not been confirmed, preventing emails being sent to these users.
1953 Going forward the new
<code>User::isEmailConfirmed()
</code> method should be used to check whether sending automated emails to this user is acceptable.
1954 If you need to check the user's activation status you should use the new method
<code>User::pendingActivation()
</code> instead of relying on
<code>activationCode
</code>.
1955 To check, which type of activation is missing, you can use the new methods
<code>User::requiresEmailActivation()
</code> and
<code>User::requiresAdminActivation()
</code>.
</p>
1956 <h2 id=
"addform"><code>*AddForm
</code><a class=
"headerlink" href=
"#addform" title=
"Permanent link">#
</a></h2>
1957 <p>WoltLab Suite
5.3 provides a new framework to allow the administrator to easily edit newly created objects by adding an edit link to the success message.
1958 To support this edit link two small changes are required within your
<code>*AddForm
</code>.
</p>
1961 <p>Update the template.
</p>
1963 <div class=
"highlight"><pre><span></span><code><span class=
"cp">{
</span><span class=
"nf">include
</span> <span class=
"na">file
</span><span class=
"o">=
</span><span class=
"s1">'formError
'</span><span class=
"cp">}
</span><span class=
"x"></span>
1965 <span class=
"cp">{
</span><span class=
"nf">if
</span> <span class=
"nv">$success
</span><span class=
"o">|
</span><span class=
"na">isset
</span><span class=
"cp">}
</span><span class=
"x"></span>
1966 <span class=
"x"> <p class=
"success
"></span><span class=
"cp">{
</span><span class=
"nf">lang
</span><span class=
"cp">}
</span><span class=
"x">wcf.global.success.
</span><span class=
"cp">{
</span><span class=
"nv">$action
</span><span class=
"cp">}{
</span><span class=
"nf">/lang
</span><span class=
"cp">}
</span><span class=
"x"></p
></span>
1967 <span class=
"cp">{
</span><span class=
"nf">/if
</span><span class=
"cp">}
</span><span class=
"x"></span>
1968 </code></pre></div></p>
1970 <div class=
"highlight"><pre><span></span><code><span class=
"cp">{
</span><span class=
"nf">include
</span> <span class=
"na">file
</span><span class=
"o">=
</span><span class=
"s1">'formNotice
'</span><span class=
"cp">}
</span><span class=
"x"></span>
1971 </code></pre></div></p>
1974 <p>Expose
<code>objectEditLink
</code> to the template.
</p>
1975 <p>Example (
<code>$object
</code> being the newly created object):
1976 <div class=
"highlight"><pre><span></span><code><span class=
"nx">WCF
</span><span class=
"o">::
</span><span class=
"na">getTPL
</span><span class=
"p">()
</span><span class=
"o">-
></span><span class=
"na">assign
</span><span class=
"p">([
</span>
1977 <span class=
"s1">'success
'</span> <span class=
"o">=
></span> <span class=
"k">true
</span><span class=
"p">,
</span>
1978 <span class=
"s1">'objectEditLink
'</span> <span class=
"o">=
></span> <span class=
"nx">LinkHandler
</span><span class=
"o">::
</span><span class=
"na">getInstance
</span><span class=
"p">()
</span><span class=
"o">-
></span><span class=
"na">getControllerLink
</span><span class=
"p">(
</span><span class=
"nx">ObjectEditForm
</span><span class=
"o">::
</span><span class=
"na">class
</span><span class=
"p">,
</span> <span class=
"p">[
</span><span class=
"s1">'id
'</span> <span class=
"o">=
></span> <span class=
"nv">$object
</span><span class=
"o">-
></span><span class=
"na">objectID
</span><span class=
"p">]),
</span>
1979 <span class=
"p">]);
</span>
1980 </code></pre></div></p>
1983 <h2 id=
"user-generated-links">User Generated Links
<a class=
"headerlink" href=
"#user-generated-links" title=
"Permanent link">#
</a></h2>
1984 <p>It is
<a href=
"https://support.google.com/webmasters/answer/96569">recommended by search engines
</a> to mark up links within user generated content using the
<code>rel=
"ugc"</code> attribute to indicate that they might be less trustworthy or spammy.
</p>
1985 <p>WoltLab Suite
5.3 will automatically sets that attribute on external links during message output processing.
1986 Set the new
<code>HtmlOutputProcessor::$enableUgc
</code> property to
<code>false
</code> if the type of message is not user-generated content, but restricted to a set of trustworthy users.
1987 An example of such a type of message would be official news articles.
</p>
1988 <p>If you manually generate links based off user input you need to specify the attribute yourself.
1989 The
<code>$isUgc
</code> attribute was added to
<a href=
"https://github.com/WoltLab/WCF/blob/af245d7b9bdb411a344f79c0a038350c1f103e70/wcfsetup/install/files/lib/util/StringUtil.class.php#L664-L673"><code>StringUtil::getAnchorTag(string, string, bool, bool): string
</code></a>, allowing you to easily generate a correct anchor tag.
</p>
1990 <p>If you need to specify additional HTML attributes for the anchor tag you can use the new
<a href=
"https://github.com/WoltLab/WCF/blob/af245d7b9bdb411a344f79c0a038350c1f103e70/wcfsetup/install/files/lib/util/StringUtil.class.php#L691-L699"><code>StringUtil::getAnchorTagAttributes(string, bool): string
</code></a> method to generate the anchor attributes that are dependent on the target URL.
1991 Specifically the attributes returned are the
<code>class=
"externalURL"</code> attribute, the
<code>rel=
"…"</code> attribute and the
<code>target=
"…"</code> attribute.
</p>
1992 <p>Within the template the
<a href=
"../../../view/template-plugins/#53-anchorattributes"><code>{anchorAttributes}
</code></a> template plugin is newly available.
</p>
1993 <h2 id=
"resource-management-when-scaling-images">Resource Management When Scaling Images
<a class=
"headerlink" href=
"#resource-management-when-scaling-images" title=
"Permanent link">#
</a></h2>
1994 <p>It was discovered that the code holds references to scaled image resources for an unnecessarily long time, taking up memory.
1995 This becomes especially apparent when multiple images are scaled within a loop, reusing the same variable name for consecutive images.
1996 Unless the destination variable is explicitely cleared before processing the next image up to two images will be stored in memory concurrently.
1997 This possibly causes the request to exceed the memory limit or ImageMagick's internal resource limits, even if sufficient resources would have been available to scale the current image.
</p>
1998 <p>Starting with WoltLab Suite
5.3 it is recommended to clear image handles as early as possible.
1999 The usual pattern of creating a thumbnail for an existing image would then look like this:
</p>
2000 <div class=
"highlight"><pre><span></span><code><span class=
"o"><?
</span><span class=
"nx">php
</span>
2001 <span class=
"k">foreach
</span> <span class=
"p">([
</span> <span class=
"mi">200</span><span class=
"p">,
</span> <span class=
"mi">500</span> <span class=
"p">]
</span> <span class=
"k">as
</span> <span class=
"nv">$size
</span><span class=
"p">)
</span> <span class=
"p">{
</span>
2002 <span class=
"nv">$adapter
</span> <span class=
"o">=
</span> <span class=
"nx">ImageHandler
</span><span class=
"o">::
</span><span class=
"na">getInstance
</span><span class=
"p">()
</span><span class=
"o">-
></span><span class=
"na">getAdapter
</span><span class=
"p">();
</span>
2003 <span class=
"nv">$adapter
</span><span class=
"o">-
></span><span class=
"na">loadFile
</span><span class=
"p">(
</span><span class=
"nv">$src
</span><span class=
"p">);
</span>
2004 <span class=
"nv">$thumbnail
</span> <span class=
"o">=
</span> <span class=
"nv">$adapter
</span><span class=
"o">-
></span><span class=
"na">createThumbnail
</span><span class=
"p">(
</span>
2005 <span class=
"nv">$size
</span><span class=
"p">,
</span>
2006 <span class=
"nv">$size
</span><span class=
"p">,
</span>
2007 <span class=
"k">true
</span>
2008 <span class=
"p">);
</span>
2009 <span class=
"nv">$adapter
</span><span class=
"o">-
></span><span class=
"na">writeImage
</span><span class=
"p">(
</span><span class=
"nv">$thumbnail
</span><span class=
"p">,
</span> <span class=
"nv">$destination
</span><span class=
"p">);
</span>
2010 <span class=
"c1">// New: Clear thumbnail as soon as possible to free up the memory.
</span>
2011 <span class=
"nv">$thumbnail
</span> <span class=
"o">=
</span> <span class=
"k">null
</span><span class=
"p">;
</span>
2012 <span class=
"p">}
</span>
2014 <p>Refer to
<a href=
"https://github.com/WoltLab/WCF/pull/3505">WoltLab/WCF#
3505</a> for additional details.
</p>
2015 <h2 id=
"toggle-for-accelerated-mobile-pages-amp">Toggle for Accelerated Mobile Pages (AMP)
<a class=
"headerlink" href=
"#toggle-for-accelerated-mobile-pages-amp" title=
"Permanent link">#
</a></h2>
2016 <p>Controllers delivering AMP versions of pages have to check for the new option
<code>MODULE_AMP
</code> and the templates of the non-AMP versions have to also check if the option is enabled before outputting the
<code><link
rel=
"amphtml" /
></code> element.
</p>
2022 <div class=
"md-source-date">
2025 Last update:
2021-
01-
08
2044 <footer class=
"md-footer">
2046 <nav class=
"md-footer__inner md-grid" aria-label=
"Footer">
2048 <a href=
"../../wsc53/libraries/" class=
"md-footer__link md-footer__link--prev" rel=
"prev">
2049 <div class=
"md-footer__button md-icon">
2050 <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>
2052 <div class=
"md-footer__title">
2053 <div class=
"md-ellipsis">
2054 <span class=
"md-footer__direction">
2057 Third Party Libraries
2063 <a href=
"../templates/" class=
"md-footer__link md-footer__link--next" rel=
"next">
2064 <div class=
"md-footer__title">
2065 <div class=
"md-ellipsis">
2066 <span class=
"md-footer__direction">
2069 Templates and Languages
2072 <div class=
"md-footer__button md-icon">
2073 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
2079 <div class=
"md-footer-meta md-typeset">
2080 <div class=
"md-footer-meta__inner md-grid">
2081 <div class=
"md-footer-copyright">
2083 <div class=
"md-footer-copyright__highlight">
2084 Copyright ©
2020 WoltLab GmbH
2088 <a href=
"https://squidfunk.github.io/mkdocs-material/" target=
"_blank" rel=
"noopener">
2093 <div class=
"md-footer-copyright">
2094 <a href=
"https://www.woltlab.com/legal-notice/">Legal Notice
</a>
2095 <a href=
"https://www.woltlab.com/privacy-policy/">Privacy Policy
</a>
2102 <div class=
"md-dialog" data-md-component=
"dialog">
2103 <div class=
"md-dialog__inner md-typeset"></div>
2105 <script id=
"__config" type=
"application/json">{
"base":
"../../..",
"features": [],
"translations": {
"clipboard.copy":
"Copy to clipboard",
"clipboard.copied":
"Copied to clipboard",
"search.config.lang":
"en",
"search.config.pipeline":
"trimmer, stopWordFilter",
"search.config.separator":
"[\\s\\-]+",
"search.placeholder":
"Search",
"search.result.placeholder":
"Type to start searching",
"search.result.none":
"No matching documents",
"search.result.one":
"1 matching document",
"search.result.other":
"# matching documents",
"search.result.more.one":
"1 more on this page",
"search.result.more.other":
"# more on this page",
"search.result.term.missing":
"Missing"},
"search":
"../../../assets/javascripts/workers/search.fe42c31b.min.js",
"version": {
"provider":
"mike"}}
</script>
2108 <script src=
"../../../assets/javascripts/bundle.d892486b.min.js"></script>