User:Santhosh.thottingal/WikiFamily

This is a guide to set up a wiki family with multiple mediawiki instances with different languages. We will use mwcli for this.

Download latest mwcli application from its releases page. Installation instructions can be found on Cli/guide/Installation.

Download and Install mediawiki This will ask many questions related to the installation, including path to checkout the code.

Then install the mysql database Now, we can create the wikis as per our requirement.

We gave  as dbname just to associate it with English language wiki. Using the dbname same as the language name also helps to map languages to wikis.

We can create any number of wikis as per our requirement as follows You can access each of this wikis using the following URL http://en.mediawiki.mwdd.localhost:8080, http://ig.mediawiki.mwdd.localhost:8080 etc. Note that all of them will be in English. We will soon map them to corresponding languages.

mwcli will create a LocalSettings.php in the root folder of mediawiki source code it fetched in first step. It will have only one line Below this line you can add extension installations and their configurations as usual.

To map each with with different languages, add the following line to LocalSettings.php Now all the wikis created above will have its own language just like production wikipedia has.

Additional Services
To add new services that are not part of mwcli, follow these steps.

Let us add cxserver nodejs service to mwcli.

As a first step, setup cxserver (MediaWiki-Docker/Extension/ContentTranslation).

Then, find out the location of mwcli docker configuration files: On Linux systems, it will be. Add the source code path to .env file in the same directory. For example: Then create a file named  and add the service docker-compose. Example: The service can be started using And it can be accessed by using the URL http://cxserver.mwdd.localhost:8080

Installing Adminer for database administration
Adminer is very useful to interact with mysql database Adminer can be now accessed from http://adminer.mwdd.localhost:8080/

Note the the username is, password is  , server is   and database is   or other language codes we used when creating wikis

Installing eventlogging service for EventLogging
Create the eventlogging service The events registered by mediawiki and extension can be viewed by looking at the logs of eventlogging service.

Installing ContentTranslation extension
To the extensions folder of mediawiki, clone the extension and dependent extensions Then add the required settings to LocalSettings.php The database tables required for CX wont be created by the above steps. We have to create them manually. Adminer can be very helpful there. Go to adminer, create a new database names  as we gave it in the above settings. Use the sql scripts from  folder of ContentTranslation database to create tables.

In the above configuration, please note the. It uses the multi-language wiki URL patterns by mwcli so that CX's inter domain navigation works well. We also set the cookie domain to support this. We also used the Cxserver URL that we created above.

Updating
To run update script in the mediawiki instances, follow these steps Provide your own wiki names instead of bn above. In this tutorial, we were using wikinames same as language codes.

Running phpunit
For integration tests with phpunit, provide the wikiname as follows. For unit tests, this is not required. Not providing PHPUNIT_WIKI will result 'Database not found' errors.

Step Debugging
To get step debugging working using XDebug, you are welcome to view the documentation on Cli/guide/Docker-Development-Environment/MediaWiki. In a nutshell, it is important to include  which informs the docker containers of your local IP and what port XDebug will be running on. Your .env file under your mwcli docker configuration files which you can get a path to using: should look something like this: After, it's important to restart your mediawiki services using