Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/IniParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
/**
* [MIT Licensed](http://www.opensource.org/licenses/mit-license.php)
* Copyright (c) 2013 Austin Hyde
*
*
* Implements a parser for INI files that supports
* * Section inheritance
* * Property nesting
* * Simple arrays
*
*
* Compatible with PHP 5.2.0+
*
*
* @author Austin Hyde
* @author Till Klampaeckel <till@php.net>
*/
Expand All @@ -24,13 +24,13 @@ class IniParser {

/**
* Enable/disable property nesting feature
* @var boolean
* @var boolean
*/
public $property_nesting = true;

/**
* Use ArrayObject to allow array work as object (true) or use native arrays (false)
* @var boolean
* @var boolean
*/
public $use_array_object = true;

Expand Down Expand Up @@ -58,7 +58,7 @@ class IniParser {

/**
* Array literals parse mode
* @var int
* @var int
*/
public $array_literals_behavior = self::PARSE_SIMPLE;

Expand Down Expand Up @@ -146,9 +146,9 @@ private function parseSections(array $simple_parsed) {
foreach ($sects as $s) {
if ($s === '^') {
$arr = array_merge($globals, $arr);
} elseif (array_key_exists($s, $output_sections)) {
} elseif (property_exists($output_sections, $s)) {
$arr = array_merge($output_sections[$s], $arr);
} elseif (array_key_exists($s, $sections)) {
} elseif (property_exists($sections, $s)) {
$arr = array_merge($sections[$s], $arr);
} else {
throw new UnexpectedValueException("IniParser: In file '{$this->file}', section '{$root}': Cannot inherit from unknown section '{$s}'");
Expand Down Expand Up @@ -194,7 +194,7 @@ private function parseKeys(array $arr) {
$current = array($current);
}

if (!array_key_exists($current_key, $current)) {
if (!property_exists($current, $current_key)) {
if (!empty($path)) {
$current[$current_key] = $this->getArrayValue();
} else {
Expand Down