Class Graphite_Graph_IniHelper

Helper object for processing ini file configurations in Graphite_GraphBuilder.

Author(s):
Copyright:   2012 Bryan Davis and contributors. All Rights Reserved.
License:   Simplified BSD License

Member Variables

protected Graphite_GraphBuilder $builder
Paired Graphite_GraphBuilder
protected array $global = array()
Global graph configuration.
protected array $series = array()
Global graph configuration.

Method Summary

protected static mixed pop( &$arr , $key , [ $default = null] , $arr )
Remove and return a named value from an array.
public static void process( $builder , $ini )
Process an ini configuration.
protected Graphite_Graph_IniHelper __construct( $builder )
Constructor.
protected void configureGraph( )
Configure a Graphite_GraphBuilder using our internal state.
protected array extendSeries( $name , [ $child = null] )
Inherit series configuration.
protected array findSeries( $name )
Find an existing series configuration.
protected void loadIniData( $ini )
Load configuration data from the provided array into this instance.
protected string prefix( $name )
Get a prefix by name.

Methods

pop

static mixed pop( &$arr , mixed $key , [mixed $default = null] , array $arr )

Remove and return a named value from an array.

The input array is modified as an intentional side effect.

Parameters:

Name Type Description
$arr array Array to modify
$key mixed Key to pop
$default mixed Default value to return if not found
&$arr

process

static void process( Graphite_GraphBuilder $builder , array $ini )

Process an ini configuration.

Parameters:

Name Type Description
$builder Graphite_GraphBuilder Builder we are helping
$ini array Ini-style data set

__construct

Graphite_Graph_IniHelper __construct( Graphite_GraphBuilder $builder )

Constructor.

Parameters:

Name Type Description
$builder Graphite_GraphBuilder Builder to configure

configureGraph

void configureGraph( )

Configure a Graphite_GraphBuilder using our internal state.

extendSeries

array extendSeries( string $name , [array $child = null] )

Inherit series configuration.

Starting with a base series that indicates inheritance, walk upward in the series inheritance hirarchy until you find a root series. Then come back down the ancestry stack merging the parent's defaults with the child's configuration until you get back to the orginal child.

Parameters:

Name Type Description
$name string Series to extend
$child array Configuration to merge with parent

findSeries

array findSeries( string $name )

Find an existing series configuration.

Parameters:

Name Type Description
$name string Series name

loadIniData

void loadIniData( array $ini )

Load configuration data from the provided array into this instance.

"Ini-style" confiugration data is expected to be an array as would be returned by {@see Graphite_IniParser::parse()}. If a key in this array is paired with a scalar value then it is assumed to be a graph level configuration setting (eg. 'width' => 400). If the key indexes an array then the value is assumed to be either a series to draw on the graph or metadata configuration. Metadata is denoted by the inclusion of an ':is' key in the value data.

Configuration data is processed and stored in member variables of this helper instance.

Parameters:

Name Type Description
$ini array Ini-style configuration data

prefix

string prefix( string $name )

Get a prefix by name.

Parameters:

Name Type Description
$name string Prefix name

Located in /src/Graphite/Graph/IniHelper.php [line 25]