[Mediawiki-l] Infoboxes

Azurite azurite at seventh-star.net
Sat May 26 21:58:54 UTC 2007


I actually found the fixes for 1.6 on the bottom of the page... I'm a 
bit too impatient with errors.

Well, I implemented them, and they seemed to work, until I got this: 
*Parse error*: syntax error, unexpected T_DEFAULT in 
*/home/*****/public_html/wikific/extensions/ParserFunctions/ParserFunctions.php* 
on line *179*

Line 179 is this:

default:


followed by this:

            $magicWords['expr']    = array( 0, 'expr' );

            $magicWords['if']      = array( 0, 'if' );

            $magicWords['ifeq']    = array( 0, 'ifeq' );

            $magicWords['ifexpr']  = array( 0, 'ifexpr' );

            $magicWords['switch']  = array( 0, 'switch' );

            $magicWords['default'] = array( 0, '#default' );

            $magicWords['ifexist'] = array( 0, 'ifexist' );

            $magicWords['time']    = array( 0, 'time' );

    }


I'm not sure if this is a matter of quotes not being where they should, 
though I read that's a common cause of the T_DEFAULT error.

The changes I made:

* Uploaded SprintfDateCompat.php to my ParserFunctions extension folder

* Replaced the #-less section of this with the one that includes them:

$wgParser->setFunctionHook( '#expr', array( &$wgExtParserFunctions, 
'expr' ) );
$wgParser->setFunctionHook( '#if', array( &$wgExtParserFunctions, 
'ifHook' ) );
$wgParser->setFunctionHook( '#ifeq', array( &$wgExtParserFunctions, 
'ifeq' ) );
$wgParser->setFunctionHook( '#ifexpr', array( &$wgExtParserFunctions, 
'ifexpr' ) );
$wgParser->setFunctionHook( '#switch', array( &$wgExtParserFunctions, 
'switchHook' ) );
$wgParser->setFunctionHook( '#ifexist', array( &$wgExtParserFunctions, 
'ifexist' ) );

* Added this to line 169:
function wfParserFunctionsLanguageGetMagic( &$magicWords, $langCode='en' ) {

* Replaced the older version of this on line 57 with this:
function ifHook( &$parser, $test = '', $then = '', $else = '' ) {
if ( (string)$test !== '' ){


Those are all the fixes mentioned on the Meta page, but I'm not running 
PHP 4.3.9, which is the only version cited as being incompatible with 
that last fix.
Any ideas?
-Azurite




More information about the MediaWiki-l mailing list