An example MediaWiki extension in connection with the "Manolito Future Day 2022".
UNDERSTAND: "Ubuntu 22.04" VirtualBox Virtual Machine
- VBox: start, stop, port forwarding
- VM: Bash | (ssh)
UNDERSTAND: manolitoWiki Docker stack
- Components: web server, database
- docker-compose: up, down
- docker: ps, logs, exec
UNDERSTAND: manolitoWiki
- LocalSettings.php (purpose)
wfLoadExtension("Manolito");
UNDERSTAND: mediawiki-extensions-Manolito
-
tree, git status|pull|push
CODE: PHP (backend, server-side, e.g. Apache)
/home/manolito/manolitoWiki/extensions/Manolito/src/Hooks.php Functionality: parser function call /home/manolito/manolitoWiki/extensions/Manolito/includes/specials/SpecialManolito.php Functionality: add special function to MediaWiki /home/manolito/manolitoWiki/extensions/Manolito/src/TextAccounting.php Functionality: implement parser function /home/manolito/manolitoWiki/extensions/Manolito/tests/phpunit/unit/ManolitoTest.php
-
Install dependencies
# On your machine running Docker manolito@manolito:~$ sudo docker exec -it manolitowiki_web_1 /bin/bash # Inside the Docker container at /var/www/mediawiki/w/ composer install
-
Run tests
# Inside the Docker container at /var/www/mediawiki/w/ php tests/phpunit/phpunit.php extensions/Manolito/tests/phpunit/unit/ManolitoTest.php
CODE: Javascript and CSS (frontend, client-side, e.g. Firefox browser)
/home/manolito/manolitoWiki/extensions/Manolito/resources/ext.manolito/manolito.js Functionality: write text into HTML element /home/manolito/manolitoWiki/extensions/Manolito/resources/ext.manolito/manolito.css Functionality: style/design user interface elements
/home/manolito/manolitoWiki/extensions/Manolito/cypress/e2e/spec.cy.js
-