From c5a08eeb6a5653b953f23c69147aeb52da9d66bc Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Tue, 21 Aug 2007 15:59:18 -0400 Subject: [PATCH] Removed a strict warning in listform.inc.php --- interface/lib/classes/ini_parser.inc.php | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-) diff --git a/interface/lib/classes/ini_parser.inc.php b/interface/lib/classes/ini_parser.inc.php index 349990f..4cb2e4f 100644 --- a/interface/lib/classes/ini_parser.inc.php +++ b/interface/lib/classes/ini_parser.inc.php @@ -1,4 +1,12 @@ <?php +/** + * ini parser + * + * @author Till Brehm + * @copyright 2005, Till Brehm, projektfarm Gmbh + * @version 0.1 + * @package ISPConfig + */ /* Copyright (c) 2006, Till Brehm, projektfarm Gmbh @@ -28,18 +36,16 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -class ini_parser { +class ini_parser{ - var $config; + private $config; - function parse_ini_string($ini) { - $ini = str_replace("\r\n","\n",$ini); - $lines = explode("\n",$ini); - + public function parse_ini_string($ini) { + $ini = str_replace("\r\n", "\n", $ini); + $lines = explode("\n", $ini); foreach($lines as $line) { - + $line = trim($line); if($line != '') { - $line = trim($line); if(preg_match("/^\[([\w\d_]+)\]$/", $line, $matches)) { $section = strtolower($matches[1]); } elseif(preg_match("/^([\w\d_]+)=(.*)$/", $line, $matches) && $section != null) { @@ -51,19 +57,18 @@ return $this->config; } - - - function get_ini_string($file) { + public function get_ini_string($file) { $content = ''; foreach($this->config as $section => $data) { $content .= "[$section]\n"; foreach($data as $item => $value) { - if($value != '') $content .= "$item=$value\n"; + if($value != ''){ + $content .= "$item=$value\n"; + } } } return $content; } - } ?> \ No newline at end of file -- Gitblit v1.9.1