User:Mainframe98/Notes

This page contains notes about MediaWiki I collect(ed) during my journeys while working with or on the software.

On Extension:Translate

 * TODO: There's more where this came from

Deleting

 * Using ?action=delete will remove the whole page; it's translations and the translation units.

Install.php

 * Flags --dbuser and --dbpass(file) work for general installing. They will result in the accompanying values finding themselves a nice and snug place in LocalSettings.php.
 * So do flags --installdbuser and --installdbpass(file), but their values don't end up in LocalSettings.php.
 * In case both are set, undocumented behavior appears: the values for --dbuser and --dbpass(file) are used by the installer to create a new account with those credentials, using the installdbuser and installdbpass credentials during the installation.
 * However, this does not happen if both values are equal to each other.

MediaWiki-Vagrant

 * Enabling the Echo and Flow role also installs CentralAuth and some other extensions but does not enable that role.
 * In the rare case that an enabled role has composer dependencies that have been installed are not loaded, rebooting the vagrant virtual machine with vagrant reload can resolve the issue.

Debugging MediaWiki maintenance scripts run on MediaWiki-Vagrant with PhpStorm

 * This is an absolute pain.


 * 1) Ensure you've correctly setup PhpStorm to detect Vagrant.
 * 2) * MediaWiki-Vagrant/Advanced usage
 * 3) Setup a PHP Script in the Run/Debug Configurations screen, which can be reached by clicking Run > Edit Configurations...
 * 4) * The script file MUST be MWScript.php! Maintenance scripts will not work otherwise.
 * 5) * Add the path to the script as you'd have done with MWScript regularly as the first argument
 * 6) Comment out the security check in MWScript.php

Running unit tests

 * Whenever an error message related to TestUser.php is shown (before it can run any tests), then this could be caused by, whenever it is set to anything higher than.

Running unit tests for Code sniffer
Which is a pain on Windows. However, you can get it to run (with the usual line ending failures) by removing the $PHPUNIT_ARGS from composer.json.

To run an individual sniff test, you'll have to run vendor/bin/phpunit -c ./ --filter MediaWikiStandardTest::testFile@SNIFF_NAME.php. Replace testFile with testFix to test the autofix.

Creating a new project

 * Think extension, library, skin or what have you.


 * 1) Request a gerrit repository: Gerrit/New repositories/Requests.
 * 2) Request a project on Phabricator: https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=Project-Admins
 * 3) Add CI, depending on your needs:
 * 4) * Continuous integration/Tutorials/Adding a MediaWiki extension
 * 5) * Continuous integration/Tutorials/Add phan to a MediaWiki extension
 * 6) * Continuous integration/Tutorials/Adding your extension to the shared gate job
 * 7) * Continuous integration/Tutorials/Generating PHP test coverage for a MediaWiki extension
 * 8) (optional) Add i18n support from Translatewiki.net: Gerrit/L10n-bot