User:Mainframe98/Vagrant

This page describes how to do certain things on MediaWiki-Vagrant.

Running unit tests
I recommend creating a quick script:

Generating test coverage
I recommend creating a quick script:

Running phan
This is a chore, but T234240 should make this easier.
 * 1) Install phan as a composer dev dependency in MediaWiki.
 * 2) * Navigate to  and run composer require phan/phan --dev
 * 3) Install pear wherever. The home directory works fine, as long as you don't mind pear complaining about include paths, which are irrelevant for running phan.
 * 4) Download pear with wget http://pear.php.net/go-pear.phar
 * 5) Execute the installer with php go-pear.phar . When prompted, just press enter, the default will do.
 * 6) Install the php-ast extension, by running pecl install ast . You'll likely need to run this as a user with additional privileges, so prefix this with sudo
 * 7) * Note that the installer does not add pear and pecl to PATH, so you'll need to navigate to the folder with the executable!
 * 8) Add   to
 * 9) Check that php-ast is installed by running php -m
 * 10) Change the default vagrant memory size, as the default of 1.5G is insufficient to run phan, by creating a   in the vagrant root directory with the following content:
 * You may replace 3072 with any higher value, as this is the new memory size of the vagrant box in megabytes.

You should now be able to run phan with /vagrant/mediawiki/vendor/bin/phan -d PATH_TO_SOMETHING -p