mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Editcount
synced 2024-11-27 09:42:28 +00:00
Add extension.json and empty PHP entry point
Also remove i18n shim. Change-Id: I4c52985dde986ced808e60ee1f36d7e6ce413210
This commit is contained in:
parent
24e3f52aac
commit
53298e9043
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* This is a backwards-compatibility shim, 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( 'wfJsonI18nShimef56c95ea36d55e2' ) ) {
|
||||
function wfJsonI18nShimef56c95ea36d55e2( $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'][] = 'wfJsonI18nShimef56c95ea36d55e2';
|
||||
}
|
|
@ -12,21 +12,16 @@
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
|
||||
*/
|
||||
|
||||
if ( !defined( 'MEDIAWIKI' ) ) {
|
||||
die();
|
||||
if ( function_exists( 'wfLoadExtension' ) ) {
|
||||
wfLoadExtension( 'Editcount' );
|
||||
// Keep i18n globals so mergeMessageFileList.php doesn't break
|
||||
$wgMessagesDirs['Editcount'] = __DIR__ . '/i18n';
|
||||
$wgExtensionMessagesFiles['EditcountAlias'] = __DIR__ . '/Editcount.alias.php';
|
||||
wfWarn(
|
||||
'Deprecated PHP entry point used for Editcount extension. Please use wfLoadExtension instead, ' .
|
||||
'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
die( 'This version of the Editcount extension requires MediaWiki 1.25+' );
|
||||
}
|
||||
|
||||
$wgExtensionCredits['specialpage'][] = array(
|
||||
'path' => __FILE__,
|
||||
'name' => 'Editcount',
|
||||
'author' => 'Ævar Arnfjörð Bjarmason',
|
||||
'descriptionmsg' => 'editcount-desc',
|
||||
'url' => 'https://www.mediawiki.org/wiki/Extension:Editcount',
|
||||
);
|
||||
|
||||
$wgMessagesDirs['Editcount'] = __DIR__ . '/i18n';
|
||||
$wgExtensionMessagesFiles['Editcount'] = __DIR__ . '/Editcount.i18n.php';
|
||||
$wgExtensionMessagesFiles['EditcountAliases'] = __DIR__ . '/Editcount.alias.php';
|
||||
$wgAutoloadClasses['Editcount'] = __DIR__ . '/Editcount_body.php';
|
||||
$wgAutoloadClasses['EditcountHTML'] = __DIR__ . '/Editcount_body.php';
|
||||
$wgSpecialPages['Editcount'] = 'Editcount';
|
||||
|
|
23
extension.json
Normal file
23
extension.json
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "Editcount",
|
||||
"author": "Ævar Arnfjörð Bjarmason",
|
||||
"url": "https://www.mediawiki.org/wiki/Extension:Editcount",
|
||||
"descriptionmsg": "editcount-desc",
|
||||
"type": "specialpage",
|
||||
"SpecialPages": {
|
||||
"Editcount": "Editcount"
|
||||
},
|
||||
"MessagesDirs": {
|
||||
"Editcount": [
|
||||
"i18n"
|
||||
]
|
||||
},
|
||||
"ExtensionMessagesFiles": {
|
||||
"EditcountAliases": "Editcount.alias.php"
|
||||
},
|
||||
"AutoloadClasses": {
|
||||
"Editcount": "Editcount_body.php",
|
||||
"EditcountHTML": "Editcount_body.php"
|
||||
},
|
||||
"manifest_version": 1
|
||||
}
|
Loading…
Reference in a new issue