Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4098810
ConfigHelper.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
ConfigHelper.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Translate\Utilities
;
/**
* A helper class added to work with configuration values of the Translate Extension
*
* Also used temporarily to simplify deprecation of old configuration variables. New
* variable names, if set, are given preference over the old ones.
* See: https://phabricator.wikimedia.org/T277965
*
* @author Abijeet Patro.
* @license GPL-2.0-or-later
* @since 2021.06
*/
class
ConfigHelper
{
/** @return bool|string */
public
function
getValidationExclusionFile
()
{
global
$wgTranslateValidationExclusionFile
;
return
$wgTranslateValidationExclusionFile
;
}
public
function
getTranslateAuthorExclusionList
():
array
{
global
$wgTranslateAuthorExclusionList
;
return
$wgTranslateAuthorExclusionList
;
}
public
function
getDisabledTargetLanguages
():
array
{
global
$wgTranslateDisabledTargetLanguages
;
return
$wgTranslateDisabledTargetLanguages
;
}
public
function
isAuthorExcluded
(
string
$groupId
,
string
$languageCode
,
string
$username
):
bool
{
$hash
=
"$groupId;$languageCode;$username"
;
$authorExclusionList
=
$this
->
getTranslateAuthorExclusionList
();
$excluded
=
false
;
foreach
(
$authorExclusionList
as
$rule
)
{
[
$type
,
$regex
]
=
$rule
;
if
(
preg_match
(
$regex
,
$hash
)
)
{
if
(
$type
===
'include'
)
{
return
false
;
}
else
{
$excluded
=
true
;
}
}
}
return
$excluded
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 15:32 (3 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6e/c5/dd4569f16e37144861240199b8ab
Default Alt Text
ConfigHelper.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment