Manual:Skin autodiscovery

Skin autodiscovery was a legacy skin installation mechanism used by MediaWiki since very early versions (around 2004) which will be removed in MediaWiki 1.25, after being superseded by an explicit installation method in MediaWiki 1.12 and after being officially deprecated in MediaWiki 1.23.

MediaWiki 1.23 and 1.24 will emit warnings in production if a skin using the deprecated mechanism is found: A skin using autodiscovery mechanism, $aSkin, was found in your skins/ directory. The mechanism will be removed in MediaWiki 1.25 and the skin will no longer be recognized. See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for information how to fix this.

Skins using autodiscovery will continue working in the 1.23 LTS release (with the aforementioned warnings). If you upgrade from one LTS version to the next, you will have time until 1.27 LTS is released, giving you plenty of time to migrate.

How did autodiscovery work?
It used to be possible to just put a  file in MediaWiki's   directory, which would be loaded and expected to contain the   class. It has been discouraged for a long time because of the limitations of this method (inability to add localisation messages, ResourceLoader modules, etc. without cluttering ) and awkwardness in managing such skins ($wgSkipSkins had to be introduced to make it possible to disable an installed skin).

Since MediaWiki 1.23 this mechanism is officially deprecated.

What should I use instead?
The recommended way to create a skin is detailed on Manual:Skinning.

In short, you would create a subdirectory under  containing your skin's PHP code and assets, define certain skin properties in the   file, which now is located inside that subdirectory, and   it like you do when installing extensions.

This has already been supported, with minor modifications, since MediaWiki 1.12.

Where do I get a new version of my skin?
The bundled skins which come with MediaWiki (like Vector or MonoBook) will continue to be updated. When you upgrade your installation to MediaWiki 1.24 or newer, you will also get a new version of these skins. (You should then remove the old copies from the  folder, see Manual:Upgrading.)

If the skin you use was written by someone else (and you don't maintain it yourself), first try to find out if its maintainer has updated it already. Most of the skins that have description pages here on mediawiki.org (Category:All skins) use the new mechanism already or will be updated to use it soon (before 1.25 is released).

If you maintain the skin yourself, or if you want to help its maintainer migrating it, go ahead with the next section.

Migration guide
Steps needed to switch a skin to the new mechanism, in short:
 * Move the MySkin.php file into the MySkin directory with skin resources (or create one if it doesn't exist). Skins often use camel-case for the PHP file name and lower-case for the directory – you should make both names exactly the same (doesn't matter which way, just be consistent; we advice you to use ...).
 * Adjust paths in the PHP file if they were relative to file's directory, rather than $IP, $wgStyleDirectory or absolute.
 * Add the skin to $wgValidSkinNames in the Myskin.php file, like so: . Note the capitalisation: The key is lower-case, the value is camel-case as in the class name "SkinMySkin" of the skin.
 * (To be added here:) Where should I put my ResourceLoader settings such as $wgResourceModules['skins.myskin.styles'] and $wgResourceModules['skins.myskin.js']? Are changes needed?
 * (To be added here:) Where should I put the inclusion of i18n files such as $wgExtensionMessagesFiles['MySkin'] = $IP . '/skins/myskin/MySkin.i18n.php';? What about the JSON files?
 * Add a  (or  ) to your LocalSettings.php file (similarly to how it's done for extensions).

As mentioned above, the "migrated" skins will work with your MediaWiki 1.23 installation, as well as many versions back.