Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F33861
IdentityCollation.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
822 B
Referenced Files
None
Subscribers
None
IdentityCollation.php
View Options
<?php
/**
* @license GPL-2.0-or-later
* @file
*/
use
MediaWiki\Language\Language
;
/**
* Collation class that's essentially a no-op.
*
* Does sorting based on binary value of the string.
* Like how things were pre 1.17.
*
* @since 1.18
*/
class
IdentityCollation
extends
Collation
{
/** @var Language */
private
$contentLanguage
;
public
function
__construct
(
Language
$contentLanguage
)
{
$this
->
contentLanguage
=
$contentLanguage
;
}
/** @inheritDoc */
public
function
getSortKey
(
$string
)
{
return
$string
;
}
/** @inheritDoc */
public
function
getFirstLetter
(
$string
)
{
// Copied from UppercaseCollation.
// I'm kind of unclear on when this could happen...
if
(
$string
[
0
]
==
"
\0
"
)
{
$string
=
substr
(
$string
,
1
);
}
return
$this
->
contentLanguage
->
firstChar
(
$string
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Dec 19, 01:42 (1 d, 2 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b5/36/7c2da075dbff1552be0cbc8d2c57
Default Alt Text
IdentityCollation.php (822 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment