Início rápido de desenvolvimento local
Esta página é um guia de início rápido para configurar um desenvolvimento local para o MediaWiki utilizando PHP e Composer.
Pré-requisitos de instalação
MediaWiki requer PHP 8.2.0+ e Composer 2.
Linux
No Ubuntu 22+ ou Debian 12+, instale os pacotes necessários utilizando APT.
sudo apt install php php-intl php-mbstring php-xml php-apcu php-curl php-sqlite3 composer
No Fedora 36+, instale os pacotes necessários utilizando DNF.
sudo dnf install php composer
No Arch Linux, instale os pacotes necessários utilizando pacman.
sudo pacman -S php composer
Mac
Install the required packages using Homebrew and make it the active version of PHP, by linking it.
brew install php@8.2 composer
brew link --overwrite php@8.2
If the following command succeeds, it should show the PHP version. If it fails, likely your $PATH is not configured to find commands from brew.
php -v
Windows
You have the option to use the Windows Subsystem for Linux and follow the Linux instructions on this page. Or, to install MediaWiki directly on Windows, install the required packages using Chocolatey.
choco install -y php composer
To load the required PHP extensions, edit your php.ini file, and uncomment the following lines.
To find the location of php.ini, run php --ini, and look for Loaded Configuration File.
extension:fileinfo
extension:intl
extension:pdo_sqlite
extension:zip
extension:sodium
Clonar MediaWiki
Utilize Git para clonar o repositório principal do MediaWiki e o tema predefinido.
git clone https://gerrit.wikimedia.org/r/mediawiki/core.git mediawiki
git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git mediawiki/skins/Vector
cd mediawiki
Clonar o MediaWiki demora alguns minutos. While you're waiting, if you plan to create and share patches, create a Wikimedia developer account if you don't already have one.
Instalar dependências
From within your mediawiki directory, created above, use Composer to install MediaWiki's dependencies.
composer update
Instalar o MediaWiki
Instale o MediaWiki com a base de dados SQLite integrada no PHP.
composer mw-install:sqlite
Iniciar servidor
Start PHP's built-in webserver, and open localhost:4000 in a browser to see your MediaWiki instance.
To log in as an administrator, use username Admin and password adminpassword.
composer serve
Passos seguintes
- Take a tour of the MediaWiki codebase – Familiarize yourself with MediaWiki's core code by learning about entry points and top-level directories.
- Executar testes de unidade – MediaWiki uses the PHPUnit framework for unit and integration testing of PHP code. Read the docs to run tests and find information about writing tests.
- Instalar extensões – Adicione extensões, tais como VisualEditor e Echo, ao seu meio de desenvolvimento. Consulte Manual: Desenvolvimento de Extensões para saber como funcionam as extensões.
- Depurar o seu código – Saiba como configurar os assistentes de depuração, e a depurar o código do MediaWiki passo a passo com o XDebug.
- Submeter uma correção (patch) – Explore Pequenos erros irritantes, e configure o acesso SSH para Wikimédia Gerrit para submeter uma correção.