File/rcube_shared.inc

Description

Roundcube shared functions

Functions
abbreviate_string (line 331)

Truncate string if it is longer than the allowed length Replace the middle or the ending part of a string with a placeholder

  • return: Abbreviated string
string abbreviate_string (string $str, int $maxlength, [string $place_holder = '...'], [bool $ending = false])
  • string $str: Input string
  • int $maxlength: Max. length
  • string $place_holder: Replace removed chars with this
  • bool $ending: Set to True if string should be truncated from the end
array_keys_recursive (line 456)

Get all keys from array (recursive)

array array_keys_recursive (array $array)
  • array $array: Input array
clear_directory (line 268)

Delete all files within a folder

  • return: True on success, False if directory was not found
boolean clear_directory (string $dir_path)
  • string $dir_path: Path to directory
get_boolean (line 99)

Find out if the string content means TRUE or FALSE

  • return: Imagine what!
boolean get_boolean (string $str)
  • string $str: Input value
get_offset_time (line 289)

Create a unix timestamp with a specified offset from now

  • return: Unix timestamp
int get_offset_time (string $offset_str, [int $factor = 1])
  • string $offset_str: String representation of the offset (e.g. 20min, 5h, 2days)
  • int $factor: Factor to multiply with the offset
idn_to_ascii (line 535)
void idn_to_ascii ( $domain, [ $flags = null])
  • $domain
  • $flags
idn_to_utf8 (line 513)

intl replacement functions

void idn_to_utf8 ( $domain, [ $flags = null])
  • $domain
  • $flags
in_array_nocase (line 82)

Similar function as in_array() but case-insensitive

  • return: True if found, False if not
boolean in_array_nocase (mixed $needle, array $haystack)
  • mixed $needle: Needle value
  • array $haystack: Array to search in
mb_strlen (line 476)

mbstring replacement functions

void mb_strlen ( $str)
  • $str
mb_strpos (line 496)
void mb_strpos ( $haystack,  $needle, [ $offset = 0])
  • $haystack
  • $needle
  • $offset
mb_strrpos (line 501)
void mb_strrpos ( $haystack,  $needle, [ $offset = 0])
  • $haystack
  • $needle
  • $offset
mb_strtolower (line 481)
void mb_strtolower ( $str)
  • $str
mb_strtoupper (line 486)
void mb_strtoupper ( $str)
  • $str
mb_substr (line 491)
void mb_substr ( $str,  $start, [ $len = null])
  • $str
  • $start
  • $len
parse_bytes (line 115)

Parse a human readable string for a number of bytes

  • return: Number of bytes
float parse_bytes (string $str)
  • string $str: Input string
rcube_explode_quoted_string (line 430)

Explode quoted string

void rcube_explode_quoted_string (string $delimiter, string $string)
  • string $delimiter: Delimiter expression string for preg_match()
  • string $string: Input string
rc_image_content_type (line 412)

Detect image type of the given binary data by checking magic numbers

  • return: Detected mime-type or jpeg as fallback
string rc_image_content_type (string $data)
  • string $data: Binary file content
rc_mime_content_type (line 363)

A method to guess the mime_type of an attachment.

string rc_mime_content_type (string $path, string $name, [string $failover = 'application/octet-stream'], [string $is_stream = false])
  • string $path: Path to the file.
  • string $name: File name (with suffix)
  • string $failover: Mime type supplied for failover.
  • string $is_stream: Set to True if $path contains file body
rc_request_header (line 227)

Read a specific HTTP request header

  • return: Header value or null if not available
mixed rc_request_header (string $name)
  • string $name: Header name
rc_wordwrap (line 172)

Wrapper function for wordwrap

void rc_wordwrap ( $string, [ $width = 75], [ $break = "\n"], [ $cut = false])
  • $string
  • $width
  • $break
  • $cut
send_future_expire_header (line 64)

Send header with expire date 30 days in future

void send_future_expire_header ([int $offset = 2600000])
  • int $offset: Expiration time in seconds
send_nocacheing_headers (line 36)

Send HTTP headers to prevent caching this page

void send_nocacheing_headers ()
show_bytes (line 149)

Create a human readable string for a number of bytes

  • return: Byte string
string show_bytes (int $bytes)
  • int $bytes: Number of bytes
slashify (line 247)

Make sure the string ends with a slash

void slashify ( $str)
  • $str
unslashify (line 256)

Remove slash at the end of the string

void unslashify ( $str)
  • $str

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