Config
in package
Leaf Config ------------- Configure your leaf app
Table of Contents
Properties
- $context : array<string|int, mixed>
- Leaf application context
Methods
- __callstatic() : mixed
- Property Overloading
- addScript() : mixed
- Add a script to attach to the leaf instance
- attachView() : mixed
- Attach view engine to Leaf view
- count() : mixed
- Countable
- get() : mixed
- Grab context
- getIterator() : mixed
- IteratorAggregate
- getStatic() : mixed
- Static getter
- has() : bool
- Does this set contain a key?
- isInvokable() : mixed
- Get data value with key
- keys() : array<string|int, mixed>
- Fetch set data keys
- protect() : Closure
- Protect closure from being directly invoked
- remove() : mixed
- Remove value with key from this set
- reset() : mixed
- Clear all values
- set() : mixed
- Set configuration value(s)
- singleton() : mixed
- Ensure a value or object will remain globally unique
- view() : mixed
- Return an attached view engine
- getDiIndex() : mixed
Properties
$context
Leaf application context
protected
static array<string|int, mixed>
$context
= ['app' => null, 'app.down' => false, 'debug' => true, 'eien.enabled' => true, 'http.version' => '1.1', 'log.writer' => null, 'log.level' => null, 'log.enabled' => false, 'log.dir' => __DIR__ . '/../../../../storage/logs/', 'log.file' => 'app.log', 'log.open' => true, 'mode' => 'development', 'session' => true, 'session.lifetime' => 60 * 60 * 24, 'session.cookie' => ['secure' => false, 'httponly' => true, 'samesite' => 'lax'], 'scripts' => [], 'views.path' => null, 'views.cachePath' => null]
Methods
__callstatic()
Property Overloading
public
static __callstatic(mixed $key, mixed $arguments) : mixed
Parameters
- $key : mixed
- $arguments : mixed
addScript()
Add a script to attach to the leaf instance
public
static addScript(callable $script) : mixed
Parameters
- $script : callable
-
The script to attach
attachView()
Attach view engine to Leaf view
public
static attachView(mixed $className[, string|null $name = null ]) : mixed
Parameters
- $className : mixed
-
The class to attach
- $name : string|null = null
-
The key to save view engine with
count()
Countable
public
static count() : mixed
get()
Grab context
public
static get([string|null $item = null ]) : mixed
Parameters
- $item : string|null = null
-
The config to get. Returns all items if nothing is specified.
getIterator()
IteratorAggregate
public
static getIterator() : mixed
getStatic()
Static getter
public
static getStatic([string $item = null ]) : mixed
Parameters
- $item : string = null
-
The item to get
has()
Does this set contain a key?
public
static has(string $key) : bool
Parameters
- $key : string
-
The data key
Return values
boolisInvokable()
Get data value with key
public
static isInvokable(string $value) : mixed
Parameters
- $value : string
-
The item to check
keys()
Fetch set data keys
public
static keys() : array<string|int, mixed>
Return values
array<string|int, mixed> —This set's key-value data array keys
protect()
Protect closure from being directly invoked
public
static protect(Closure $callable) : Closure
Parameters
- $callable : Closure
-
A closure to keep from being invoked and evaluated
Return values
Closureremove()
Remove value with key from this set
public
static remove(string $key) : mixed
Parameters
- $key : string
-
The data key
reset()
Clear all values
public
static reset() : mixed
set()
Set configuration value(s)
public
static set(string|array<string|int, mixed> $item[, mixed $value = null ]) : mixed
Parameters
- $item : string|array<string|int, mixed>
-
The config(s) to set
- $value : mixed = null
-
The value for config. Ignored if $item is an array.
singleton()
Ensure a value or object will remain globally unique
public
static singleton(string $key, Closure $value) : mixed
Parameters
- $key : string
-
The value or object name
- $value : Closure
-
The closure that defines the object
view()
Return an attached view engine
public
static view(mixed $className) : mixed
Parameters
- $className : mixed
getDiIndex()
protected
static getDiIndex(mixed $class) : mixed
Parameters
- $class : mixed