Documentation

Settings
in package
implements Iterator, Countable

Settings Class to read Configuration Files

Tags
author

Norbert.e.Wagner dev@norb.me

Table of Contents

Interfaces

Iterator
Countable

Properties

$confDir  : string
$filePostfix  : string
$filePrefix  : string
$modes  : array<string|int, mixed>

Methods

__clone()  : mixed
{{{
__construct()  : mixed
{{{ Construct a new Settings Object
__get()  : mixed
__isset()  : mixed
__set()  : mixed
__unset()  : mixed
addModes()  : mixed
{{{ Adds modes to the default modes programmatically.
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
count()  : int
Count elements
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()  : void
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()  : void
Rewind the Iterator to the first element
site()  : mixed
{{{
toArray()  : array<string|int, mixed>
Return the internal settings array
valid()  : bool
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

__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

__get()

public __get(mixed $name) : mixed
Parameters
$name : mixed

__isset()

public __isset(mixed $name) : mixed
Parameters
$name : mixed

__set()

public __set(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed

__unset()

public __unset(mixed $name) : mixed
Parameters
$name : mixed

addModes()

{{{ Adds modes to the default modes programmatically.

public addModes(array<string|int, mixed> $modes) : mixed

Modes can and should be configured in the default configurration File

Parameters
$modes : array<string|int, mixed>

an array with the modes to add. 'index' => 'prefix'

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

buildFileName()

{{{ Compose the filename of the configuration File

public buildFileName([mixed $type = null ]) : mixed
Parameters
$type : mixed = null

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

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.

mergeFile()

{{{

public mergeFile() : 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

prefix()

{{{

public prefix([string|null $prefix = null ]) : mixed
Parameters
$prefix : string|null = null

site()

{{{

public site(string $site) : mixed
Parameters
$site : string

toArray()

Return the internal settings array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results