Class rcube

Description

Base class of the Roundcube Framework implemented as singleton

Located in /lib/Roundcube/rcube.php (line 29)


	
			
Direct descendents
Class Description
 class rcmail Application class of Roundcube Webmail implemented as singleton
Class Constant Summary
Variable Summary
Method Summary
 static void console (mixed 0)
 static output exec ($cmd 0, $values 1)
 static rcube get_instance ([integer $mode = 0])
 static string JQ ( $str)
 static void log_bug (array $arg_arr)
 static void print_timer (float $timer, [string $label = 'Timer'], [string $dest = 'console'])
 static string Q ( $str, [ $mode = 'strict'], [ $newlines = true])
 static void raise_error ([array $arg = array()], [boolean $log = false], [boolean $terminate = false])
 static float timer ()
 static void write_log ($name $name, line $line)
 rcube __construct ()
 void add_shutdown_function (callback $function)
 void cache_gc ()
 string decrypt (string $cipher, [string $key = 'des_key'], [boolean $base64 = true])
 string encrypt (string $clear, [string $key = 'des_key'], [boolean $base64 = true])
 string gettext (mixed $attrib, [string $domain = null])
 rcube_cache get_cache (string $name, [string $type = 'db'], [string $ttl = 0], [bool $packed = true])
 object Memcache get_memcache ()
 string get_user_email ()
 mixed get_user_id ()
 string get_user_language ()
 string get_user_name ()
 string get_user_password ()
 void init ([ $mode = 0])
 string language_prop (string $lang)
 array list_languages ()
 void load_language ([string $lang = null], [array $add = array()])
 void memcache_failure ( $host,  $port)
 void session_init ()
 void shutdown ()
 void smtp_init ([boolean $connect = false])
 void storage_init ()
 void temp_gc ()
 boolean text_exists (string $name, [string $domain = null], [ &$ref_domain = null], string $ref_domain)
 string url (mixed $p)
Variables
static rcube $instance (line 39)

Singleton instace of rcube

  • access: protected
mixed $caches = array() (line 100)
  • access: protected
rcube_config $config (line 46)

Stores instance of rcube_config.

  • access: public
rcube_db $db (line 53)

Instace of database class.

  • access: public
mixed $expunge_cache = false (line 102)
  • access: protected
Memcache $memcache (line 60)

Instace of Memcache class.

  • access: public
rcube_output $output (line 88)

Instance of rcube_output class.

  • access: public
rcube_plugin_api $plugins (line 95)

Instance of rcube_plugin_api.

  • access: public
rcube_session $session (line 67)

Instace of rcube_session class.

  • access: public
mixed $shutdown_functions = array() (line 101)
  • access: protected
rcube_smtp $smtp (line 74)

Instance of rcube_smtp class.

  • access: public
rcube_storage $storage (line 81)

Instance of rcube_storage class.

  • access: public
mixed $texts (line 99)
  • access: protected
Methods
static console (line 977)

Print or write debug messages

  • access: public
void console (mixed 0)
  • mixed 0: Debug message or data
static exec (line 928)

Construct shell command, execute it and return output as string.

Keywords {keyword} are replaced with arguments

  • return: of command. shell errors not detectable
  • access: public
output exec ($cmd 0, $values 1)
  • $cmd 0: Format string with {keywords} to be replaced
  • $values 1: (zero, one or more arrays can be passed)
static get_instance (line 112)

This implements the 'singleton' design pattern

  • return: The one and only instance
rcube get_instance ([integer $mode = 0])
  • integer $mode: Options to initialize with this instance. See rcube::INIT_WITH_* constants

Redefined in descendants as:
static JQ (line 913)

Quote a given string for javascript output.

Shortcut function for rcube_utils::rep_specialchars_output()

  • return: JS-quoted string
  • access: public
string JQ ( $str)
  • $str
static log_bug (line 1128)

Report error according to configured debug_level

  • see: self::raise_error()
  • access: public
void log_bug (array $arg_arr)
  • array $arg_arr: Named parameters
static print_timer (line 1201)

Logs time difference according to provided timer

  • see: self::timer()
  • access: public
void print_timer (float $timer, [string $label = 'Timer'], [string $dest = 'console'])
  • float $timer: Timer (self::timer() result)
  • string $label: Log line prefix
  • string $dest: Log file name
static Q (line 901)

Quote a given string.

Shortcut function for rcube_utils::rep_specialchars_output()

  • return: HTML-quoted string
  • access: public
string Q ( $str, [ $mode = 'strict'], [ $newlines = true])
  • $str
  • $mode
  • $newlines
static raise_error (line 1073)

Throw system error (and show error page).

  • access: public
void raise_error ([array $arg = array()], [boolean $log = false], [boolean $terminate = false])
  • array $arg: Named parameters
    • code: Error code (required)
    • type: Error type [php|db|imap|javascript] (required)
    • message: Error message
    • file: File where error occured
    • line: Line where error occured
  • boolean $log: True to log the error
  • boolean $terminate: Terminate script execution
static timer (line 1186)

Returns current time (with microseconds).

  • return: Current time in seconds since the Unix
  • access: public
float timer ()
static write_log (line 1006)

Append a line to a logfile in the logs directory.

Date will be added automatically to the line.

  • access: public
void write_log ($name $name, line $line)
  • $name $name: name of log file
  • line $line: Line to append
Constructor __construct (line 126)

Private constructor

  • access: protected
rcube __construct ()
add_shutdown_function (line 889)

Registers shutdown function to be executed on shutdown.

The functions will be executed before destroying any objects like smtp, imap, session, etc.

  • access: public
void add_shutdown_function (callback $function)
  • callback $function: Function callback
cache_gc (line 475)

Garbage collector for cache entries.

Set flag to expunge caches on shutdown

  • access: public
void cache_gc ()
decrypt (line 767)

Decrypt 3DES-encrypted string

  • return: decrypted text
  • access: public
string decrypt (string $cipher, [string $key = 'des_key'], [boolean $base64 = true])
  • string $cipher: encrypted text
  • string $key: encryption key to retrieve from the configuration, defaults to 'des_key'
  • boolean $base64: whether or not input is base64-encoded
encrypt (line 715)

Encrypt using 3DES

  • return: encrypted text
  • access: public
string encrypt (string $clear, [string $key = 'des_key'], [boolean $base64 = true])
  • string $clear: clear text input
  • string $key: encryption key to retrieve from the configuration, defaults to 'des_key'
  • boolean $base64: whether or not to base64_encode() the result before returning
gettext (line 491)

Get localized text in the desired language

  • return: Localized text
  • access: public
string gettext (mixed $attrib, [string $domain = null])
  • mixed $attrib: Named parameters array or label name
  • string $domain: Label domain (plugin) name
get_cache (line 250)

Initialize and get cache object

  • return: Cache object
  • access: public
rcube_cache get_cache (string $name, [string $type = 'db'], [string $ttl = 0], [bool $packed = true])
  • string $name: Cache identifier
  • string $type: Cache type ('db', 'apc' or 'memcache')
  • string $ttl: Expiration time for cache items
  • bool $packed: Enables/disables data serialization
get_dbh (line 165)

Get the current database connection

  • return: Database object
  • access: public
rcube_db get_dbh ()
get_memcache (line 182)

Get global handle for memcache access

  • access: public
object Memcache get_memcache ()
get_storage (line 280)

Initialize and get storage object

  • return: Storage object
  • access: public
rcube_storage get_storage ()
get_user_email (line 1256)

Getter for logged user email (derived from user name not identity).

  • return: User email address
  • access: public
string get_user_email ()
get_user_id (line 1222)

Getter for logged user ID.

  • return: User identifier
  • access: public
mixed get_user_id ()
get_user_language (line 1285)

Getter for logged user language code.

  • return: User language code
  • access: public
string get_user_language ()
get_user_name (line 1240)

Getter for logged user name.

  • return: User name
  • access: public
string get_user_name ()
get_user_password (line 1269)

Getter for logged user password.

  • return: User password
  • access: public
string get_user_password ()
init (line 139)

Initial startup function

  • access: protected
void init ([ $mode = 0])
  • $mode
language_prop (line 636)

Check the given string and return a valid language code

  • return: Valid language code
  • access: protected
string language_prop (string $lang)
  • string $lang: Language code
list_languages (line 681)

Read directory program/localization and return a list of available languages

  • return: List of available localizations
  • access: public
array list_languages ()
load_language (line 586)

Load a localization package

  • access: public
void load_language ([string $lang = null], [array $add = array()])
  • string $lang: Language ID
  • array $add: Additional text labels/messages
memcache_failure (line 224)

Callback for memcache failure

  • access: public
void memcache_failure ( $host,  $port)
  • $host
  • $port
session_init (line 397)

Create session object and start the session.

  • access: public
void session_init ()

Redefined in descendants as:
set_storage_prop (line 376)

Set storage parameters.

This must be done AFTER connecting to the server!

  • access: protected
void set_storage_prop ()
shutdown (line 857)

Function to be executed in script shutdown

Registered with register_shutdown_function()

  • access: public
void shutdown ()

Redefined in descendants as:
smtp_init (line 265)

Create SMTP object and connect to server

  • access: public
void smtp_init ([boolean $connect = false])
  • boolean $connect: True if connection should be established
storage_init (line 294)

Initialize storage object

  • access: public
void storage_init ()
temp_gc (line 450)

Garbage collector function for temp files.

Remove temp files older than two days

  • access: public
void temp_gc ()
text_exists (line 549)

Check if the given text label exists

  • return: True if text exists (either in the current language or in en_US)
  • access: public
boolean text_exists (string $name, [string $domain = null], [ &$ref_domain = null], string $ref_domain)
  • string $name: Label name
  • string $domain: Label domain (plugin) name or '*' for all domains
  • string $ref_domain: Sets domain name if label is found
  • &$ref_domain
url (line 846)

Build a valid URL to this instance of Roundcube

  • return: Valid application URL
  • access: public
string url (mixed $p)
  • mixed $p: Either a string with the action or url parameters as key-value pairs

Redefined in descendants as:
  • rcmail::url() : Build a valid URL to this instance of Roundcube
Class Constants
INIT_WITH_DB = 1 (line 31)
INIT_WITH_PLUGINS = 2 (line 32)

Documentation generated on Fri, 03 May 2013 12:44:56 +0200 by phpDocumentor 1.4.4