rcube_config

Configuration class for Roundcube

package

Framework

subpackage

Core

Methods

Object constructor

__construct( $env = '') 

Arguments

$env

Getter for all config options

all() : array

Response

array

Hash array containing all config properties

Internal getter for client's (browser) timezone identifier

client_timezone() 

Convert legacy options into new ones

fix_legacy_props(array $props) : array

Arguments

$props

array

Hash array with config props

Response

array

Converted config props

Getter for a specific config parameter

get(string $name, mixed $def = null) : mixed

Arguments

$name

string

Parameter name

$def

mixed

Default value if not set

Response

mixed

The requested config value

Return requested DES crypto key.

get_crypto_key(string $key) : string

Arguments

$key

string

Crypto key name

Response

string

Crypto key

Return configured crypto method.

get_crypto_method() : string

Response

string

Crypto method

Getter for error state

get_error() : mixed

Response

mixed

Error message on error, False if no errors

Special getter for user's timezone offset including DST

get_timezone() : float
deprecated

Response

float

Timezone offset (in hours)

getenv_default

getenv_default( $varname,  $default_value,  $type = null) : \Value
brief

Get environment variable value.

Retrieve an environment variable's value or if it's not found, return the provided default value.

Arguments

$varname

Environment variable name

$default_value

Default value to return if necessary

$type

Type of value to return

Response

\Value

of the environment variable or default if not found.

guess_type

guess_type( $value) : \The
brief

Guess the type the string may fit into.

Look inside the string to determine what type might be best as a container.

Arguments

$value

The value to inspect

Response

\The

guess at the type.

Try to autodetect operating system and find the correct line endings

header_delimiter() : string

Response

string

The appropriate mail header delimiter

Load config from local config file

load() 
todo

Remove global $CONFIG

Read configuration from a file and merge with the already stored config values

load_from_file(string $file) : \booelan

Arguments

$file

string

Name of the config file to be loaded

Response

\booelan

True on success, false on failure

Load a host-specific config file if configured This will merge the host specific configuration with the given one

load_host_config() 

Return the mail domain configured for the given host

mail_domain(string $host, boolean $encode = true) : string

Arguments

$host

string

IMAP host

$encode

boolean

If true, domain name will be converted to IDN ASCII

Response

string

Resolved SMTP host

Override config options with the given values (eg. user prefs)

merge(array $prefs) 

Arguments

$prefs

array

Hash array with config props to merge over

parse_env

parse_env( $string,  $type) : \Appropriately
brief

Parse environment variable into PHP type.

Perform an appropriate parsing of the string to create the desired PHP type.

Arguments

$string

String to parse into PHP type

$type

Type of value to return

Response

\Appropriately

typed interpretation of $string.

Helper method to resolve absolute paths to the given config file.

resolve_paths( $file,  $use_env = true) : array

This also takes the 'env' property into account.

Arguments

$file

$use_env

Response

array

List of candidates in config dir path(s)

Setter for a config parameter

set(string $name, mixed $value) 

Arguments

$name

string

Parameter name

$value

mixed

Parameter value

Merge the given prefs over the current config and make sure that they survive further merging.

set_user_prefs(array $prefs) 

Arguments

$prefs

array

Hash array with user prefs

timezone_name_from_abbr() replacement. Converts timezone offset into timezone name abbreviation.

timezone_name_from_abbr(float $offset) : string
static

Arguments

$offset

float

Timezone offset (in hours)

Response

string

Timezone abbreviation

Constants

DEFAULT_SKIN

DEFAULT_SKIN

Properties

env

env : 

Type(s)

paths

paths : 

Type(s)

prop

prop : 

Type(s)

errors

errors : 

Type(s)

userprefs

userprefs : 

Type(s)

Renamed options

legacy_props : array
var

Type(s)

array