Properties

$strict_mode

$strict_mode : 

Type

$parent

$parent : 

Type

$data

$data : 

Type

$newconst

$newconst : 

Type

$constprops

$constprops : 

Type

$save_opts

$save_opts : 

Type

$data_opts

$data_opts : 

Type

$autoload_dir

$autoload_dir : 

Type

$autoload_scan

$autoload_scan : 

Type

$_file_type_extensions

$_file_type_extensions : 

Type

$_file_type_matches

$_file_type_matches : 

Type

$_file_type_include_pos

$_file_type_include_pos : 

Type

Methods

append()

append(  $item) 

Parameters

$item

insert()

insert(  $item,   $pos) 

Parameters

$item
$pos

swap()

swap(  $pos1,   $pos2) 

Parameters

$pos1
$pos2

current()

current() 

key()

key() 

next()

next() 

rewind()

rewind() 

valid()

valid() 

offsetExists()

offsetExists(string  $id) : Boolean

Checks to see if a parameter is set.

Parameters

string $id

The unique identifier of the parameter.

Returns

Boolean

offsetGet()

offsetGet(string  $id) : mixed

Gets a parameter if it exists.

Parameters

string $id

The unique identifier for the parameter.

Throws

\Nano4\Plugins\InvalidArgumentException

if the identifier is not defined.

Returns

mixed —

The value of the parameter, or Null if no such param.

offsetSet()

offsetSet(  $offset,   $value) 

Parameters

$offset
$value

offsetUnset()

offsetUnset(  $offset) 

Parameters

$offset

count()

count() 

is()

is(  $key) 

Parameters

$key

__get()

__get(  $name) 

Parameters

$name

__isset()

__isset(  $name) 

Parameters

$name

__unset()

__unset(  $name) 

Parameters

$name

__set()

__set(  $name,   $value) 

Parameters

$name
$value

array_keys()

array_keys() 

__construct()

__construct(array  $opts = array()) 

Initialize the container.

Parameters

array $opts

The options to initialize the data.

parent()

parent() 

load_data()

load_data(  $data,   $opts = array()) 

Parameters

$data
$opts

load()

load(  $data,   $opts = array()) 

Parameters

$data
$opts

clear()

clear(  $opts = array()) 

Parameters

$opts

spawn()

spawn(  $opts = array()) 

Parameters

$opts

load_array()

load_array(  $array,   $opts = Null) 

Parameters

$array
$opts

load_json()

load_json(  $json,   $opts = Null) 

Parameters

$json
$opts

load_yaml()

load_yaml(  $yaml,   $opts = Null) 

Parameters

$yaml
$opts

to_array()

to_array(  $id = Null) 

to_array()

Just in case the data you're querying isn't really an array, but an object, we convert it.

Parameters

$id

jsonSerialize()

jsonSerialize() 

to_json()

to_json(  $opts = Null) 

Parameters

$opts

to_yaml()

to_yaml(  $opts = Null) 

Parameters

$opts

load_simple_xml()

load_simple_xml(  $simplexml,   $opts = Null) 

Parameters

$simplexml
$opts

to_simple_xml()

to_simple_xml(  $opts = Null) 

Parameters

$opts

load_xml_string()

load_xml_string(  $string,   $opts = Null) 

Parameters

$string
$opts

load_dom_node()

load_dom_node(  $dom,   $opts = Null) 

Parameters

$dom
$opts

to_dom_element()

to_dom_element(  $opts = Null) 

Parameters

$opts

to_dom_document()

to_dom_document(  $opts = Null) 

Parameters

$opts

to_xml()

to_xml(  $opts = Null) 

Parameters

$opts

get_classname()

get_classname(  $object = Null) 

Parameters

$object

get_namespace()

get_namespace(  $object = Null) 

Parameters

$object

get_parent()

get_parent(  $class = Null) 

Get either our parent class, or a parent class in our heirarchy with a given classname (as returned by get_classname(), so no Namespaces.)

Parameters

$class

dir()

dir() 

setDir()

setDir(  $dir,   $scan = Null) 

Set the configuration directory where we will attempt autoloading config sections from.

Parameters

$dir
$scan

scanDir()

scanDir() 

Scan our autoload directory for all known files.

loadFile()

loadFile(  $filename,   $type = Null) 

Load the data from an external file.

Parameters

$filename
$type

loadInto()

loadInto(string  $id, string  $filename, string  $type = Null) 

Set a parameter to be the contents of a config file.

Parameters

string $id

The unique identifier for the parameter.

string $filename

The filename to the parameter.

string $type

If set, force the type [json|yaml|ini]

autoload()

autoload(  $id) 

Attempt an autoload procedure.

Parameters

$id

getPath()

getPath(  $path) 

Parameters

$path

share()

share(\Nano4\Plugins\Closure  $callable) : \Nano4\Plugins\Closure

Returns a closure that stores the result of the closure for uniqueness in the scope of the Conf object.

Parameters

\Nano4\Plugins\Closure $callable

A closure to wrap for uniqueness.

Returns

\Nano4\Plugins\Closure —

The wrapped closure.

protect()

protect(\Nano4\Plugins\Closure  $callable) : \Nano4\Plugins\Closure

Protect a callable from being interpreted as a service.

This lets you store a callable as a parameter.

Parameters

\Nano4\Plugins\Closure $callable

A closure to protect.

Returns

\Nano4\Plugins\Closure —

The protected closure.

raw()

raw(string  $id) : mixed

Gets the raw parameters.

Parameters

string $id

The unique identifier.

Throws

\Nano4\Plugins\InvalidArgumentException

if the identifier is not defined.

Returns

mixed —

The alue of the parameter.

__construct_data()

__construct_data(  $mixed = Null,   $opts = Null) 

Internal constructor method.

Supports two forms, the original form has the data as the first parameter, and a set of options as the second.

The second form sends the options as the first parameter, with a named 'data' option to specify the data. In this case, the second parameter should be left off.

Parameters

$mixed
$opts

detect_data_type()

detect_data_type(  $data) 

Parameters

$data

detect_string_type()

detect_string_type(  $string) 

Parameters

$string

get_simple_xml_element()

get_simple_xml_element(  $opts) 

Parameters

$opts

get_type()

get_type(  $filename) 

Pass in a filename, and find out if it is a supported type.

Parameters

$filename

load_file()

load_file(  $filename,   $type = Null) 

Load a JSON, YAML, or INI file and return an array representing it. No direct XML support, sorry.

To load XML into a specific parameter, see loadXML() instead.

Parameters

$filename
$type

load_file_chain()

load_file_chain(  $filename,   $type = Null) 

A wrapper for load_file() that supports chaining configuration files using a special include statement.

Parameters

$filename
$type