MediaWiki  REL1_24
Fallback Class Reference

Fallback functions for PHP installed without mbstring support. More...

List of all members.

Static Public Member Functions

static mb_strlen ($str, $enc= '')
 Fallback implementation of mb_strlen, hardcoded to UTF-8.
static mb_strpos ($haystack, $needle, $offset=0, $encoding= '')
 Fallback implementation of mb_strpos, hardcoded to UTF-8.
static mb_strrpos ($haystack, $needle, $offset=0, $encoding= '')
 Fallback implementation of mb_strrpos, hardcoded to UTF-8.
static mb_substr ($str, $start, $count= 'end')
 Fallback implementation for mb_substr, hardcoded to UTF-8.
static mb_substr_split_unicode ($str, $splitPos)

Detailed Description

Fallback functions for PHP installed without mbstring support.

Definition at line 26 of file Fallback.php.


Member Function Documentation

static Fallback::mb_strlen ( str,
enc = '' 
) [static]

Fallback implementation of mb_strlen, hardcoded to UTF-8.

Parameters:
string$str
string$encOptional encoding; ignored
Returns:
int

Definition at line 114 of file Fallback.php.

References $total.

Referenced by mb_substr_split_unicode(), and FallbackTest\testFallbackMbstringFunctions().

static Fallback::mb_strpos ( haystack,
needle,
offset = 0,
encoding = '' 
) [static]

Fallback implementation of mb_strpos, hardcoded to UTF-8.

Parameters:
string$haystack
string$needle
string$offsetOptional start position
string$encodingOptional encoding; ignored
Returns:
int

Definition at line 138 of file Fallback.php.

References array().

static Fallback::mb_strrpos ( haystack,
needle,
offset = 0,
encoding = '' 
) [static]

Fallback implementation of mb_strrpos, hardcoded to UTF-8.

Parameters:
string$haystack
string$needle
string$offsetOptional start position
string$encodingOptional encoding; ignored
Returns:
int

Definition at line 159 of file Fallback.php.

References array().

static Fallback::mb_substr ( str,
start,
count = 'end' 
) [static]

Fallback implementation for mb_substr, hardcoded to UTF-8.

Attempts to be at least _moderately_ efficient; best optimized for relatively small offset and count values -- about 5x slower than native mb_string in my testing.

Larger offsets are still fairly efficient for Latin text, but can be up to 100x slower than native if the text is heavily multibyte and we have to slog through a few hundred kb.

Parameters:
string$str
int$start
string$count
Returns:
string

Definition at line 44 of file Fallback.php.

References $count, and mb_substr_split_unicode().

static Fallback::mb_substr_split_unicode ( str,
splitPos 
) [static]
Parameters:
string$str
int$splitPos
Returns:
int

Definition at line 63 of file Fallback.php.

References mb_strlen().

Referenced by mb_substr().


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