jenkins-bot has submitted this change and it was merged.

Change subject: Convert extension registration to use skin.json
......................................................................


Convert extension registration to use skin.json

Change-Id: If0f0a0bf0ea05ce3eafb17fe4128804375cf2831
---
D Splash.i18n.php
M Splash.php
A skin.json
3 files changed, 60 insertions(+), 83 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Splash.i18n.php b/Splash.i18n.php
deleted file mode 100644
index db0c1c0..0000000
--- a/Splash.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * This is a backwards-compatibility shim, copied from one generated by:
- * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = array();
-if ( !function_exists( 'wfJsonI18nShim417fe3896a9cdc6b' ) ) {
-       function wfJsonI18nShim417fe3896a9cdc6b( $cache, $code, &$cachedData ) {
-               $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-               foreach ( $codeSequence as $csCode ) {
-                       $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
-                       if ( is_readable( $fileName ) ) {
-                               $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-                               foreach ( array_keys( $data ) as $key ) {
-                                       if ( $key === '' || $key[0] === '@' ) {
-                                               unset( $data[$key] );
-                                       }
-                               }
-                               $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
-                       }
-
-                       $cachedData['deps'][] = new FileDependency( $fileName );
-               }
-               return true;
-       }
-
-       $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShim417fe3896a9cdc6b';
-}
diff --git a/Splash.php b/Splash.php
index fa27f4d..3adc1a8 100644
--- a/Splash.php
+++ b/Splash.php
@@ -24,52 +24,15 @@
  * @date 2014
  */
 
-if ( !defined( 'MEDIAWIKI' ) ) {
-       die( -1 );
+if ( function_exists( 'wfLoadSkin' ) ) {
+       wfLoadSkin( 'Splash' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['Splash'] = __DIR__ . '/i18n';
+       wfWarn(
+               'Deprecated PHP entry point used for Splash skin. Please use 
wfLoadSkin instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       );
+       return;
+} else {
+       die( 'This version of the Splash skin requires MediaWiki 1.25+' );
 }
-
-# Skin credits that will show up on Special:Version
-
-$wgExtensionCredits['skin'][] = array(
-       'path' => __FILE__,
-       'name' => 'Splash skin',
-       'version' => '0.6',
-       'author' => array( 'Calimonius the Estrange' ),
-       'descriptionmsg' => 'splash-skin-desc',
-       'url' => 'https://www.mediawiki.org/wiki/Skin:Splash',
-);
-
-$skinID = basename( dirname( __FILE__ ) );
-$dir = dirname( __FILE__ ) . '/';
-
-# Autoload the skin class, make it a valid skin, set up i18n
-
-# The first instance must be strtolower()ed so that useskin=nimbus works and
-# so that it does *not* force an initial capital (i.e. we do NOT want
-# useskin=Splash) and the second instance is used to determine the name of
-# *this* file.
-$wgValidSkinNames[strtolower( $skinID )] = 'Splash';
-
-$wgAutoloadClasses['SkinSplash'] = $dir . 'Splash.skin.php';
-$wgMessagesDirs['SkinSplash'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['SkinSplash'] = $dir . 'Splash.i18n.php';
-$wgResourceModules['skins.splash'] = array(
-       'styles' => array(
-               "skins/$skinID/resources/normalise.css" => array( 'media' => 
'screen' ),
-               "skins/$skinID/resources/fonts.css" => array( 'media' => 
'screen' ),
-               "skins/$skinID/resources/screen.less" => array( 'media' => 
'screen' )
-       ),
-       'position' => 'top'
-);
-
-# Get rid of weird wikimedia ui form styling
-$wgResourceModuleSkinStyles['splash'] = array(
-       'mediawiki.ui' => array(),
-       'mediawiki.ui.checkbox' => array(),
-       'mediawiki.ui.anchor' => array(),
-       'mediawiki.ui.button' => array(),
-       'mediawiki.ui.input' => array(),
-       'mediawiki.ui.radio' => array(),
-       'mediawiki.ui.icon' => array(),
-       'mediawiki.ui.text' => array(),
-);
diff --git a/skin.json b/skin.json
new file mode 100644
index 0000000..aae73f8
--- /dev/null
+++ b/skin.json
@@ -0,0 +1,49 @@
+{
+       "name": "Splash skin",
+       "version": "1.0",
+       "author": [
+               "Calimonius the Estrange"
+       ],
+       "url": "https://www.mediawiki.org/wiki/Skin:Splash";,
+       "descriptionmsg": "splash-skin-desc",
+       "type": "skin",
+       "ValidSkinNames": {
+               "splash": "Splash"
+       },
+       "MessagesDirs": {
+               "SkinSplash": [
+                       "i18n"
+               ]
+       },
+       "AutoloadClasses": {
+               "SkinSplash": "Splash.skin.php"
+       },
+       "ResourceModules": {
+               "skins.splash": {
+                       "styles": {
+                               "skins/Splash/resources/normalise.css": {
+                                       "media": "screen"
+                               },
+                               "skins/Splash/resources/fonts.css": {
+                                       "media": "screen"
+                               },
+                               "skins/Splash/resources/screen.less": {
+                                       "media": "screen"
+                               }
+                       },
+                       "position": "top"
+               }
+       },
+       "ResourceModuleSkinStyles": {
+               "splash": {
+                       "mediawiki.ui": [],
+                       "mediawiki.ui.checkbox": [],
+                       "mediawiki.ui.anchor": [],
+                       "mediawiki.ui.button": [],
+                       "mediawiki.ui.input": [],
+                       "mediawiki.ui.radio": [],
+                       "mediawiki.ui.icon": [],
+                       "mediawiki.ui.text": []
+               }
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/213283
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If0f0a0bf0ea05ce3eafb17fe4128804375cf2831
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/skins/Splash
Gerrit-Branch: master
Gerrit-Owner: Isarra <zhoris...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to