Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1431126
ResourceLoaderData.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ResourceLoaderData.php
View Options
<?php
/**
* Utilities for ResourceLoader modules used by EditCheck.
*
* @file
* @ingroup Extensions
* @license MIT
*/
namespace
MediaWiki\Extension\VisualEditor\EditCheck
;
use
MessageLocalizer
;
class
ResourceLoaderData
{
private
const
DEFAULTS
=
[
'addReference'
=>
[
'minimumCharacters'
=>
50
,
'beforePunctuation'
=>
false
,
// TODO: when we have multiple edit checks this will likely be a generic block:
// account: loggedin, loggedout, anything non-truthy means allow either
'account'
=>
false
,
'maximumEditcount'
=>
100
,
'ignoreSections'
=>
[],
'ignoreLeadSection'
=>
false
,
],
];
/**
* Return configuration data for edit checks, fetched from an on-wiki JSON message
*
* @param MessageLocalizer $context
* @return array Configuration data for edit checks
*/
public
static
function
getConfig
(
MessageLocalizer
$context
):
array
{
$raw_config
=
json_decode
(
$context
->
msg
(
'editcheck-config.json'
)->
inContentLanguage
()->
plain
(),
true
);
return
array_replace_recursive
(
self
::
DEFAULTS
,
$raw_config
??
[]
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 20:06 (2 h, 56 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2c/22/843ef23bf67302e62456e02e5384
Default Alt Text
ResourceLoaderData.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment