Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4111667
Language.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
Language.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Wikimedia\Parsoid\Language
;
/**
* Base class for Language objects.
*/
class
Language
{
/** @var LanguageConverter|null */
private
$converter
;
public
function
getConverter
():
?
LanguageConverter
{
return
$this
->
converter
;
}
public
function
setConverter
(
LanguageConverter
$converter
):
void
{
$this
->
converter
=
$converter
;
}
/**
* Returns true if a language code string is of a valid form, whether or not it exists.
* This includes codes which are used solely for customisation via the MediaWiki namespace.
* @param string $code a MediaWiki-internal code
* @return bool
*/
public
static
function
isValidInternalCode
(
string
$code
):
bool
{
static
$validityCache
=
[];
if
(
!
isset
(
$validityCache
[
$code
]
)
)
{
$validityCache
[
$code
]
=
strcspn
(
$code
,
":/
\\\0
00&<>'
\"
"
)
===
strlen
(
$code
)
&&
// XXX Core's version also checks against
// !preg_match( MediaWikiTitleCodec::getTitleInvalidRegex(), $code ) &&
strlen
(
$code
)
<=
128
;
}
return
$validityCache
[
$code
];
}
/**
* Get an array of language names, indexed by code.
* @param string $inLanguage Code of language in which to return the names.
* Use null for autonyms (native names)
* @param string $include One of:
* * `all` all available languages
* * `mw` only if the language is defined in MediaWiki or `wgExtraLanguageNames` (default)
* * `mwfile` only if the language is in `mw` *and* has a message file
* @return array
* @deprecated Appears to be unused
*/
public
function
fetchLanguageNames
(
string
$inLanguage
,
string
$include
):
array
{
return
[];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 22:28 (1 d, 10 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
68/4a/7b59ee5a23e15cb6da445ac7e589
Default Alt Text
Language.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment