Logo         Community
  Trog
Services
The Company
Community
Columns
Your Account
Contact Us
 
 
Configuration Manipulation With PHP Config
Use the PEAR Config class to read and write configuration files in XML, PHP and INI formats.

| Space And Time |

One of the most important tasks when building software applications is gaining a clear understanding of which parts of the application can be configured by the user, and which parts cannot. For example, if you're building a generic tool to administer databases, you would obviously want the DBA to be able to configure the application for different databases by inputting the database names and access parameters for each. However, you might not want to give the DBA control over other aspects of the application - for example, the protocol version used for communication with the RDBMS, or the method of RDBMS file access - as these would be internal to your code and also perhaps too complex for user-level configuration.

Although making such decisions might appear trivial and largely a matter of common sense, they are no small task, especially for complex applications - deciding which aspects of your software are configurable by the user is something that requires a thorough understanding of both the software's goals and the end-user requirements it is built to address, and it can take even experienced developers a fair amount of soul-searching to get it right.

Once the configuration variables within your application have been identified, it is traditional to separate them from the standard variable namespace and place them in a separate area, such that they may be manipulated independently. Most often, these variables are placed in one or more configuration files, and a user interface is built to interact with these variables, to read them, and to modify them as required.

That's where this article comes in. Over the next few pages, I'm going to introduce you to a toolkit designed specifically for manipulating configuration files, thereby reducing the number of lines of code needed to read and modify application variables. This toolkit is written in PHP, one of my favourite languages, and implemented as a class, suitable for use in any PHP-based application and accessible via standard OO techniques. Flip the page, and let me introduce you to Config.


How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!


more like this print this article  next page
 
Search...
 
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
more...
 
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
more...
 
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
more...
 
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
more...
 
In cut!...
American Chai
The Core
Possession
more...
 
Find out how you can use this article on your own Web site!


Copyright © 1998-2018 Melonfire. All rights reserved
Terms and Conditions | Feedback