Overview

Namespaces

  • Mini
    • Config

Classes

  • Config
  • Utils
  • Overview
  • Namespace
  • Class
  • Tree

Class Config

Creates an array from the config files in the provided directories.

Mini\Config\Config implements ArrayAccess, JsonSerializable, Serializable
Namespace: Mini\Config
Package: Mini\Config
Author: Andrew Breksa (abreksa4@gmail.com)
Located at Config.php
Methods summary
public
# __construct( array $options = null )

Config constructor.

Config constructor.

An array of startup options, currently supports the keys 'targets' which should contain an array of targets, and 'handlers' an array of handlers in the format [$extension, $handler].

Parameters

$options
public
# addTarget( string|array $target )

Adds a target to the target listing to include.

Adds a target to the target listing to include.

Parameters

$target
public
# registerHandler( string|array $extension, callable $handler )

Register a handler. Takes a file extension to match files by, and a function to process the file and return an array.

Register a handler. Takes a file extension to match files by, and a function to process the file and return an array.

Parameters

$extension
$handler
public
# refresh( )

Build the config array, call this after adding config directories after the constructor.

Build the config array, call this after adding config directories after the constructor.

public
# merge( array $config )

Merges the provided array and config array into the config array

Merges the provided array and config array into the config array

Parameters

$config
public
# removeHandler( string $extension )

Removes a handler from the internal handler array, stopping the parsing of files with that extension.

Removes a handler from the internal handler array, stopping the parsing of files with that extension.

Parameters

$extension
public boolean
# offsetExists( mixed $offset )

Parameters

$offset

Returns

boolean

Implementation of

ArrayAccess::offsetExists()
public boolean
# __isset( $key )

Parameters

$key

Returns

boolean
public mixed
# offsetGet( mixed $offset )

Parameters

$offset

Returns

mixed

Implementation of

ArrayAccess::offsetGet()
public mixed
# __get( $key )

Parameters

$key

Returns

mixed
public
# __set( $key, $value )

Parameters

$key
$value
public
# offsetSet( mixed $offset, mixed $data )

Parameters

$offset
$data

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( mixed $offset )

Parameters

$offset

Implementation of

ArrayAccess::offsetUnset()
public
# __unset( $name )

Parameters

$name
public string
# serialize( )

String representation of object

String representation of object

Returns

string
the string representation of the object or null

Since

5.1.0

Link

http://php.net/manual/en/serializable.serialize.php

Implementation of

Serializable::serialize()
public mixed
# jsonSerialize( )

Specify data which should be serialized to JSON

Specify data which should be serialized to JSON

Returns

mixed

data which can be serialized by json_encode, which is a value of any type other than a resource.

Since

5.4.0

Link

http://php.net/manual/en/jsonserializable.jsonserialize.php

Implementation of

JsonSerializable::jsonSerialize()
public
# unserialize( string $serialized )

Constructs the object

Constructs the object

Parameters

$serialized

The string representation of the object.

Since

5.1.0

Link

http://php.net/manual/en/serializable.unserialize.php

Implementation of

Serializable::unserialize()
Properties summary
protected array $config

The config array, holds the config from all merged config files.

The config array, holds the config from all merged config files.

#
protected array $directories

The array of targets for Config to include in the the config array.

The array of targets for Config to include in the the config array.

# []
protected array $files

The array of files for Config to include in the the config array.

The array of files for Config to include in the the config array.

# []
protected array $handlers

The array of handlers, as 'extension' => 'callable'.

The array of handlers, as 'extension' => 'callable'.

#
mini-config API documentation generated by ApiGen