Solved

PHP - How to parse config files  .?

Posted on 2010-08-27
4
438 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

724 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