Solved

PHP - How to parse config files  .?

Posted on 2010-08-27
4
434 Views
Last Modified: 2013-12-13
PHP - How to parse config files  .?

Hello Mr.Experts,
Thank you for all your valuable advices.

I work for a small private Software Development company that take coract tasks
with many small businesses and hi-tech software farm in California.
I am looking to take another monthly project in September.

It is a web application development project which involves both Front end and
back end programming (PHP, JS, CSS, XHTML, MySQL)

I am OK comfortable with all skill required for that project except one
requirement as mentioned below.
Could you advise what is means and where or how to find tutorials or codes...?
I have no idea what it is and tying to figure it out...
Thank you. Any help is appreciated.

It says:

"This project required experience and skill to parse config files, show command outputs etc"

0
Comment
Question by:kingroland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 300 total points
ID: 33545949
Config files ...

Unless that is a specific form of file (and if it is what a terrible name), then really, without some example, its a no go.

BUT ...

PHP can open ANY file. Not necessarily provide you with a completely parsed file, but it will allow you to open a file.

File types that PHP can natively access and provide valid content without string/byte manipulation ...

INI files - http://docs.php.net/manual/en/function.parse-ini-file.php
XML files - http://docs.php.net/manual/en/refs.xml.php (many mechanisms depending upon your requirement/complexity).

Those would be the main 2.

On top of that, you have all the usual vanilla file processing calls (fgets(), fread(), etc.).


So. If you have a "config" file that we can see, let us have it so we can give you a better response.
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 200 total points
ID: 33549710
You should ask the person who wrote the RFP to provide you with an example of what this requirement means.  The general idea about "config" files would suggest that a software package has some underlying structure that is client-defined.  Since that could mean a lot of things, your best bet is to get the issue cleared up BEFORE you make a commitment to do the work.  Otherwise the RFP could mean almost anything and you would wind up with an open-ended obligation!
0
 

Author Closing Comment

by:kingroland
ID: 33561540
Thank you for all your advise. I have learned something new again. it could help me make decision for the nextproject.
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33565553
INI files are very good for simple structures. Ideally, non related sections, though you can simulate levels (ala Zend_Config when using INI files).

XML files allow far more complex structuring.


By using a tool along the lines of Zend_Config, you can use 1 tool to read/write the config, but store the data in the appropriate way.


0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question