File/rcube_shared.inc

Description

Roundcube shared functions

Functions
abbreviate_string (line 374)

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 612)

Get all keys from array (recursive)

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

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 96)

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 332)

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 691)
void idn_to_ascii ( $domain, [ $flags = null])
  • $domain
  • $flags
idn_to_utf8 (line 669)

intl replacement functions

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

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
json_serialize (line 570)

Convert a variable into a javascript object notation

  • return: Serialized JSON string
string json_serialize (mixed $input)
  • mixed $input: Input value
make_absolute_url (line 173)

Convert paths like ../xxx to an absolute path using a base url

  • return: Absolute URL
string make_absolute_url (string $path, string $base_url)
  • string $path: Relative path
  • string $base_url: Base URL
mb_strlen (line 632)

mbstring replacement functions

void mb_strlen ( $str)
  • $str
mb_strpos (line 652)
void mb_strpos ( $haystack,  $needle, [ $offset = 0])
  • $haystack
  • $needle
  • $offset
mb_strrpos (line 657)
void mb_strrpos ( $haystack,  $needle, [ $offset = 0])
  • $haystack
  • $needle
  • $offset
mb_strtolower (line 637)
void mb_strtolower ( $str)
  • $str
mb_strtoupper (line 642)
void mb_strtoupper ( $str)
  • $str
mb_substr (line 647)
void mb_substr ( $str,  $start, [ $len = null])
  • $str
  • $start
  • $len
parse_bytes (line 112)

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 586)

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_detect_encoding (line 471)

A method to guess encoding of a string.

string rc_detect_encoding (string $string, [string $failover = ''])
  • string $string: String.
  • string $failover: Default result for failover.
rc_image_content_type (line 451)

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 406)

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 270)

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_utf8_clean (line 499)

Removes non-unicode characters from input

string rc_utf8_clean (mixed $input)
  • mixed $input: String or array.
rc_wordwrap (line 215)

Wrapper function for wordwrap

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

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 33)

Send HTTP headers to prevent caching this page

void send_nocacheing_headers ()
show_bytes (line 146)

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 290)

Make sure the string ends with a slash

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

Remove slash at the end of the string

void unslashify ( $str)
  • $str

Documentation generated on Tue, 04 Oct 2011 22:55:25 +0200 by phpDocumentor 1.4.3