Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does MediaWiki calculate the file path to an image?

I'm just installing MediaWiki (loving it). I'm lookin at this for adding images. I can se the logic of

[[File:MediaWiki:Image sample|50px]]

but where so I set the filepath for "File" (nothing obvious in LocalSettings.php) ... or is there some other logic at work?

I'd appreciate any help Thanks

like image 517
Gillian Avatar asked May 11 '10 18:05

Gillian


2 Answers

File location is determined by $wgLocalFileRepo which by default depends on $wgUploadDirectory and $wgHashedUploadDirectory. The upload directory defaults to [MediaWiki base dir]/images (Adrian must be using an older version). If hashing is enabled, /x/xy will be appended to the path, where xy are the first two letters of the md5 hash of the filename.

like image 59
Tgr Avatar answered Sep 21 '22 06:09

Tgr


The defaults from DefaultSettings.php are:

$wgUploadPath = "$wgScriptPath/uploads";
$wgUploadDirectory = "$IP/uploads";

If you want to change this, you should copy and paste this into LocalSettings.php

And make sure that $wgEnableUploads = true; is in LocalSettings.php too.

like image 45
Adrian Archer Avatar answered Sep 21 '22 06:09

Adrian Archer