[Mediawiki-l] Linker and backward compatibility for extensions

Krinkle krinklemail at gmail.com
Fri Apr 20 16:03:14 UTC 2012

The easiest/practical solution I think is branching. That keeps the code clean
and saves time by not having to continuously test the extension against all
versions you want to support.

If your extension was/is hosted in Wikimedia SVN, then users of MediaWiki 1.17
can simply select the "1.17" option in the downloader which is the branched
version of the extension as it was when 1.17 was being developed. In that
version your extension would still have the old method calls to Skin which work
fine with 1.17.

If your extension is hosted by yourself or elsewhere, you can do similar thing.
Create an "mw-1.17" branch of your extension from the commit that last worked
with 1.17 (or just the commit that was active when 1.17 was developed). And
instruct users to download the branch instead of trunk if they run an older
version of MediaWiki. 

Extension:SyntaxHighlight_GeSHi [1] for example, has branches going back to 1.10
(!). Click "Download snapshot" and you'll see a dropdown menu. Those old
versions are not maintained or supported, they are provided as a fixed moment in
time for users of any mediawiki version. So those old version will not have the
latest new features. But, contrary to tags, if a bug fix has to be backported,
it can still be committed to that branch just fine.

Depending on what you want, this could mean double maintenance, however in most
cases one doesn't backport new functionality to an old version. Instead you
develop in "trunk", and whenever a new MediaWiki release is started, you create
a branch for the (then old) mediawiki version, and then continue to work on
trunk again for the current MediaWiki release.

-- Krinkle

[1] https://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi

On Apr 20, 2012, at 5:13 PM, Jim Hu wrote:

> We have some extensions that used the deprecated linking methods from skin objects.  I've changed these to use Linker::LinkKnown for 1.18+, but now they don't work with 1.17 or below.  Is there a recommended code practice that works for both?
> Thanks.
> =====================================
> Jim Hu
> Professor
> Dept. of Biochemistry and Biophysics
> 2128 TAMU
> Texas A&M Univ.
> College Station, TX 77843-2128
> 979-862-4054
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

More information about the MediaWiki-l mailing list