PHP
  Home arrow PHP arrow Configuration Manipulation With PHP Config
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Configuration Manipulation With PHP Config
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 61
    2003-09-04


    Table of Contents:
  • Configuration Manipulation With PHP Config
  • Plug And Play
  • Your Friendly Neighbourhood Hulk
  • Different Strokes
  • Array Of Hope
  • Up A Tree
  • Changing Things Around
  • Giving Birth
  • Link Zone

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Configuration Manipulation With PHP Config
    ( Page 1 of 9 )

    Tired of writing (and rewriting) code to manage your application's configuration variables? Take a look at the PEAR Config class, a PHP toolkit designed specifically for manipulating configuration files and the data within them. This article demonstrates using the Config class to read and write configuration files in XML, PHP and INI formats, and use built-in methods to easily build Web-based application configuration modules.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.



     
     
    >>> More PHP Articles          >>> More By icarus, (c) Melonfire
     

       

    PHP ARTICLES

    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek