Cli/guide/Docker-Development-Environment

Provides interaction with mediawiki-docker-dev like developer environment

First Setup
If you already have a LocalSettings.php file from a previous developer environment, see the LocalSettings.php section below before starting.

You can get started with a basic MediaWiki installation, first creating the needed services.

First setup might take some time as docker images, code and dependencies will be fetched.

And then performing a MediaWiki install

You'll then have a MediaWiki install running on SQLite accessible at http://default.mediawiki.mwdd.localhost:8080/

LocalSettings.php
The development environment automatically sets various MediaWiki settings, such as database details. In order to do this it needs a "shim" at the top of your LocalSettings.php file.

When starting with a fresh install this will be created by the setup wizard.

If you already have a LocalSettings.php file, then you'll need to add the below snippet, removing any that may have been included from other environments.

If you are migrating from a previous version of mediawiki-docker-dev you might want to run both setups side by side.}}

Conditionally load the settings files provided by both the old and new development environment.

MySQL Setup
You'll then have a MediaWiki install running on SQLite accessible at http://mysqlwiki.mediawiki.mwdd.localhost:8080/

If you want to see the database in a UI, try using the adminer or phpmyadmin services.

Other services
All services follow similar patterns of create, suspect, resume, destroy.

Services will generally be automatically configured with MediaWiki when they are run.

Using XDebug for MediaWiki
Requires a mwcli dev build on or after 27 June 2021.

The default XDebug mode is develop,debug, and the debugger will try to connect to localhost:9003.

If you want to alter the XDebug config you can do so using an environment variable.

Triggering for requests
See https://xdebug.org/docs/step_debug#activate_debugger

Example triggering from CLI:

Alter a container environment variable
If you want to alter an environment variable on a container, you'll need to re create the container after the change.

For example:

You should see that the container recreates:

Known TODOs

 * - Docs for debugger workflows
 * - Make use of a composer cache from the host
 * - Automatic hosts file alterations
 * - MediaWiki log file permissions issues