Skip to content

Instantly share code, notes, and snippets.

@lucaswerkmeister
Last active July 21, 2023 13:49
Show Gist options
  • Save lucaswerkmeister/4cda7f1d146c912f7439251391397a16 to your computer and use it in GitHub Desktop.
Save lucaswerkmeister/4cda7f1d146c912f7439251391397a16 to your computer and use it in GitHub Desktop.
MediaWiki development helpers
#!/bin/sh
if [ $# -eq 0 ]; then
printf >&2 '%s: at least one argument is required\n' "$0"
exit 1
fi
if [ -e "$1" ]; then
file=$(realpath "$1")
else
file=$1
fi
shift 1
while ! [ -f api.php ]; do
cd ..
if [ "$PWD" = '/' ]; then
cd /var/www/html/wiki1/
break
fi
done
exec php maintenance/run.php "$file" "$@"
#!/bin/sh
exec maint shell
#!/bin/sh
basedir="$PWD"
while ! [ -f api.php ]; do
cd ..
if [ "$PWD" = '/' ]; then
printf >&2 '%s: no MediaWiki parent directory found\n' "$0"
exit 1
fi
done
if [ $# -gt 0 ]; then
path="$1"
shift
else
path='tests/phpunit/'
fi
exec composer phpunit:entrypoint "$basedir/$path" -- "$@"
@lucaswerkmeister
Copy link
Author

Usage examples:

phps # interactive PHP shell
maint runJobs
maint update --quick
maint rebuildLocalisationCache --lang en
run-tests
run-tests repo/tests/phpunit/includes/RepoHooksTest.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment