Page MenuHomePhabricator

Unified approach for skin extensions
Closed, ResolvedPublic

Description

Author: taste1at

Description:
Currently, core skins are located in the skins/ directory, while for user-provided skins two systems exist:

  1. Put into the skins/ directory (cf. documentation at https://www.mediawiki.org/w/index.php?title=Manual:Skinning&oldid=605468#File_Locations)
  1. Put into the extensions/ directory (cf. https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/skins.git;a=tree;hb=df496d1f4dff27eed0bf44cab5c4f2377dfe5377)

It would be reasonable to have a unified approach which is suggested to all extension developers.

I think, it would be reasonable to have only core skins in skins directory and all other skins in extensions directory, i.e., variant 2. This would have the following implications:

a) New skins have to be registered like any other extenison, i.e., require_once(...) in LocalSettings.php

b) Skins can be activated/deactivated by the installer

c) Skin-extensions can be distributed like any other extension

d) You have a reasonable file structure

/extension/foo/Foo.php
/extension/foo/Foo.class.php
/extension/foo/bar.css
/extension/foo/...

and NOT

skin/Foo.php
skin/Foo.deps.php
skin/foo/bar.css
skin/foo/...

which somehow does not look well-organized

e) Skin-extensions can provide everything an extension can provide, like credits or additional preferences

f) The skinning system does not have to look for available skins in the filesystem, as core skins are known to core anyway and other skins provide their own $wgValidSkinNames['Foo'] = 'Foo';


Version: 1.21.x
Severity: enhancement

Details

Reference
bz43658

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:22 AM
bzimport set Reference to bz43658.

taste1at wrote:

(Some followup:)

Currently, there is a third way of Skins being implemented currently:

  1. Like an extension, where the user is suggested to put it into /skins/ but using a folder structure as extensions would have. Here, it is also necessary to register them in LocalSettings.php:

cf. https://www.mediawiki.org/wiki/Skin:Erudite and https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/skins.git;a=tree;hb=df496d1f4dff27eed0bf44cab5c4f2377dfe5377

That third method is going to be the standard way to do skins in the future. It's outlined in a tutorial and bit by bit MediaWiki is going to be coded to autodetect stuff done in that method.

http://blog.redwerks.org/2012/02/08/mediawiki-skinning-tutorial/

I believe that we can consider this done: see the list of changes I made and documentation I created at https://www.mediawiki.org/wiki/Separating_skins_from_core_MediaWiki#Stage_1:_Improve_skinning_mechanisms_.28bug.C2.A043658.29

(I have somehow neglected to comment on this bug earlier, sorry!)