Altes MediaWiki und PHP 5.3

Wer nicht die aktuellste Version von MediaWiki einsetzt aber PHP auf 5.3 aktualisiert bekommt folgende Fehlermeldung im Apache Errorlog:

[Thu Jun 07 11:02:44 2012] [error] [client 109.193...]
 PHP Parse error:  syntax error,
 unexpected T_NAMESPACE, expecting T_STRING in
 /.../wiki/includes/Namespace.php on line 49

Die Quickfix-Lösung ist wie folgt (vorher Backup erstellen!):

cd /mywikidir/includes
nano Namespace.php
- class Namespace {
+ class MWNamespace {

# im Wurzelverzeichnis der Wiki-Installation
cd ..
find -name "*.php" -exec sed -i 's/Namespace::/MWNamespace::/g' {} \;

Es sollte aber dennoch auf die neueste MediaWiki Version 1.19 geupgraded werden.

Quelle:
MediaWiki Error: “Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in /../wiki/includes/Namespace.php on line 46″

FIND AND REPLACE with SED