private function mergeConfigurationOption(&$currentNode, $name, $value)
    {
        if (empty($currentNode) || empty($name)) {
            return;
        }

        //We're going to be building our own objects here
        if (is_object($value)) {
            $value = (array)$value;
        }

        if (is_array($value)) {
            if ($this->isAssociative($value)) {
                //An associative array can contain non-leaves, recursively merge them in

                $childNode = null;

                if (!empty($currentNode->$name)) {
                    $childNode = $currentNode->$name;
                } else {
                    $childNode = new Parameter($currentNode, $name);
                    $currentNode->$name = $childNode;
                }

                foreach ($value as $subName => $subValue) {
                    $this->mergeConfigurationOption($childNode, $subName, $subValue);
                }
            } else {
                //Simply an array of values, just add them to the node and assume they're leaves

                if (empty($currentNode->$name)) {
                    $currentNode->$name = array();
                }

                if (!is_array($currentNode->$name)) {
                    $currentNode->$name = array();
                }

                foreach ($value as $subValue) {
                    $currentNode->{$name}[] = $subValue;
                }
            }
        } else {
            //Yay, a scalar value
            $currentNode->$name = $value;
        }
    }
private function mergeConfigurationOption(&$currentNode, $name, $value)
    {
        if (empty($currentNode) || empty($name)) {
            return;
        }

        //We're going to be building our own objects here
        if (is_object($value)) {
            $value = (array)$value;
        }

        if (is_array($value)) {
            if ($this->isAssociative($value)) {
                //An associative array can contain non-leaves, recursively merge them in

                $childNode = null;

                if (!empty($currentNode->$name)) {
                    $childNode = $currentNode->$name;
                } else {
                    $childNode = new Parameter($currentNode, $name);
                    $currentNode->$name = $childNode;
                }

                foreach ($value as $subName => $subValue) {
                    $this->mergeConfigurationOption($childNode, $subName, $subValue);
                }
            } else {
                //Simply an array of values, just add them to the node and assume they're leaves

                if (empty($currentNode->$name)) {
                    $currentNode->$name = array();
                }

                if (!is_array($currentNode->$name)) {
                    $currentNode->$name = array();
                }

                foreach ($value as $subValue) {
                    $currentNode->{$name}[] = $subValue;
                }
            }
        } else {
            //Yay, a scalar value
            $currentNode->$name = $value;
        }
    }
private function mergeConfigurationOption ( & $ currentNode , $ name , $ value ) { if ( empty ( $ currentNode ) || empty ( $ name ) ) { return ; } //We're going to be building our own objects here if ( is_object ( $ value ) ) { $ value = ( array ) $ value ; } if ( is_array ( $ value ) ) { if ( $ this -> isAssociative ( $ value ) ) { //An associative array can contain non-leaves, recursively merge them in $ childNode = null ; if ( ! empty ( $ currentNode -> $ name ) ) { $ childNode = $ currentNode -> $ name ; } else { $ childNode = new Parameter ( $ currentNode , $ name ) ; $ currentNode -> $ name = $ childNode ; } foreach ( $ value as $ subName => $ subValue ) { $ this -> mergeConfigurationOption ( $ childNode , $ subName , $ subValue ) ; } } else { //Simply an array of values, just add them to the node and assume they're leaves if ( empty ( $ currentNode -> $ name ) ) { $ currentNode -> $ name = array ( ) ; } if ( ! is_array ( $ currentNode -> $ name ) ) { $ currentNode -> $ name = array ( ) ; } foreach ( $ value as $ subValue ) { $ currentNode -> { $ name } [ ] = $ subValue ; } } } else { //Yay, a scalar value $ currentNode -> $ name = $ value ; } }
Merge a configuration option in

@param mixed $currentNode
@param string $name
@param mixed $value
Merge a configuration option in