MediaWiki  1.33.0
LCStoreStaticArray Class Reference
Inheritance diagram for LCStoreStaticArray:
Collaboration diagram for LCStoreStaticArray:

Public Member Functions

 __construct ( $conf=[])
 
 finishWrite ()
 Finish a write transaction. More...
 
 get ( $code, $key)
 Get a value. More...
 
 set ( $key, $value)
 Set a key to a given value. More...
 
 startWrite ( $code)
 Start a write transaction. More...
 

Static Public Member Functions

static decode ( $encoded)
 Decode something that was encoded with encode. More...
 
static encode ( $value)
 Encodes a value into an array format. More...
 

Private Attributes

string null $currentLang = null
 Current language code. More...
 
array $data = []
 Localisation data. More...
 
string $directory
 Directory for cache files. More...
 
string $fname = null
 File name. More...
 

Detailed Description

Since
1.26

Definition at line 28 of file LCStoreStaticArray.php.

Constructor & Destructor Documentation

◆ __construct()

LCStoreStaticArray::__construct (   $conf = [])

Definition at line 41 of file LCStoreStaticArray.php.

References $wgCacheDirectory, and directory.

Member Function Documentation

◆ decode()

static LCStoreStaticArray::decode (   $encoded)
static

Decode something that was encoded with encode.

Parameters
mixed$encoded
Returns
array|mixed
Exceptions
RuntimeException

Definition at line 96 of file LCStoreStaticArray.php.

References $data, $type, list, and unserialize().

Referenced by get().

◆ encode()

static LCStoreStaticArray::encode (   $value)
static

Encodes a value into an array format.

Parameters
mixed$value
Returns
array|mixed
Exceptions
RuntimeException

Definition at line 72 of file LCStoreStaticArray.php.

References $value, and serialize().

Referenced by set().

◆ finishWrite()

LCStoreStaticArray::finishWrite ( )

Finish a write transaction.

Implements LCStore.

Definition at line 119 of file LCStoreStaticArray.php.

References $out, and data.

◆ get()

LCStoreStaticArray::get (   $code,
  $key 
)

Get a value.

Parameters
string$codeLanguage code
string$keyCache key

Implements LCStore.

Definition at line 130 of file LCStoreStaticArray.php.

References $code, $data, $fname, data, decode(), and directory.

◆ set()

LCStoreStaticArray::set (   $key,
  $value 
)

Set a key to a given value.

startWrite() must be called before this is called, and finishWrite() must be called afterwards.

Parameters
string$key
mixed$value

Implements LCStore.

Definition at line 61 of file LCStoreStaticArray.php.

References $currentLang, $value, data, and encode().

◆ startWrite()

LCStoreStaticArray::startWrite (   $code)

Start a write transaction.

Parameters
string$codeLanguage code

Implements LCStore.

Definition at line 47 of file LCStoreStaticArray.php.

References $code, $fname, data, directory, and wfMkdirParents().

Member Data Documentation

◆ $currentLang

string null LCStoreStaticArray::$currentLang = null
private

Current language code.

Definition at line 30 of file LCStoreStaticArray.php.

Referenced by set().

◆ $data

array LCStoreStaticArray::$data = []
private

Localisation data.

Definition at line 33 of file LCStoreStaticArray.php.

Referenced by decode(), and get().

◆ $directory

string LCStoreStaticArray::$directory
private

Directory for cache files.

Definition at line 39 of file LCStoreStaticArray.php.

◆ $fname

string LCStoreStaticArray::$fname = null
private

File name.

Definition at line 36 of file LCStoreStaticArray.php.

Referenced by get(), and startWrite().


The documentation for this class was generated from the following file: