\XilyConfig

The Config class stores the general system settings

Summary

Methods
Properties
Constants
getInstance()
load()
set()
get()
getDir()
log()
$arrSettings
$arrLog
No constants found
No protected methods found
No protected properties found
N/A
__construct()
__clone()
$instance
N/A

Properties

$arrSettings

$arrSettings : array

Type

array — Array containing the settings

$arrLog

$arrLog : array

Type

array — Array containing the log entries

$instance

$instance : \Xily\Config

Type

\Xily\Config — The singelton instance

Methods

getInstance()

getInstance() : \Xily\Config

Return the current instance

Returns

\Xily\Config

load()

load(string|array $res) : bool

Loads the configuration form an .ini file

Parameters

string|array $res

Settings file or array

Returns

bool

set()

set(string $name, mixed $value) : bool

Sets a configuration variable.

Parameters

string $name
mixed $value

The value to set the variable to.

Returns

bool

get()

get(string $name, string $type, mixed $default) : mixed

Returns a specified item from the object

Parameters

string $name

Attribute name

string $type

Variable type

mixed $default

Default value

Returns

mixed

getDir()

getDir(string $strDirectory,  $strSeparator) : string

Returns and formats a directory<

Parameters

string $strDirectory

The directory

$strSeparator

Returns

string —

The directory name with trailing slash

log()

log(string $strSource, string $strMessage, string $strType) : void

Utility function to collect log messages in an array

Parameters

string $strSource

Source file

string $strMessage

Log message

string $strType

Message type

__construct()

__construct()

Private contructor, so the class can only instatiate itself

__clone()

__clone()

Forbid cloning