I’m updating a MediaWiki extension that nicely formats Bibtex extensions (this one). One feature is that when a link to a PDF is present then that link gets presented with a PDF icon. This icon is an image uploaded to the wiki as any other file (i.e. it’s not part of the extension itself). The code then accesses this image like this:
$im2 = Image::newFromName("PDF.png");
However, the Image class has been deprecated and removed (I’m using version 1.19). I see that “images” are now “files”, but it’s unclear to me what the new equivalent of the above is.
I could just hard-code the image filename, but that would not be portable to other setups. I would like to keep this approach of using an image uploaded to the wiki, if possible.
How can I work with files uploaded to a MediaWiki through the MediaWiki API?
Looks like the
wfFindFilefunction does that now: