lib/IniModifier.php
public function import(IniReaderInterface $ini, $sectionPrefix = '', $separator = '_')
    {
        foreach ($ini->content as $section => $values) {
            if ($sectionPrefix) {
                if ($section == '0') {
                    $realSection = $sectionPrefix;
                } else {
                    $realSection = $sectionPrefix.$separator.$section;
                }
            } else {
                $realSection = $section;
            }

            if (isset($this->content[$realSection])) {
                // let's merge the current and the given section
                $this->mergeValues($values, $realSection);
            } else {
                if ($values[0][0] == self::TK_SECTION) {
                    $values[0][1] = '['.$realSection.']';
                } else {
                    array_unshift($values, array(self::TK_SECTION, '['.$realSection.']'));
                }
                $this->content[$realSection] = $values;
                $this->modified = true;
            }
        }
    }
public function import(IniReaderInterface $ini, $sectionPrefix = '', $separator = '_')
    {
        foreach ($ini->content as $section => $values) {
            if ($sectionPrefix) {
                if ($section == '0') {
                    $realSection = $sectionPrefix;
                } else {
                    $realSection = $sectionPrefix.$separator.$section;
                }
            } else {
                $realSection = $section;
            }

            if (isset($this->content[$realSection])) {
                // let's merge the current and the given section
                $this->mergeValues($values, $realSection);
            } else {
                if ($values[0][0] == self::TK_SECTION) {
                    $values[0][1] = '['.$realSection.']';
                } else {
                    array_unshift($values, array(self::TK_SECTION, '['.$realSection.']'));
                }
                $this->content[$realSection] = $values;
                $this->modified = true;
            }
        }
    }
import values of an ini file into the current ini content.
If a section prefix is given, all section of the given ini file will be
renamed with the prefix plus "_". The global (unamed) section will be the section
named with the value of prefix. If the section prefix is not given, the existing
sections and given section with the same name will be merged.

@param \Jelix\IniFile\IniReaderInterface $ini           an ini file modifier to merge with the current
@param string                            $sectionPrefix the prefix to add to the section prefix
@param string                            $separator     the separator to add between the prefix and the old name
of the section

@since 1.2