Local development quickstart/ha
This page is a quickstart guide to setting up a local development for MediaWiki using PHP and Composer.
Shigar da abubuwan da ake bukata
MediaWiki yana buƙatar PHP 7.4.3+ da Mawaƙa 2.
Linux
A kan Ubuntu 22+ ko Debian 11+, shigar da fakitin da ake buƙata ta amfani da APT.
sudo apt install -y php php-intl php-mbstring php-xml php-apcu php-curl php-sqlite3 composer
A kan Ubuntu 20, shigar da PHP daga APT, amma shigar da Mawaƙi daga getcomposer.org/download.
sudo apt install -y php php-intl php-mbstring php-xml php-apcu php-curl php-sqlite3
A kan Fedora 35+, shigar da fakitin da ake buƙata ta amfani da DNF.
sudo dnf install -y php composer
A kan Arch Linux, shigar da fakitin da ake buƙata ta amfani da pacman.
sudo pacman -S php composer --noconfirm
Mac
Shigar da fakitin da ake buƙata ta amfani da Homebrew.
brew install php composer
Windows
Kuna da zaɓi don amfani da Windows Subsystem don Linux kuma ku bi umarnin Linux akan wannan shafin. Ko, don shigar MediaWiki kai tsaye akan Windows, shigar da fakitin da ake buƙata ta amfani da Chocolatey.
choco install -y php composer
Don loda kari na PHP da ake buƙata, shirya fayil ɗin php.ini, kuma ba da amsa ga layukan masu zuwa.
Don nemo wurin php.ini, gudu php --ini
, kuma nemi Fayil Kanfigareshan Loaded.
extension:fileinfo
extension:intl
extension:pdo_sqlite
extension:zip
Clone MediaWiki
Yi amfani da Git don rufe ainihin ma'ajiyar MediaWiki da tsohuwar fata.
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
Cloning MediaWiki yana ɗaukar mintuna kaɗan. Yayin da kuke jira, ƙirƙiri asusun haɓaka Wikimedia idan baku da ɗaya.
Shigar da abin dogaro
Daga cikin tushen tushen MediaWiki, yi amfani da Mawaƙi don shigar da abin dogaro na MediaWiki.
composer update
Shigar MediaWiki
Sanya MediaWiki tare da ginanniyar bayanan SQLite na PHP.
composer mw-install:sqlite
Fara uwar garken
Fara ginanniyar sabar gidan yanar gizo na PHP, kuma buɗe localhost:4000 a cikin mazugi don ganin misalin MediaWiki na ku.
Don shiga azaman mai gudanarwa , yi amfani da sunan mai amfani Admin
da kalmar sirri adminpassword
.
composer serve
Matakai na gaba
- Take a tour of the MediaWiki codebase – Sanin kanku da ainihin lambar MediaWiki ta koyo game da wuraren shigarwa da manyan kundayen adireshi.
- Run unit tests – MediaWiki yana amfani da tsarin PHPUnit don naúrar da gwajin haɗin kai na lambar PHP. Karanta takaddun don gudanar da gwaje-gwaje kuma nemo bayanai game da gwajin rubutu.
- Install extensions – Ƙara kari, kamar VisualEditor da Echo , zuwa yanayin ci gaban ku. Duba Manual:Developing extensions don koyo game da yadda kari ke aiki.
- Debug your code – Koyi yadda ake saita kayan aikin gyara kurakurai, da kuma cire lambar MediaWiki mataki-mataki tare da XDebug.
- Submit a patch – Bincika good first bugs , kuma daidaita hanyar SSH zuwa Wikimedia Gerrit don ƙaddamar da faci.