Manual talk:Writing maintenance scripts

About this board

Extension maintence script and extnsion configuration

1
Alex Mashin (talkcontribs)

Rewriting an old extension to use extension.json, I have found out that a maintenance script provided by the extension has no access in ...::finalSetup() to the extensions settings as defined in extension.json. However, the settings from LocalSettings.php are available.

It does not matter whether I try to access setting via global variables or $this->getConfig().

There is $this->requireExtension( 'my extension' ); call in the maintenance class constructor.

When MediaWiki is invoked by the web server, all the settings are available, and extension.json and LocalSettings.php are merged correctly.

Is there anything more to do?

Reply to "Extension maintence script and extnsion configuration"

$this->output rather than echo?

1
Karl Wettin (WMSE) (talkcontribs)

It's recommended to use $this->output( "foo" ) rather than echo "foo". Should we perhaps make this change to the examples on this page? Or are the examples meant to illustrate the use on a more abstract level? I personally based my first scripts on this page and thus ended up with echo. :)

Reply to "$this->output rather than echo?"

Please discuss why --conf=LocalSettings.php is ignored

1
Noloader (talkcontribs)

I find this most frustrating. We have a well maintained LocalSettings.php. It include all the operational parameters of the wiki, including the wiki name, the locations, the database user and the database password.

Yet nearly every maintenance script fails for missing parameters even though we run the scripts with --conf=LocalSettings.php. We don't really know what more we need to do when running scripts.

The ones that really confuse us are -dbuser (already supplied via $wgDBuser), -dbpass (already supplied via $wgDBpassword), and --prefix (already supplied via $wgDBprefix).

Unfortunately, we don't know what to supply for arguments like --dbgroupdefault. As far as we know there is no such thing. But the various docs don't discuss what it should be.

If this is a bug in the maintenance scripts, then please discuss it and the workarounds.

Reply to "Please discuss why --conf=LocalSettings.php is ignored"
There are no older topics
Return to "Writing maintenance scripts" page.