Do not hack MediaWiki core

ajab


 * You will make it difficult for those that come after to maintain the site.


 * You could possibly leave your site vulnerable to exploits.


 * 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. report>Special:MyLanguage/How to report a bug|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.

Problems faced by wikis which hack their core

 * MediaWiki upgrade times go from 30 minutes to 6 hours or even 6 weeks if your  shows 13650 lines have been changed.

Exceptions [ [/w/index.php%3Ftitle%3DDo%20not%20hack%20MediaWiki%20core%26action%3Dedit%26section%3D1 edit] ]
Are there exceptions to this rule?

Nope.

Okay, very very rarely. But this is generally for specific wikis or implementations by people who are extremely familiar with the MediaWiki code base, development practices and security model. Those who properly document their changes and practice proper revision control with their code. If you have to ask, chances are you shouldn't.

Extensions [ [/w/index.php%3Ftitle%3DDo%20not%20hack%20MediaWiki%20core%26action%3Dedit%26section%3D2 edit] ]
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.

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


 * 1) MediaWiki is a powerful beast out of the box, you can do a lot with MediaWiki's messages>Special:MyLanguage/Category:Interface_messages|interface messages such as   and many many others, see also other pages on this wiki for e.g. js>Special:MyLanguage/Manual:Interface/JavaScript|JavaScript and css>Special:MyLanguage/Manual:CSS|CSS additions and changes.


 * 1) extension>Special:MyLanguage/Manual:Developing extensions|Develop an extension to accomplish what your hack was intended to do, or simply use one of the hooks>Special:MyLanguage/Manual:Hooks|existing hooks


 * 1) report>Special:MyLanguage/How to report a bug|Submit a bug report


 * 1) hacker>Special:MyLanguage/How to become a MediaWiki hacker|Contribute your improvement to core to the code repository so others can benefit from your fix