PHP Classes

Is this necessary?

Recommend this page to a friend!

      xconfig  >  All threads  >  Is this necessary?  >  (Un) Subscribe thread alerts  
Subject:Is this necessary?
Summary:Is this necessary
Messages:2
Author:Chris Rigg-Milner
Date:2015-08-11 14:41:20
 

  1. Is this necessary?   Reply   Report abuse  
Picture of Chris Rigg-Milner Chris Rigg-Milner - 2015-08-11 14:41:20
I take it you have not seen the php function parse_ini_file()

  2. Re: Is this necessary?   Reply   Report abuse  
Picture of philippe thomassigny philippe thomassigny - 2015-08-13 13:41:28 - In reply to message 1 from Chris Rigg-Milner
Hi Chris

I know parse_ini_file, the purpose of this library is not exactly the finality of a parse_ini_file (getting an array), but to have an OBJECT of configuration that you can manipulate easily and explode it into different file parts (cf. merge method).

Well. Indeed I could have used parse_ini_file for the compiler, maybe in a next version, have really to evaluate if it is going to make more complex the compiler analysis or not.

Oh but wait (taken from the PHP manual)
phpversion[] = "5.0"
phpversion[] = "5.1"
phpversion[] = "5.2"
phpversion[] = "5.3"
is a little tedious way to write a config file, sincerely I do prefer a lot more
phpversion=5.0
phpversion=5.1
phpversion=5.2
phpversion=5.3

and get:
$config->phpversion as an array("5.0", "5.1", "5.2", "5.3")
More suitable for any object oriented program and simplicity of things.

- Phil