Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4142704
MessageIndexStore.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1014 B
Referenced Files
None
Subscribers
None
MessageIndexStore.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Translate\MessageLoading
;
/**
* @since 2024.05
* @license GPL-2.0-or-later
* @author Niklas Laxström
*/
abstract
class
MessageIndexStore
{
abstract
public
function
retrieve
(
bool
$readLatest
=
false
):
array
;
public
function
get
(
string
$key
)
{
// Default implementation
$mi
=
$this
->
retrieve
();
return
$mi
[
$key
]
??
null
;
}
abstract
public
function
store
(
array
$array
,
array
$diff
):
void
;
/** @return string[] */
public
function
getKeys
():
array
{
return
array_keys
(
$this
->
retrieve
()
);
}
/**
* These are probably slower than serialize and unserialize,
* but they are more space efficient because we only need
* strings and arrays.
* @param mixed $data
* @return mixed
*/
protected
function
serialize
(
$data
)
{
return
is_array
(
$data
)
?
implode
(
'|'
,
$data
)
:
$data
;
}
protected
function
unserialize
(
$data
)
{
$array
=
explode
(
'|'
,
$data
);
return
count
(
$array
)
>
1
?
$array
:
$data
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 16:29 (4 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3f/68/7fb4ba5513874f38d758c03824fb
Default Alt Text
MessageIndexStore.php (1014 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment