Ne módosítsd egy MediaWiki-telepítés magját

From mediawiki.org
This page is a translated version of the page Do not hack MediaWiki core and the translation is 61% complete.

While hacking MediaWiki core is often a solution proposed on other MediaWiki support forums, it is not an ideal solution. Generally, it will cause you more problems than it solves and will only make future upgrades more difficult to install.

For the purposes of this essay, "core" is meant to include all files that belong to the original MediaWiki installation. That is to say all files except LocalSettings.php, docker-compose.override.yml, the ones in your "extensions" or "skins" folder, or other folders which you have added since your installation.

Miért ne módosítsd a magfájlokat

Mindegy, milyen könnyű a magfájlok módosítása úgy, hogy a MediaWiki azt tegye, amit szeretnél, állj ellen a kísértésnek.

  • Doing so will make it complicated, difficult or near impossible to apply site updates such as security and bug fixes.
  • You will make it difficult for those that come after to maintain the site.
  • Sebezhető lehet az oldalad.
  • Other developers are less inclined to help you if you have hacked your core — if for no other reason than it is difficult for them to know what has been done.

The MediaWiki core has been designed to be modular, so there should be no reason to hack it. If there is a feature you want and it cannot be accomplished outside of modifying core, consider developing an extension or submitting your hack as a patch. Submit a bug report and tell the community the feature you want to accomplish. It will then be tested and your feature may become a part of the MediaWiki core.

A magjukat módosító wikik problémái

  • A MediaWiki-frissítési idők 30 perctől 6 óráig, vagy akár 6 hétig is terjedhetnek, ha a diff 13 650 megváltozott sort mutat.
  • Spam és más támadások mennyiségének növekedése a biztonsági rések miatt.
  • Új funkciók hiánya az ütköző módosítások miatt.
  • Inability to use MediaWiki.org documentation — all of which has been written under the assumption that you have not hacked your core files (unless of course you write documentation specifically for how to operate MediaWiki when that particular hack is being used).
  • Repetition of the original problem — as a bug report is a far more reliable way to solve a problem than a core hack — if for no other reason than a group of developers will be looking into the problem and may discover necessary code changes you missed.
  • Complaining to developers about your core files not working — and not finding much sympathy — if you hack core files — effective technical support is all but impossible.

Kivételek

Van kivétel e szabály alól?

Nincs.

Rendben, nagyon ritkán. De ez alapvetően egyedi wikikre vagy a MediaWiki kódbázisát, fejlesztői gyakorlatait és biztonsági modelljét rendkívül ismerő emberek implementációira igaz. Azokra, akik a változásokat megfelelően dokumentálják, és megfelelően ellenőrzik a kódjuk változásait. Ha kérdezned kell, valószínűleg nem érdemes módosítani.

Kiterjesztések

Note that most of this page also applies to important extensions. It's a bad idea to directly start hacking the Semantic MediaWiki extensions, or any of the extensions used on Wikipedia and other Wikimedia sites.

An exception could be if an extension is mainly installed by copying its code from this wiki (instead of getting it from a software repository). It means it's not very seriously maintained.

Mit lehet tenni helyette

Rather than hacking MediaWiki core, there are several alternative solutions to consider, more or less in this order:

  1. A MediaWiki önmagában is erős, sokat lehet tenni a MediaWiki felületüzeneteivel, például a MediaWiki:Sidebar és más üzenetekkel, lásd a többi lapot a wikin pl. a JavaScript- és CSS-kiegészítésekről és változásokról.
  2. Fejlessz kiterjesztést, hogy megtedd, amit eredetileg tenni kívántál, vagy egyszerűen használj egy létező hookot
  3. Jelents be hibát

Lásd még