From b1a6a5a3991cec5cd08873b01376e45d0b247f18 Mon Sep 17 00:00:00 2001 From: Marius Cramer <m.cramer@pixcept.de> Date: Thu, 14 Nov 2013 09:05:33 -0500 Subject: [PATCH] Cleaning up code to match coding guidelines --- interface/lib/classes/ini_parser.inc.php | 23 ++++++++++------------- 1 files changed, 10 insertions(+), 13 deletions(-) diff --git a/interface/lib/classes/ini_parser.inc.php b/interface/lib/classes/ini_parser.inc.php index 6821667..b8dffba 100644 --- a/interface/lib/classes/ini_parser.inc.php +++ b/interface/lib/classes/ini_parser.inc.php @@ -31,13 +31,13 @@ class ini_parser{ private $config; - + //* Converts a ini string to array public function parse_ini_string($ini) { $ini = str_replace("\r\n", "\n", $ini); $lines = explode("\n", $ini); foreach($lines as $line) { - $line = trim($line); + $line = trim($line); if($line != '') { if(preg_match("/^\[([\w\d_]+)\]$/", $line, $matches)) { $section = strtolower($matches[1]); @@ -49,8 +49,8 @@ } return $this->config; } - - + + //* Converts a config array to a string public function get_ini_string($config_array = '') { if($config_array == '') $config_array = $this->config; @@ -59,19 +59,16 @@ $content .= "[$section]\n"; foreach($data as $item => $value) { if($item != ''){ - $value = trim($value); - $item = trim($item); - $content .= "$item=$value\n"; - } + $value = trim($value); + $item = trim($item); + $content .= "$item=$value\n"; + } } $content .= "\n"; } return $content; } - - - - + } -?> \ No newline at end of file +?> -- Gitblit v1.9.1