MediaWiki hackeri olma

From mediawiki.org
This page is a translated version of the page How to become a MediaWiki hacker and the translation is 62% complete.
Outdated translations are marked like this.

Bu madde, geliştiricilerin MediaWiki çekirdeği ve MediaWiki uzantılarının geliştirilmesine katkıda bulunmak için gereken temel becerileri öğrenmelerine yardımcı olmak için yazılmıştır.

Wikimedia geliştirmeye başlamak için ana yol mentorluk sunan Wikimedia projelerine katkıda bulunmaktır. Mentorluk yapmadan bir alternatif iyi ilk hatayı düzeltmektir.

MediaWiki'yi zaten tanıdık deneyimli bir geliştiriciyseniz, onun yerine Geliştirici merkezi sayfasını ziyaret edin.

Wikimedia topluluğuna katılmanın diğer yolları için Nasıl katkıda bulunulur sayfasına bakın.

Genel bakış

MediaWiki, Vikipedi'nin, onun kardeş projelerinin ve binlerce vikinin tüm dünyada güç sağlayan bir yazılımdır.

MediaWiki PHP programlama dilinde yazılmış olsa da, toplu iş dosyaları, kabuk betiği, makefile ve Python dahil olmak üzere bazı destekleyici araçlar diğer dillerde yazılmıştır. JavaScript is used for providing interactive interface elements along with jQuery and Vue.js as client JavaScript libraries.

Some supporting tools are written in other languages, including batch files, shell scripts, makefiles and Python.

MediaWiki, öncelikle LAMP platformu için yazılmıştır [1] ve çoğu işletim sisteminde çalışır. MediaWiki öncelikle MySQL ve MariaDB veritabanı sunucularını kullanır.[2]

Geliştirme açık kaynak tarzında gerçekleşir,[3] gönüllü topluluk geliştiricileri de büyük bir rol oynar, ancak büyük ölçüde çevrimiçi olarak koordine edilir ve Wikimedia Vakfı tarafından desteklenir.

Ana geliştirici listesi wikitech-l. Ana geliştirici IRC kanalları #mediawiki bağlan ve #wikimedia-dev bağlan şeklindedir.

  • Kaynak kodu, Gerrit üzerinde depolanır ve Git revizyon kontrol sistemi kullanılarak yönetilir ve burada görüntülenebilir[4]
  • Hata raporları dosyalanır ve projeler Phabricator üzerinden koordine edilir ve buradan görüntülenebilir

Find or create a task

Before you ever develop a feature or fix a bug in a MediaWiki project, it is important that you do your research about it. This includes:

  1. Search Phabricator if an open or closed Task (Document Types field) already exists. If it doesn't, create one. If this is a very small change, don't create one.
  2. Find and investigate the code that needs to be changed to implement the feature. Comment your findings on the Phabricator Task if they might be helpful to others who implement it or review your changes.
  3. Determine if you can likely add the feature or fix the bug based the code you investigated and the changes needed. If the task is large or complex, you should find something easier and work your way up to eventually be able to handle tasks of that size. If you believe you can complete it, assign yourself to the Task and begin working on it.

Geliştirme ortamınızı kurun

Once you have found something you can work on, the next step to developing MediaWiki or an extension is creating an environment to run MediaWiki, its database, and any other external features so that you can develop and test them.

You can install and develop MediaWiki on Linux, Windows, or macOS using any of the three solutions below.

Docker geliştirme ortamı

  • MediaWiki Docker – MediaWiki'yi Docker kullanarak çalıştırın (Linux, Windows veya macOS ana bilgisayarlarında kullanılabilir).

Docker is a good option if you want to setup a MediaWiki installation quickly and are not planning on installing many extensions.

You can also try the mwcli tool which sets up Docker with a few simple commands and provides basic orchestration functionality between MediaWiki, MySQL, ElasticSearch, Memcached, and other types of containers.

Vagrant ile Sanal Makine

  • Vagrant kurulumu — Bu adımlar MediaWiki sunucusunu bir Linux sanal makinesi içerisindeki tüm gereksinimlerle birlikte yükleyecektir (Linux, Windows veya Mac bilgisayarlarda kullanılabilir).

Vagrant allows you start a MediaWiki instance you can develop as well as allowing you to add and develop any of 250+ extensions - all with a single command.

This saves you installation and configuration time compared to manually adding extensions in a Docker or local installation, but it runs a bit slower than the other two options.

El kurulum

Local installation is a good option if you want to set up a simple development environment quickly without using Docker.

Open a code editor

The two recommended code editors for editing MediaWiki are VSCode and PhpStorm. VSCode is free and PhpStorm is paid, however, you can acquire a PhpStorm license for free if you are a student by linking your GitHub Education account to your JetBrains account, or by requesting a license granted to Wikimedia.

To determine which editor you should install and use, know that all-around, PhpStorm has more and more-powerful features than VSCode. However, PhpStorm takes significantly longer to load on start than VSCode as it builds an index of the entire repository whereas VSCode progressively loads. Therefore, VSCode is typically useful for file-viewing sessions or small changes and PhpStorm for larger changes. It makes sense to have both installed for these reasons.

To develop the MediaWiki codebase that is inside a Docker container you can establish a remote connection to it and open the MediaWiki folder inside it using VSCode or PhpStorm.

Change and test the code

Change the code and view your changes by reloading your MediaWiki browser tab. Make sure to follow Manual:Coding conventions . Write and run tests on your code to make sure it works and is formatted properly.

Note, you can save time by ensuring your changes will be accepted before taking the time to write tests. Create a patch without needed tests and ask for someone to review it stating that you will add tests after they review it.

Create a patch

Finally, to submit your code to be reviewed and added to the repository you are contributing to, follow Gerrit/Eğitim .

İletişim ipuçları ve yönergeler

Bir geliştiricinin MediaWiki uzantısındaki bir sorguyu düzeltirken izleyin; bunlar arasında araştırma, git taahhüdü, gözden geçirilmesi ve birleştirilmesi ve Bugzilla biletinin kapatılması (artık Phabricator ile değiştirildi).

Follow these tips to communicate effectively and get help from community members.

Use Phabricator tasks effectively

When you plan to work on a Phabricator task:

  • No need to ask for permission: You can work on unassigned tasks without asking someone to assign them to you. There is no authority who assigns tasks or who needs to be asked first.
    • If a task already has a recent patch in Gerrit, choose a different task to work on instead.
    • If an existing patch in Gerrit has not been merged and has not seen any changes for a long time, you could improve that existing patch, based on the feedback in Gerrit and in the task.
  • Do your research: When you consider working on a task, do research before you start coding. Look at the code, try to understand what it is supposed to do, read related documentation, and try to find the places where you need to make code changes.
    • In a Phabricator task, use the project tags in the side bar to find the code repository for the task.
    • If you have no idea at all how to fix the bug, consider finding an easier one first.
  • You do not need to announce your plans before you start working on a task, but you should communicate that you are working on the task.
    • When you start work, set yourself as task assignee by clicking Edit Task… in Phabricator, and set your Phabricator username in the Assigned To field. This communicates to others that you are working on it, so they don't duplicate work.
    • When your plans or interests change: If you are no longer working on a task, remove yourself as the assignee of the task. This tells others that they can work on the task, and they won't expect you to still work on it.
  • Follow Phabricator etiquette.
    • In Phabricator tasks, discuss only specific questions about the topic of that task. Don't use Phabricator to ask general questions, like how to set up a development environment or how to fix problems with Gerrit.

Compose good questions

  • Don't ask to ask...just ask!.
  • Be specific and provide context: Instead of simply asking "Can you give me more info?", "Please guide me", or "Please tell me how to start", include the following information in your question:
    • What are you trying to achieve?
    • What have you already tried? Copy and paste your commands and their output (if not too long) instead of paraphrasing in your own words.
    • What have you found out already during your research? Include links to code, documentation, or other resources you already consulted.
  • Use specific titles and subject lines in your communication. "Proposal draft" or "Need help" is not specific.
  • Keep conversations readable: When you reply in Zulip, in Phabricator tasks, or on mailing lists, only quote sections of previous comments that are relevant to your response. If you quote a complete previous comment, it makes threads hard to read.

Follow communication policies and best practices

Before you send or post your question:

Ask in the right place

  • Ask in public: Do not send private messages if your conversation topic is not secret. Private messages don't help others.
  • Ask and discuss in the best place:
    • In Phabricator tasks, discuss only specific questions about the topic of that task.
    • Ask general technical questions, like how to set up a development environment or how to fix problems with Gerrit, in the places listed on İletişim .
    • If you take part in an outreach program, then Zulip is for discussing questions about the outreach programs themselves.

Be patient

After you post your question:

  • Do not ask people for code review in a separate message. People receive Gerrit and Phabricator notifications and will respond when they can.
  • When seeking input and comments, especially during weekends and holidays, you may need to wait until business hours resume. On chat channels like IRC: if nobody answers, try again at a different time; don't just give up!
  • If you don't get an answer even after waiting and being patient, consider if other Communication channels might be a better place to ask your question.

İlave

MediaWiki katkıda bulunanlar Bangalore, Hindistan'da çalışıyor.

PHP

MediaWiki PHP ile yazılmıştır, bu nedenle MediaWiki'nin çekirdeğini kesmek için PHP'ye aşina olmanız gerekir.

PHP öğrenin
  • PHP eğitimi — Birçok farklı dilde mevcuttur. Eğer PHP hakkında hiçbir bilgiye sahip değilseniz, ancak diğer nesne tabanlı programlama dillerinde nasıl program yapacağınızı biliyorsanız, PHP öğrenmenizi kolaylaştıracaktır.
  • PHP Programming at Wikibooks.
  • PHP at Wikiversity.
PHP kaynakları
Bilmeniz gereken şeyler
  • MediaWiki'deki maintenance/eval.php betiği, MediaWiki nesneleri ve sınıfları yüklenen basit bir PHP yorumlayıcı sağlar.
  • Ayrıca, MediaWiki'deki maintenance/shell.php betiği, PsySH tabanlı maintenance/eval.php yerine geçer, Manual:Shell.php sayfasına bakın.

Veritabanı

Birçok özellik, bir miktar veritabanı manipülasyonu gerektirir, bu nedenle sıklıkla MySQL/MariaDB'yi tanımanız gerekir.

MySQL/MariaDB'yi öğrenin
MySQL/MariaDB kaynakları
Bilmeniz gereken şeyler
  • Kodunuzu MySQL/MariaDB ile test edin.
    • MediaWiki şu anda birincil veritabanı arka uç olarak MySQL ve MariaDB'yi kullanmaktadır. Ayrıca PostgreSQL ve SQLite gibi diğer DBMS'leri de destekler. Bununla birlikte, hemen hemen tüm geliştiriciler MySQL/MariaDB'yi kullanır ve sonuç olarak düzenli olarak kesilen diğer DB'leri test etmezler. Bu nedenle, özellikle başka bir DB için desteği geliştirmeye çalışmadıkça yamaları test ederken MySQL/MariaDB'yi kullanmanız önerilir. İkinci durumda, MySQL/MariaDB'yi kırmamaya özen gösterin (veya içinde korkunç derecede yetersiz olan soruları yazın), çünkü MySQL/ MariaDB herkesin kullandığı şeydir.

JavaScript ve CSS

JavaScript ve CSS, ön uç kodunda her zaman mevcut hale geldi. MediaWiki'de çalışmak için JavaScript, jQuery ve CSS hakkında bilgi sahibi olmak zorunda değilsiniz, ancak ne üzerinde çalışmayı seçtiğinize bağlı olarak yapmanız gerekebilir.

JavaScript ve CSS'yi öğrenin
JavaScript ve CSS kaynakları

MediaWiki

MediaWiki kod tabanı büyük ve bazı bölümleri çirkin; onun tarafından kaplamayın. İlk başladığınızda, yalnızca küçük bir kod bölgesine dokunan özellikler yazmayı veya hataları düzeltmeyi hedefleyin.

MediaWiki ile ilgili temel bilgiler ve okunması gereken bilgiler
MediaWiki kaynakları
  • Manual:Code — Önemli dosyaların bir listesi ve daha ayrıntılı bilgilere bağlantılar.
  • Manual:Hooks — Kanca listesi. Kod tabanının bir kısmının bir şey yaptığını bulmaya çalışıyorsanız, genellikle başlamak için iyi bir yer ilgili kancaları aramaktır.
  • Manual:Coding conventions — MediaWiki topluluğunda genel kodlama sözleşmelerine genel bir bakış.
  • Kod belgelendirmesi (sınıf kaynağı) — Kod ve kod yorumlarını otomatik olarak oluşturulan belgeler.
  • Manual:How to debug — MediaWiki'nin hata ayıklanması için bir kılavuz.
  • Manual:Eval.php — MediaWiki nesneleri ile etkileşim kurmak için bir araç yaşıyor.

MediaWiki uzantıları

MediaWiki uzantıları koduyla çalışmayı seçerseniz, aşağıdaki bağlantılar daha fazla bilgi sağlar.

MediaWiki uzantılarına ilişkin temel bilgiler
MediaWiki uzantıları kaynakları

MediaWiki skins

Manual:How to make a MediaWiki skin is helpful if you choose to work on MediaWiki skins.

Ayrıca bakınız

Footnotes

  1. MediaWiki, PHP'yi destekleyen çoğu platformda çalışır, ancak, bazı yardımcı programların veya işletim sistemi özelliklerinin eksikliği, işlevselliklerini veya performanslarını sınırlayabilir. LAMP dışı platformlarda MediaWiki.
  2. MediaWiki MySQL ve MariaDB dışındaki Veritabanı desteği var, PostgreSQL, SQLite dahil.
  3. Geliştiriciler, çeşitli kuruluşlar için gönüllülerin ve ücretli personelin (veya müteahhitlerin) bir karışımıdır. MediaWiki kodunda çalışanların tam listesi için, Geliştiriciler makalesini okuyun.
  4. https://phabricator.wikimedia.org/diffusion/ adresinden kod depolarının kaynak koduna ve revizyonlarına göz atın veya Gerrit kullanarak kaynak kodunu sisteminize indirin.