Print or write debug messages
void
console
(mixed 0)
-
mixed
0: Debug message or data
Construct shell command, execute it and return output as string.
Keywords {keyword} are replaced with arguments
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)
This implements the 'singleton' design pattern
rcube
get_instance
([
integer $mode =
0])
-
integer
$mode: Options to initialize with this instance. See rcube::INIT_WITH_* constants
Redefined in descendants as:
Quote a given string for javascript output.
Shortcut function for rcube_utils::rep_specialchars_output()
string
JQ
( $str)
Report error according to configured debug_level
void
log_bug
(array $arg_arr)
-
array
$arg_arr: Named parameters
Logs time difference according to provided timer
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
Quote a given string.
Shortcut function for rcube_utils::rep_specialchars_output()
string
Q
( $str, [ $mode = 'strict'], [ $newlines = true])
Throw system error (and show error page).
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
Returns current time (with microseconds).
float
timer
()
Append a line to a logfile in the logs directory.
Date will be added automatically to the line.
void
write_log
($name $name, line $line)
-
$name
$name: name of log file
-
line
$line: Line to append
Private constructor
rcube
__construct
()
Registers shutdown function to be executed on shutdown.
The functions will be executed before destroying any objects like smtp, imap, session, etc.
void
add_shutdown_function
(callback $function)
-
callback
$function: Function callback
Garbage collector for cache entries.
Set flag to expunge caches on shutdown
void
cache_gc
()
Decrypt 3DES-encrypted string
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 using 3DES
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
Get localized text in the desired language
string
gettext
(mixed $attrib, [string $domain = null])
-
mixed
$attrib: Named parameters array or label name
-
string
$domain: Label domain (plugin) name
Initialize and get cache object
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 the current database connection
Get global handle for memcache access
object Memcache
get_memcache
()
Initialize and get storage object
Getter for logged user email (derived from user name not identity).
string
get_user_email
()
Getter for logged user ID.
mixed
get_user_id
()
Getter for logged user language code.
string
get_user_language
()
Getter for logged user name.
string
get_user_name
()
Getter for logged user password.
string
get_user_password
()
Initial startup function
void
init
([ $mode = 0])
Check the given string and return a valid language code
string
language_prop
(string $lang)
-
string
$lang: Language code
Read directory program/localization and return a list of available languages
array
list_languages
()
Load a localization package
void
load_language
([string $lang = null], [array $add = array()])
-
string
$lang: Language ID
-
array
$add: Additional text labels/messages
Callback for memcache failure
void
memcache_failure
( $host, $port)
Create session object and start the session.
void
session_init
()
Redefined in descendants as:
Set storage parameters.
This must be done AFTER connecting to the server!
void
set_storage_prop
()
Function to be executed in script shutdown
Registered with register_shutdown_function()
void
shutdown
()
Redefined in descendants as:
Create SMTP object and connect to server
void
smtp_init
([boolean $connect = false])
-
boolean
$connect: True if connection should be established
Initialize storage object
void
storage_init
()
Garbage collector function for temp files.
Remove temp files older than two days
void
temp_gc
()
Check if the given text label exists
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
Build a valid URL to this instance of Roundcube
string
url
(mixed $p)
-
mixed
$p: Either a string with the action or url parameters as key-value pairs
Redefined in descendants as: