Dependency Injection in MediaWiki

Today I read the documentation for how Dependency Injection is done in MediaWiki.

I had a few small nits to pick (such as their statement that services should be stateless) but… fair enough.

For myself I don’t usually use Dependency Injection and a Service Container, instead I prefer the Service Locator pattern which I find is simpler and more economical to use, especially in PHP where there is a single process per request.

Support for OpenID

Was just having a look into what kind of support there was for OpenID in the software that I use, and basically it looks like there is fairly good support. Mailman might be a bit of a trick.

MediaWiki

WordPress

Mailman

Math support in MediaWiki

I’ve been through this process before (for older versions of MediaWiki than the 1.18 version I’m using at the moment, and things have changed) but yesterday I found myself following instructions for enabling support for mathematical equations in MediaWiki. So that’s up-to-date on my Morpheus (private) and Sixsigma (public at jj5.net) wikis (which are based on my jjwiki project). At the moment I have four wiki projects: bkwiki and bkdevwiki for Blackbrick, pcwiki for ProgClub and jjwiki for jj5.net. I also have another wiki project that’s not presently under version control called BBS for Blackbrick. I think I’ll roll the bkwiki, bkdevwiki and BBS projects into a single project (bkwiki), and the pcwiki and jjwiki projects into a single project (jjwiki) so that I only have two MediaWiki projects to maintain (for now). But, as usual, making things simpler demands more work… not sure when I’ll get around to that.

HTTPS+SSLVerifyClient require in <Directory>+big POST = Apache error

I was configuring MediaWiki to allow uploads and was getting an error in the browser about the POST data being too large (“does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.”). I had a look in the Apache error log and found:

[Thu Feb 23 16:12:45 2012] [error] [client 60.240.67.126] request body exceeds m
aximum size (131072) for SSL buffer, referer: https://www.jj5.net/morpheus/Speci
al:Upload
[Thu Feb 23 16:12:45 2012] [error] [client 60.240.67.126] could not buffer messa
ge body to allow SSL renegotiation to proceed, referer: https://www.jj5.net/morp
heus/Special:Upload

So I did some research. I found this document, File upload size which suggested editing /etc/php5/apache2/php.ini which I did:

upload_max_filesize = 20M
post_max_size = 80M

That didn’t fix the problem though. I found Request entity too large which suggested checking my setting for LimitRequestBody, but that wasn’t the problem either.

Eventually I found Bug 491763 – HTTPS+SSLVerifyClient require in <Directory>+big POST = Apache error which suggested I needed to apply the SSLRenegBufferSize directive which I did like this:

  <Location /morpheus>
    SSLVerifyClient require
    SSLVerifyDepth 1
    SSLRenegBufferSize 20971520
  </Location>

And then after restarting Apache the problem was solved.

Forcing MediaWiki to display math as PNG

I had a problem with MediaWiki math sections not always displaying as a PNG. For simple expressions HTML was used instead. This lead to a very non-uniform look and feel where some images had a green background and large fonts (for PNG expressions) compared to a black background and different fonts (for HTML expressions). I wanted a uniform look and feel so I went looking for a configuration setting.

I haven’t been able to figure out how to force mediawiki to always display a PNG as a global setting, but in your user settings on the math preferences section you can change from the default “HTML if very simple or else PNG” to “Always render PNG” which fixes the problem on a per user basis, which is good enough for me.

Free software licenses

I was doing some research about free software licenses as a part of developing ProgClub’s terms and conditions, and found this list of free software licenses from the FSF, and the same list of FSF approved software licenses on Wikipedia. I noticed the cool table sorting facility they have on the Wikipedia page, and wonder if that’s built in to MediaWiki..? It would be cool if it only required a class specification to have it work like that.

MediaWiki templates, revisited

After spending the afternoon investigating MediaWiki templates, I’ve decided that for the most part they are more trouble than they’re worth for any of my applications. I tried to create a ‘done’ template, that took username, user initials, date and ‘done note’ parameters, but really the code to call the template was just as long as not using the template, and the template broke when the ‘done note’ included a link that included an equals sign, which is just too shoddy. I’m giving up on templates until I find I actually have a use for them where the technology solves a problem that I actually have. At the moment that’s nothing.