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:

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 ...

Get MediaWiki now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.