Skip to content
v-dem edited this page Aug 16, 2021 · 10 revisions

Table of contents


### Interface: \queasy\config\ConfigInterface

Configuration interface

Visibility Function
public __get(string $name) : mixed/null Option value or null if option is missing
Get an option value from configuration by option name provided like a object property.
public __invoke(string $name, string $default=null) : mixed Option value or $default if $name option is missing
Call class instance as a get() function.
public __isset(string $name) : bool True if an option exists, false otherwise
Check if an option exists in config.
public __set(string $name, mixed $value) : void
Set an option value.
public __unset(string $name) : void
Unset option in config.
public get(string $name, mixed/null $default=null) : mixed Option value
Get an option value from configuration by name provided, or return $default, or null if $default not set.
public merge(array/\queasy\config\ArrayAccess/\queasy\config\Iterator $array) : void
Search for config keys using regular expression.
public need(string $name) : mixed Option value or $default if $name option is missing
Get an option value from configuration by name provided.
public regex(string $regex) : ConfigInterface Config instance containing key/option pairs found.
Search for config keys using regular expression.
public toArray() : array Configuration represented as a regular array
Convert all configuration structure into a regular array.

This class implements \Iterator, \ArrayAccess, \Countable, \Traversable


### Class: \queasy\config\ReadOnlyException

Configuration exception class - Missing required config option

Visibility Function
public __construct(string $method) : void
Constructor.

This class extends \queasy\config\ConfigException

This class implements \Throwable


### Class: \queasy\config\MissingOptionException

Configuration exception class - Missing required config option

Visibility Function
public __construct(string $name) : void
Constructor.

This class extends \queasy\config\ConfigException

This class implements \Throwable


### Class: \queasy\config\ConfigException

Configuration exception class

Visibility Function

This class extends \Exception

This class implements \Throwable


### Class: \queasy\config\AbstractConfig (abstract)

Abstract configuration class

Visibility Function
public __construct(mixed $data=null, \queasy\config\ConfigInterface $parent=null) : void
Constructor.
public __get(string $name) : mixed/null Option value or null if option is missing
Get an option value from configuration by option name provided like a object property.
public __invoke(string $name, string $default=null) : mixed Option value or $default if $name option is missing
Call class instance as a function.
protected data() : &mixed Config data
Return config data
protected parent() : \queasy\config\ConfigInterface/null Parent config instance or null
Return parent configuration object.
protected setData(mixed $data) : void
Set config data
protected setParent(\queasy\config\ConfigInterface/null/\queasy\config\ConfigInterface $parent=null) : void
Set parent configuration object.

This class implements \queasy\config\ConfigInterface, \Traversable, \Countable, \ArrayAccess, \Iterator


### Class: \queasy\config\Config

Main configuration class

Visibility Function
public __construct(string/array/null $data=null, \queasy\config\ConfigInterface $parent=null) : void
Constructor. specified by QUEASY_CONFIG_PATH constant if present, or from default path
public __get(string $name) : mixed/null Option value or null if $name is missing in config
Get an option value from configuration by option name provided like a object property.
public __isset(string $name) : boolean True if present, false if not
Check if $name option is present.
public __set(mixed $name, mixed $value) : void
Not implemented.
public __unset(mixed $name) : void
Not implemented.
public count() : int Number of items
Return number of items in a current configuration level.
public current() : void
Get current config array item.
public get(string $name, mixed $default=null) : mixed Option value or $default if $name option is missing in config
Get an option value from configuration by option name or return default value if provided or return null.
public key() : void
Return current config array key.
public merge(mixed $array) : void
public need(string $name) : mixed Option value
Get an option value from configuration by option name.
public next() : void
Move to the next config array item and return it.
public offsetExists(string $name) : boolean True if present, false if not
Check if $name option is present.
public offsetGet(string $name) : mixed Config option value
Get an option value from config by option $name or throw ConfigException if option is missing.
public offsetSet(mixed $name, mixed $value) : void
Not implemeted.
public offsetUnset(mixed $name) : void
Not implemented.
public regex(string $regex) : ConfigInterface Config instance containing key/option pairs found.
Search for config keys using regular expression.
public rewind() : void
Move config array pointer to the beginning.
public toArray() : array Configuration represented as a regular array
Convert all configuration structure into a regular array.
public valid() : void
Validate current config array key.
protected data() : &array A reference to array containing config
Check if data is loaded, and try to load it using loader if not.
protected item(mixed $item) : \queasy\config\ConfigInterface/mixed ConfigInterface instance if $item was an array, or $item as is
Check if $item is an array and if yes return ConfigInterface instance that encapsulates this array, if $item is instance of ConfigInterface, set $this as his parent, in other way return $item as is. If $item starts with "@queasy:" then run eval() for the rest of the string (to support multi-file configs for formats other than PHP)

This class extends \queasy\config\AbstractConfig

This class implements \Iterator, \ArrayAccess, \Countable, \Traversable, \queasy\config\ConfigInterface


### Interface: \queasy\config\ConfigAwareInterface

Describes a config-aware instance.

Visibility Function
public setConfig(\queasy\config\ConfigInterface $config) : void
Sets a config instance on the object.

### Class: \queasy\config\InvalidPathException

Configuration exception class - Invalid config path type

Visibility Function
public __construct(string $type) : void
Constructor.

This class extends \queasy\config\ConfigException

This class implements \Throwable


### Class: \queasy\config\loader\AbstractLoader (abstract)

Configuration loader abstraction

Visibility Function
public __invoke() : null/array Loaded configuration, null otherwise
Class invokation method representing load()
public abstract check() : boolean True if file can be read
Check whether configuration is available and can be loaded
public abstract load() : array Loaded configuration
Load and return an array containing configuration

This class implements \queasy\config\loader\LoaderInterface


### Interface: \queasy\config\loader\LoaderInterface

Configuration loader interface

Visibility Function
public __invoke() : array Loaded configuration
Class invokation method representing load().
public check() : boolean True or false or throw exception
Check whether configuration is available and can be loaded
public load() : array Loaded configuration
Load and return an array containing configuration.

### Class: \queasy\config\loader\JsonLoader

JSON configuration loader class

Visibility Function
public load() : array Loaded configuration
Load and return an array containing configuration.

This class extends \queasy\config\loader\FileSystemLoader

This class implements \queasy\config\loader\LoaderInterface


### Class: \queasy\config\loader\CorruptedException

Configuration loader exception class - Config file is corrupted

Visibility Function
public __construct(string $path) : void
Constructor.

This class extends \queasy\config\loader\ConfigLoaderException

This class implements \Throwable


### Class: \queasy\config\loader\NotFoundException

Configuration loader exception class - Config file not found

Visibility Function
public __construct(string $path) : void
Constructor.

This class extends \queasy\config\loader\ConfigLoaderException

This class implements \Throwable


### Class: \queasy\config\loader\PhpLoader

Standard (PHP-based) configuration loader class

Visibility Function
public load() : array Loaded configuration
Load and return an array containing configuration.

This class extends \queasy\config\loader\FileSystemLoader

This class implements \queasy\config\loader\LoaderInterface


### Class: \queasy\config\loader\NotImplementedException

Configuration loader exception class - LoaderInterface not implemented

Visibility Function
public __construct(string $className) : void
Constructor.

This class extends \queasy\config\loader\ConfigLoaderException

This class implements \Throwable


### Class: \queasy\config\loader\LoaderNotFoundException

Configuration loader exception class - Config loader not found

Visibility Function
public __construct(string $path) : void
Constructor.

This class extends \queasy\config\loader\ConfigLoaderException

This class implements \Throwable


### Class: \queasy\config\loader\FileSystemLoader (abstract)

File system configuration loader class

Visibility Function
public __construct(string $path) : void
Constructor.
public check() : bool True if config file can be accessed
Check if config file exists and is accessible.
protected path() : void
Return config path.

This class extends \queasy\config\loader\AbstractLoader

This class implements \queasy\config\loader\LoaderInterface


### Class: \queasy\config\loader\XmlLoader

XML configuration loader class

Visibility Function
public load() : array Loaded configuration
Load and return an array containing configuration.

This class extends \queasy\config\loader\FileSystemLoader

This class implements \queasy\config\loader\LoaderInterface


### Class: \queasy\config\loader\LoaderFactory

Loader factory

Visibility Function
public static create(string $path) : mixed
Create a loader for specified path.
public static register(string $pattern, string $className, bool $ignoreIfRegistered=false) : void
Register a custom loader.
public static registered(string $path) : void
Check if loader for specified path is registered.

### Class: \queasy\config\loader\IniLoader

INI file configuration loader class

Visibility Function
public load() : array Loaded configuration
Load and return an array containing configuration.

This class extends \queasy\config\loader\FileSystemLoader

This class implements \queasy\config\loader\LoaderInterface


### Class: \queasy\config\loader\AlreadyRegisteredException

Configuration loader exception class - Loader already registered

Visibility Function
public __construct(string $pattern) : void
Constructor.

This class extends \queasy\config\loader\ConfigLoaderException

This class implements \Throwable


### Class: \queasy\config\loader\ConfigLoaderException

Configuration loader exception class

Visibility Function

This class extends \queasy\config\ConfigException

This class implements \Throwable


### Class: \queasy\config\loader\CliLoader

CLI configuration loader class

Visibility Function
public check() : void
public load() : array Loaded configuration
Load and return an array containing configuration.

This class extends \queasy\config\loader\AbstractLoader

This class implements \queasy\config\loader\LoaderInterface

Clone this wiki locally