Question

I'm trying to write a simple extension for MediaWiki but I can't anywhere find in simple terms, how to call functions within the application to give me the 'hashed' path to an uploaded file.

I've tried the following function call which some searching indicated would return the path but it results in an undefined function error.

//$input is set to 'Image:Test.png' or similar
function noxmagicSVG($input, $args) {
    global $wgUploadPath;

    $imagePathi = $wgUploadDirectory . wfGetHashPath($input, false) . $input;

    return $imagePathi;
}
Was it helpful?

Solution

The following worked for me in a pre-release of MediaWiki 1.16:

$url = Image::imageUrl( 'Ballarddesk.png' );
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top