Chapter 15. Creating Extensions
MediaWiki has hundreds of third-party extensions, but sometimes you need something new. Perhaps you’d like to integrate MediaWiki with custom applications or databases on your corporate intranet. Or maybe you want the first vowel in each article to be blue. Whatever it is, MediaWiki’s extension architecture makes it is easy to add features to MediaWiki in a maintainable manner that doesn’t change the supplied “core” MediaWiki code.
To write extensions, you’ll need to know, at minimum, the PHP programming language. (This chapter assumes you know it.) For anything complicated, you’ll also need to become familiar with MediaWiki’s PHP code—particularly its classes, constants, and global variables—and its database schema. Your primary references are:
The MediaWiki technical manual, http://www.mediawiki.org/wiki/Manual:Contents
The extension documentation, http://www.mediawiki.org/wiki/Extension:Contents
The core MediaWiki code in the includes directory
The PHP manual, http://www.php.net/manual/
A full exploration of MediaWiki’s PHP classes and database tables is beyond the scope of this book. This chapter will only skim the surface of the power of extensions, but it should give you a healthy background to build on.
All code in this chapter was confirmed to work properly in MediaWiki 1.13.0, the most recent version at press time.
Tip
All extension code in this chapter is downloadable from:
| http://examples.oreilly.com/9780596519681/ |
Overview of Extension Types
There ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access