Settings
in package
implements
Iterator
The Settings Class to read VeruA Configurations
Interfaces, Classes and Traits
- Iterator
Table of Contents
- IS_EXT = rue
- $confDir : mixed
- $filePostfix : mixed
- $filePrefix : mixed
- $modes : mixed
- $basePath : mixed
- $extPath : mixed
- $mode : mixed
- $settings : mixed
- __construct() : mixed
- Construct a new Settings Object
- __get() : mixed
- __isset() : mixed
- __set() : mixed
- __unset() : mixed
- buildFileName() : mixed
- Compose the filename of the configuration File
- current() : mixed
- Return the current element
- key() : mixed
- Return the key of the current element
- load() : mixed
- Load the configuration from the files and merge them
- next() : mixed
- Move forward to next element
- rewind() : mixed
- Rewind the Iterator to the first element
- toArray() : array<string|int, mixed>
- Return the internal settings array
- valid() : mixed
- Checks if current position is valid
Constants
IS_EXT
public
mixed
IS_EXT
= rue
Properties
$confDir
protected
mixed
$confDir
= 'config/'
$filePostfix
protected
mixed
$filePostfix
= 'conf.php'
$filePrefix
protected
mixed
$filePrefix
= 'VeruA.'
$modes
protected
mixed
$modes
= [
'prod' => 'default',
// the first item is used for the default config file
'test' => 'testing',
'arch' => 'archive',
'demo' => 'demo',
]
$basePath
private
mixed
$basePath
$extPath
private
mixed
$extPath
$mode
private
mixed
$mode
$settings
private
mixed
$settings
= array()
Methods
__construct()
Construct a new Settings Object
public
__construct(string|array<string|int, mixed> $arg[, string $prefix = null ][, string $mode = null ][, string|bool $ext = null ]) : mixed
Loads the settings from the files if $arg is a path (string)
or alternatively uses the Settings passed to $arg as an Array.
The latter is used for the Fluid interface for nested settings
Parameters
- $arg : string|array<string|int, mixed>
-
Can be the BasePath where the $confDir is located or an array of settings to be used directly
- $prefix : string = null
-
Changes the default prefix for configuration Files
- $mode : string = null
-
One of the keys of $this->modes
- $ext : string|bool = null
-
Sets if it is an extension Settings object. In this case the default config file is loaded from the extensions/config directory If set to true the extensions directory is the same as prefix (should always be preferred If a string is given, it is used as the name of the extension directory.
Return values
mixed —__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —__isset()
public
__isset(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —__set()
public
__set(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
Return values
mixed —__unset()
public
__unset(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —buildFileName()
Compose the filename of the configuration File
public
buildFileName([string $name = '' ][, string $ext = '' ]) : mixed
Parameters
- $name : string = ''
-
The name of the mode
- $ext : string = ''
-
The name of the extension directory
Return values
mixed —current()
Return the current element
public
current() : mixed
Tags
Return values
mixed —key()
Return the key of the current element
public
key() : mixed
Tags
Return values
mixed —load()
Load the configuration from the files and merge them
public
load() : mixed
Return values
mixed —next()
Move forward to next element
public
next() : mixed
Tags
Return values
mixed —rewind()
Rewind the Iterator to the first element
public
rewind() : mixed
Tags
Return values
mixed —toArray()
Return the internal settings array
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —valid()
Checks if current position is valid
public
valid() : mixed