Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6014339
MessageIndexStore.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
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
;
/** @return mixed|null */
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
;
}
/**
* @param string $data
* @return string|string[]
*/
protected
function
unserialize
(
$data
)
{
$array
=
explode
(
'|'
,
$data
);
return
count
(
$array
)
>
1
?
$array
:
$data
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 10:49 (6 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4a/c6/5ce130cf46d5d353934e16af0c7c
Default Alt Text
MessageIndexStore.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment