Settings
in package
implements
Iterator
Settings Class to read Configuration Files
Tags
Interfaces, Classes, Traits and Enums
- Iterator
Table of Contents
- $confDir : string
- $filePostfix : string
- $filePrefix : string
- $modes : array<string|int, mixed>
- __clone() : mixed
- {{{
- __construct() : mixed
- {{{ Construct a new Settings Object
- __get() : mixed
- __isset() : mixed
- __set() : mixed
- __unset() : mixed
- addModes() : mixed
- {{{
- appPath() : mixed
- {{{ Sets the application path where the config/ dirtectory is located If the package path is not set, it is set to the appPath
- buildFileName() : mixed
- {{{ Compose the filename of the configuration File
- create() : mixed
- {{{ Creates a copy of the Settingsobject without the configuration directives
- 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
- mergeFile() : mixed
- {{{
- next() : mixed
- Move forward to next element
- pkgPath() : mixed
- {{{ Sets the package path where the config/ dirtectory for the default and mode files is located
- prefix() : mixed
- {{{
- rewind() : mixed
- Rewind the Iterator to the first element
- site() : mixed
- {{{
- toArray() : array<string|int, mixed>
- Return the internal settings array
- valid() : mixed
- Checks if current position is valid
Properties
$confDir
protected
string
$confDir
= 'config/'
$filePostfix
protected
string
$filePostfix
= 'conf.php'
$filePrefix
protected
string
$filePrefix
= ''
$modes
protected
array<string|int, mixed>
$modes
= ['prod' => 'default', 'test' => 'testing']
Methods
__clone()
{{{
public
__clone() : mixed
Return values
mixed —__construct()
{{{ Construct a new Settings Object
public
__construct([array<string|int, mixed> $settings = null ][, string $mode = null ]) : mixed
Parameters
- $settings : array<string|int, mixed> = null
-
an array of settings to be used directly
- $mode : string = null
-
One of the keys of $this->modes
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 —addModes()
{{{
public
addModes(array<string|int, mixed> $modes) : mixed
Parameters
- $modes : array<string|int, mixed>
Return values
mixed —appPath()
{{{ Sets the application path where the config/ dirtectory is located If the package path is not set, it is set to the appPath
public
appPath([string $path = null ]) : mixed
Parameters
- $path : string = null
Return values
mixed —buildFileName()
{{{ Compose the filename of the configuration File
public
buildFileName([mixed $type = null ]) : mixed
Parameters
- $type : mixed = null
Return values
mixed —create()
{{{ Creates a copy of the Settingsobject without the configuration directives
public
create([array<string|int, mixed>|null $settings = null ]) : mixed
Parameters
- $settings : array<string|int, mixed>|null = null
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([array<string|int, mixed> $settings = null ]) : mixed
Parameters
- $settings : array<string|int, mixed> = null
-
uses the Settings as an Array.
Return values
mixed —mergeFile()
{{{
public
mergeFile() : mixed
Return values
mixed —next()
Move forward to next element
public
next() : mixed
Tags
Return values
mixed —pkgPath()
{{{ Sets the package path where the config/ dirtectory for the default and mode files is located
public
pkgPath(string $path) : mixed
Parameters
- $path : string
Return values
mixed —prefix()
{{{
public
prefix([string|null $prefix = null ]) : mixed
Parameters
- $prefix : string|null = null
Return values
mixed —rewind()
Rewind the Iterator to the first element
public
rewind() : mixed
Tags
Return values
mixed —site()
{{{
public
site(string $site) : mixed
Parameters
- $site : string
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