মিডিয়াউইকি কোর হ্যাক করবেন না

This page is a translated version of the page Do not hack MediaWiki core and the translation is 36% complete.

যদিও মিডিয়াউইকি কোর হ্যাকিং প্রায়শই অন্যান্য মিডিয়াউইকি সমর্থন ফোরামে প্রস্তাবিত একটি সমাধান, তবে এটি কখনও একটি আদর্শ সমাধান নয় । সাধারণত, এটি সমাধানের চেয়ে আরও বেশি সমস্যা সৃষ্টি করবে এবং তার ফলে ভবিষ্যতের আপগ্রেডগুলি ইনস্টল করাকে আরও কঠিন করে তুলবে।

এই প্রবন্ধটির উদ্দেশ্যে, "কোর" বলতে বোঝানো হয়েছে মূল মিডিয়াউইকি ইনস্টলেশনের অন্তর্গত সমস্ত ফাইলগুলোকে অন্তর্ভুক্ত করা। অর্থাৎ LocalSettings.php, docker-compose.override.yml, আপনার "এক্সটেনশন" বা "স্কিনস" ফোল্ডারে থাকা সমস্ত ফাইল বা আপনার ইনস্টলেশনের পর থেকে আপনি যোগ করা অন্যান্য ফোল্ডারগুলি ছাড়া সমস্ত ফাইলকে বোঝানো হয়েছে৷

কেন আপনার কোর ফাইলগুলি পরিবর্তন করা উচিত নয়?

মিডিয়াউইকিকে আপনি যা বানাতে চান তা করার জন্য মূল ফাইলগুলিকে পরিবর্তন করা যতই সহজ হোক না কেন, কিন্তু তবুও এই প্রলোভনকে প্রতিরোধ করুন

  • এটি করার ফলে নিরাপত্তা এবং বাগ ফিক্সের মতো সাইট আপডেটগুলি প্রয়োগ করাকে এটি জটিল, কঠিন কিংবা বলা যায় প্রায় একেবারে অসম্ভব করে তুলবে৷
  • আপনার এই পরিবর্তনগুলো, পরবর্তীতে যারা সাইট রক্ষণাবেক্ষণের জন্য আসবে তাদের কাজকে ভীষণ কঠিন করে তুলবে।
  • 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. 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.

কোর হ্যাক হওয়ার ফলে উইকির সমস্যা

  • MediaWiki upgrade times go from 30 minutes to 6 hours or even 6 weeks if your diff shows 13650 lines have been changed.
  • Increase in spam and other unwanted attacks due to security holes.
  • Missing out on new features due to conflicting hacks to core files.
  • 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.

ব্যতিক্রম

এই নিয়মের কি কোনও ব্যতিক্রম আছে?

না, নেই।

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

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 interface messages such as MediaWiki:Sidebar and many many others, see also other pages on this wiki for e.g. JavaScript and CSS additions and changes.
  1. Develop an extension to accomplish what your hack was intended to do, or simply use one of the existing hooks

See also