User:Mainframe98/Notes

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

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.