Solved

PHP - How to parse config files  .?

Posted on 2010-08-27
4
431 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
  • 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 109

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

810 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