Solved

PHP - How to parse config files  .?

Posted on 2010-08-27
4
429 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:
RQuadling 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 108

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:RQuadling
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now