Class rcube_string_replacer

Description

Helper class for string replacements based on preg_replace_callback

Located in /rcube_string_replacer.php (line 31)


	
			
Variable Summary
 static mixed $pattern
Method Summary
 static void parse_url_brackets ( &$url)
 rcube_string_replacer __construct ()
 int add (string $str)
 void get_replacement ( $i)
 int link_callback (array $matches)
 int mailto_callback (array $matches)
 string replace_callback (array $matches)
 void resolve ( $str)
Variables
static mixed $pattern = '/##str_replacement\[([0-9]+)\]##/' (line 33)
  • access: public
mixed $link_pattern (line 35)
  • access: public
mixed $mailto_pattern (line 34)
  • access: public
Methods
static parse_url_brackets (line 150)

Fixes bracket characters in URL handling

  • access: public
void parse_url_brackets ( &$url)
  • &$url
Constructor __construct (line 39)
rcube_string_replacer __construct ()
add (line 61)

Add a string to the internal list

  • return: Index of value for retrieval
  • access: public
int add (string $str)
  • string $str: String value
get_replacement (line 71)

Build replacement string

  • access: public
void get_replacement ( $i)
  • $i
link_callback (line 82)

Callback function used to build HTML links around URL strings

  • return: Index of saved string value
  • access: public
int link_callback (array $matches)
  • array $matches: Matches result from preg_replace_callback
mailto_callback (line 114)

Callback function used to build mailto: links around e-mail strings

  • return: Index of saved string value
  • access: public
int mailto_callback (array $matches)
  • array $matches: Matches result from preg_replace_callback
replace_callback (line 134)

Look up the index from the preg_replace matches array and return the substitution value.

  • return: Value at index $matches[1]
  • access: public
string replace_callback (array $matches)
  • array $matches: Matches result from preg_replace_callback
resolve (line 142)

Replace substituted strings with original values

  • access: public
void resolve ( $str)
  • $str

Documentation generated on Wed, 23 May 2012 16:40:54 +0200 by phpDocumentor 1.4.4