Non-complicated way to display configuration for a given wiki?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Non-complicated way to display configuration for a given wiki?

Tim Landscheidt
Hi,

to test changes to operations/mediawiki-config, I'd like to
display the settings for a given wiki.

So far I figured out:

| <?php

| $IP = 'wmf-config';
| $cluster = 'pmtpa';

| require ('/home/tim/public_html/w/includes/SiteConfiguration.php');
| require ('wmf-config/wgConf.php');

| var_dump ($wgConf->getAll ([...]));

However, all my creativity regarding parameters to getAll()
only returned an empty array.

What would be the parameters needed for example to get the
settings for de.wikipedia.org?

TIA,
Tim


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Non-complicated way to display configuration for a given wiki?

Nathan Larson
On Fri, Jan 24, 2014 at 9:35 AM, Tim Landscheidt <[hidden email]>wrote:

> Hi,
>
> to test changes to operations/mediawiki-config, I'd like to
> display the settings for a given wiki.
>
> So far I figured out:
>
> | <?php
>
> | $IP = 'wmf-config';
> | $cluster = 'pmtpa';
>
> | require ('/home/tim/public_html/w/includes/SiteConfiguration.php');
> | require ('wmf-config/wgConf.php');
>
> | var_dump ($wgConf->getAll ([...]));
>
> However, all my creativity regarding parameters to getAll()
> only returned an empty array.
>
> What would be the parameters needed for example to get the
> settings for de.wikipedia.org?


Are you saying you want to display the settings for your own wiki or
someone else's wiki (whose backend you can't access)? If it's your own
wiki, you can use
ViewFiles<https://www.mediawiki.org/wiki/Extension:ViewFiles>to let
people access a special page that will display a configuration file.
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Non-complicated way to display configuration for a given wiki?

Tim Landscheidt
In reply to this post by Tim Landscheidt
I wrote:

> [...]

> However, all my creativity regarding parameters to getAll()
> only returned an empty array.

> What would be the parameters needed for example to get the
> settings for de.wikipedia.org?

Some further debugging showed that $wgConf->settings didn't
get set.  This code works with "php dumpSettings.php
zhwikivoyage":

| <?php

| $IP = 'wmf-config';
| $cluster = 'pmtpa';
| $wmfConfigDir = $IP;

| require ('/home/tim/public_html/w/includes/SiteConfiguration.php');
| require ('multiversion/MWRealm.php');
| require ('wmf-config/wgConf.php');
| require ('/home/tim/public_html/w/includes/Defines.php');
| require ('wmf-config/InitialiseSettings.php');

| var_dump ($argv [1], $wgConf->getAll ($argv [1]));

Testing it for example on
https://gerrit.wikimedia.org/r/109076/ shows changes in
wgAddGroups/sysop and wgRemoveGroups/sysop as expected.

Tim


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Non-complicated way to display configuration for a given wiki?

Tim Landscheidt
In reply to this post by Nathan Larson
Nathan Larson <[hidden email]> wrote:

> [...]

> Are you saying you want to display the settings for your own wiki or
> someone else's wiki (whose backend you can't access)? If it's your own
> wiki, you can use
> ViewFiles<https://www.mediawiki.org/wiki/Extension:ViewFiles>to let
> people access a special page that will display a configuration file.

No, I meant the repository where the MediaWiki configuration
of the Wikimedia cluster resides
(cf. http://git.wikimedia.org/summary/?r=operations/mediawiki-config.git),
and I want to display the settings of one of many configured
wikis.

My use case at hand is the migration of wiki.toolserver.org
to WMF.  The former uses a traditional LocalSettings.php,
and I want to test whether a patch to
operations/mediawiki-config results in an equivalent config-
uration.

Tim


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l