Re: array syntax

Benjamin Lees <[email protected]>
Newsgroups gmane.org.wikimedia.mediawiki
Message-ID <CAL04nz9C5XEX5D2xxJavDPxZ-obm+m6MN0V22fHcFt2vYpVEoA@mail.gmail.com>
Hi Roger, that's still the syntax.  What are the errors you're getting?

On Tue, Feb 14, 2023 at 12:15 AM <[email protected]> wrote:

> Hello,
>
> I have some array declarations in my LocalSettings.php from many years ago
> that I am worried may not be compatible with PHP 8+. When I try to run
> /maintenance/update.php in PHP 8.1 I get errors. It runs fine in PHP 7.4.3,
> fortunately. However, is it okay to set arrays like this in PHP 8+?:
>
> $wgSitemapNamespaces = array( 0, 100, 102 );
>
> Thank you :)
>
> Roger
> teflpedia.com <- MediaWiki 1.39.1 recently upgraded
>
> -----example from my LocalSettings.php-----
>
> # Site Map see https://www.mediawiki.org/wiki/Manual:$wgSitemapNamespaces
> #$wgSitemapNamespaces = array( 0, 2, 4, 12 );  # example, to site map
> Main-0, User-2, Project-4, Help-12 namespace
> $wgSitemapNamespaces = array( 0, 100, 102 );  # let's site map ONLY Main,
> Essay, Lesson namespace
>
> ## Extra namespaces
> $wgExtraNamespaces[100] = "Lesson";
> $wgExtraNamespaces[101] = "Lesson_talk";
> $wgExtraNamespaces[102] = "Essay";
> $wgExtraNamespaces[103] = "Essay_talk";
> $wgExtraNamespaces[104] = "Debate";
> $wgExtraNamespaces[105] = "Debate_talk";
>
> ## Enable subpages in all namespaces
> $wgNamespacesWithSubpages = array_fill(0, 200, true);
> $wgNamespacesWithSubpages[NS_MAIN] = false; # per Duncan request Jan 11,
> 2022
>
>
> ## Set default searching. Roger 2012.11.03, updated array syntax 2023.02.13
> $wgNamespacesToBeSearchedDefault = [
>         NS_MAIN =>            true,
>         NS_TALK =>           false,
>         NS_USER =>           false,
>         NS_USER_TALK =>      false,
>         NS_PROJECT =>        false,
>         NS_PROJECT_TALK =>   false,
>         NS_IMAGE =>          false,
>         NS_IMAGE_TALK =>     false,
>         NS_MEDIAWIKI =>      false,
>         NS_MEDIAWIKI_TALK => false,
>         NS_TEMPLATE =>       false,
>         NS_TEMPLATE_TALK =>  false,
>         NS_HELP =>           false,
>         NS_HELP_TALK =>      false,
>         NS_CATEGORY =>       false,
>         NS_CATEGORY_TALK =>  false,
>         100 =>                true,
>         101 =>               false
> ];
>
> -------/example--------
>
> _______________________________________________
> MediaWiki-l mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>
> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/

_______________________________________________
MediaWiki-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.