• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 454
  • Last Modified:

PHP - How to parse config files .?

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
kingroland
Asked:
kingroland
  • 2
2 Solutions
 
Richard QuadlingSenior Software DeverloperCommented:
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
 
Ray PaseurCommented:
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
 
kingrolandAuthor Commented:
Thank you for all your advise. I have learned something new again. it could help me make decision for the nextproject.
0
 
Richard QuadlingSenior Software DeverloperCommented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now