미디어위키 개발자가 되는 방법
이 문서는 개발자가 미디어위키 코어 및 미디어위키 확장 개발에 기여하는 데 필요한 기본 기술을 배우도록 돕기 위해 작성되었습니다. 미디어위키로 작업할 때 대부분의 경우, 자신이 무엇을 하고 있는지 정말로 알지 못하는 한 미디어위키 코어를 해킹하고 싶지 않음에 유의하십시오.
위키미디어 개발을 시작하는 주요 경로는 멘토링을 제공하는 위키미디어 프로젝트에 기여하는 것입니다. 멘토링이 없는 대안은 좋은 첫 번째 버그를 수정하는 것입니다.
이미 미디어위키 개발에 익숙하다면, 개발자 허브 를 방문하십시요.
위키미디어 공동체에 참여하는 다른 방법을 보려면 기여하는 방법 항목을 참고하십시오.
개요
미디어위키는 위키백과, 위키백과의 자매 프로젝트, 그리고 전 세계 수천 개의 위키 사이트를 지원하는 소프트웨어입니다.
미디어위키는 PHP 프로그래밍 언어로 작성되었으며, 일부 지원 도구는 배치 파일, 쉘 스크립트, makefiles 및 파이썬 등을 포함하는 다른 언어들로 작성되었습니다. 클라이언트 JavaScript 라이브러리로 jQuery를 사용합니다.
MediaWiki는 주로 LAMP 플랫폼[1] 의 대부분의 운영 체제에서 실행됩니다. MediaWiki는 주로 MySQL 또는 MariaDB 데이터베이스 서버를 사용합니다.[2]
개발은 오픈 소스 스타일로 진행됩니다.[3]는 온라인에서 대부분 조정되고 Wikimedia Foundation에서 지원하지만 자원 봉사 커뮤니티 개발자도 큰 역할을 합니다.
- 다양한 메일링 목록과 IRC 채널들 에서 개발 논의가 이루어지고 있습니다. 메인 개발자 목록은 여기 있습니다. wikitech-l. 주요 개발자 IRC 채널은 #mediawiki connect 및 #wikimedia-dev connect입니다.
- 코드 검토는 게릿 에서 수행되며 여기에서 볼 수 있습니다. 이 튜토리얼을 따르십시오 패치를 제출하기 위해 Git 및 Gerrit를 설정하십시오.
이 페이지는 또한 미디어위키 기여자가 되는데 도움을 줄것입니다. 이 문서는 튜토리얼이 아닙니다; 이 문서는 단지 필요한 것을 배울 수 있는 다양한 장소를 알려줍니다.
개발 환경 구축하기
대부분의 프로젝트는 Git과 Gerrit를 사용합니다. Gerrit tutorial에 따라 개발자 계정을 설정하세요. 그런 다음 코드를 다운로드하고, 변경하고, 테스트하고, 패치를 제출할 수 있습니다. 사전 구성된 가상 머신 설정(Docker 또는 Vagrant)을 사용하거나 수동 구성 접근 방식을 사용하여 개발 환경을 설정하는 두 가지 방법이 있습니다.
도커 개발 환경
- MediaWiki Docker – Docker를 사용하여 MediaWiki를 실행합니다(Linux, Windows 또는 macOS 호스트에서 사용할 수 있음). This is the recommended method.
You can also try the experimental mwcli tool which provides basic orchestration functionality for MediaWiki docker containers.
Vagrant 를 이용한 가상 머신
- Vagrant 설치 — 이 단계는 Linux 가상 머신(Linux, Windows 또는 Mac 호스트에서 사용할 수 있음) 내부의 모든 요구 사항과 함께 MediaWiki 서버를 설치합니다.
Vagrant is a powerful tool, but it is more complex and less robust than Docker, and significantly more resource-intensive. It is mainly aimed at developers who need to set up complex, flexible environments, e.g. for testing the interaction of multiple extensions.
수동 설치
- 설치 요구 사항 — 하드웨어 요구 사항을 확인하고 LAMP, MAMP 또는 WAMP 서버(Linux, Mac 또는 Windows, Apache, MySQL/MariaDB 및 PHP 포함)를 설치합니다.
- Git에서 다운로드 — Git에서 최신 소스 코드를 다운로드합니다.
- 매뉴얼:설치 가이드 — 설치 및 초기 구성을 계속합니다.
- 경고 및 오류를 조기에 표시하도록 환경에서 다양한 디버그 모드를 설정합니다.
MediaWiki 기능을 개발하기 위해 Wikipedia 데이터베이스 덤프를 다운로드할 필요는 없습니다. 사실, 많은 경우에 특별히 제작된 몇 개의 테스트 페이지가 있는 거의 비어 있는 데이터베이스를 사용하는 것이 더 쉽습니다. 그러나 어떤 이유로 Wikipedia 사본을 갖고 싶다면 덤프받기 를 할 수 있습니다.
커뮤니케이션 팁 및 지침
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 파브리케이터 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:
- Read and follow the code of conduct for Wikimedia technical spaces.
- Use inclusive language : Instead of using terms that assume a gender identity (like "guys", "madam", or "sir") use the name of the person instead.
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 커뮤니케이션 .
- 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.
부록
PHP
MediaWiki는 PHP로 작성되었으므로 MediaWiki의 핵심을 해킹하려면 PHP에 익숙해져야 합니다.
- PHP 배우기
-
- PHP 튜토리얼 — 다른 수많은 언어로 이용할 수 있습니다. PHP에 대한 지식은 없지만 다른 객체 지향 프로그래밍 언어로 프로그래밍하는 방법을 알고 있다면 PHP를 쉽게 배울 수 있습니다.
- PHP Programming at Wikibooks.
- PHP at Wikiversity.
- PHP 리소스
-
- PHP 매뉴얼 — 많은 다양한 언어로 사용가능합니다.
- PHP coding conventions 미디어위키 커뮤니티 내에 존재합니다.
- 알아야 할 것
-
- 미디어위키의
maintenance/eval.php
스크립트는 미디어위키 객체와 클래스가 로드된 기본 PHP 인터프리터를 제공합니다. - 또한 MediaWiki의
maintenance/shell.php
스크립트는 PsySH를 기반으로 하는maintenance/eval.php
를 대체합니다. Manual:Shell.php
- 미디어위키의
데이터베이스
많은 기능에는 어느 정도의 데이터베이스 조작이 필요하므로 MySQL/MariaDB에 익숙해야 하는 경우가 많습니다.
- MySQL/MariaDB 배우기
-
- MySQL 튜토리얼 — MySQL 레퍼런스 메뉴얼부터
- MySQL at Wikibooks.
- MySQL/MariaDB 리소스
-
- MySQL Reference Manuals — 많은 다양한 언어로 사용가능합니다.
- MariaDB Knowledge Base
- PHP coding conventions 미디어위키 커뮤니티 내에 존재합니다.
- 데이터베이스에 접근하기
- 알아야 할 것
-
- 당신의 MySQL/MariaDB 코드를 시험해 보세요.
- 미디어위키는 현재 MySQL 및 MariaDB를 기본 데이터베이스 백엔드로 사용합니다. PostgreSQL 및 SQLite와 같은 다른 DBMS도 지원합니다. 그러나 거의 모든 개발자는 MySQL/MariaDB를 사용하고 다른 DB를 테스트하지 않기 때문에 정기적으로 중단됩니다. 따라서 특별히 다른 DB에 대한 지원을 개선하려는 것이 아니라면 패치를 테스트할 때 MySQL/MariaDB를 사용하는 것이 좋습니다. 후자의 경우 MySQL/MariaDB가 손상되지 않도록 주의하십시오(또는 끔찍하게 비효율적인 쿼리 작성). MySQL/MariaDB는 모두가 사용하는 것이기 때문입니다.
- 당신의 MySQL/MariaDB 코드를 시험해 보세요.
자바스크립트와 CSS
JavaScript와 CSS는 프론트 엔드 코드에서 어디에나 존재합니다. MediaWiki에서 작업하기 위해 JavaScript, jQuery 및 CSS에 익숙할 필요는 없지만 작업하기로 선택한 항목에 따라 필요할 수도 있습니다.
- 자바스크립트와 CSS 배우기
-
- JavaScript and CSS at Wikibooks.
- jQuery 시작하기 — jQuery 튜토리얼
- Learning JavaScript — references and sources.
- 자바스크립트와 CSS 리소스
-
- JavaScript 코딩 규칙 MediaWiki 커뮤니티 내에 존재합니다.
- CSS coding conventions MediaWiki 커뮤니티 내에 존재합니다.
MediaWiki
MediaWiki 코드 기반은 크고 일부는 보기 흉합니다. 그것에 압도되지 마십시오. 처음 시작할 때 기능을 작성하거나 코드의 작은 영역에만 영향을 미치는 버그를 수정하는 것을 목표로 하십시오.
- 미디어위키의 기본과 필독서
-
- MediaWiki 아키텍처 — MediaWiki의 주요 구성 요소와 이들이 서로 어떻게 작동하는지에 대한 높은 수준의 개요입니다.
- 개발자를 위한 보안 — 보안 코드를 작성하는 이유와 방법에 대한 개요입니다.
- 미디어위키 리소스
-
- Manual:Code — 중요한 파일 목록과 더 자세한 정보에 대한 링크.
- 메뉴얼:훅 — 후크 목록입니다. 코드베이스의 어떤 부분이 어떤 작업을 수행하는지 찾으려는 경우 관련 후크를 검색하는 것이 좋은 출발점인 경우가 많습니다.
- Manual:Coding conventions — 미디어위키 커뮤니티의 일반적인 코딩 규칙에 대한 개요입니다.
- 코드 문서 (class reference) — 코드 및 코드 주석에서 자동으로 생성된 문서.
- Manual:How to debug — 미디어위키 디버깅 가이드
- Manual:Eval.php — 라이브 미디어위키 개체와 상호 작용하는 도구입니다.
미디어위키 확장기능
미디어위키 확장 코드에서 작업하기로 선택한 경우 다음 링크에서 추가 정보를 제공합니다.
- 미디어위키 확장 기본
-
- 확장 개발 — MediaWiki용 확장을 작성하는 방법.
- 확장 작성 튜토리얼
- 미디어위키 확장 리소스
-
- 확장에 대한 모범 사례
- MediaWiki 확장 개발에 대한 간략한 소개 — MediaWiki 확장을 만드는 방법에 대한 비디오 프레젠테이션(slides).
- MediaWiki 확장 프로그램 만들기 — MediaWiki용 확장 프로그램을 개발하는 방법, 모범 사례 및 MediaWiki 커뮤니티에 참여하는 방법을 다룹니다. 2011년 2월, 미디어위키 개발자 허브로부터
- 확장 개발자를 위한 도움말 개발자 허브
같이 보기
- 저장소 전체에서 코드 검색
- 개발자 허브 – 이 문서의 정보를 완전히 읽었으면 개발자 허브의 정보로 넘어갈 차례입니다.
- 행동 강령
- ↑ MediaWiki는 PHP를 지원할 수 있는 대부분의 플랫폼에서 실행되지만 특정 유틸리티나 운영 체제 기능이 없는 비 LAMP 플랫폼에서 MediaWiki 기능이나 성능이 제한될 수 있습니다.
- ↑ MediaWiki는 PostgreSQL, SQLite를 포함하여 MySQL 및 MariaDB 이외의 DBMS를 지원합니다.
- ↑ 개발자는 다양한 조직의 자원봉사자와 유급 직원(또는 계약자)이 혼합되어 있습니다. MediaWiki 코드 작업의 전체 목록을 보려면 Developers 기사를 읽어보세요.
- ↑ https://phabricator.wikimedia.org/diffusion/에서 소스 코드 및 코드 리포지토리의 개정판을 검색하거나 Gerrit를 사용하여 시스템에 소스 코드를 다운로드하십시오.