PHP Developer's Network : Network Member Forums

Class: Configuration Loader



  Search   All class groups   Latest entries   Top 10 charts   Newsletter   Blog   Forums   Help FAQ  
  Login   Register  
Recommend this page to a friend! Trackback URL: http://www.phpclasses.org/trackback/browse/package/4517.html
      Classes of David Wainwright  > 
Configuration Loader
 >  Download  >  Support forum Support forum  >  RSS 1.0 feed RSS 2.0 feed Latest changes  >  Stumble It! Stumble It!  >  Bookmark in del.icio.us Bookmark in del.icio.us  
  Supplied by   Group folder image Groups   Detailed description  
  Applications   Files Files  
  • Supplied by:

  • Picture of David Wainwright
    Name: David Wainwright <e-mail contact>
    Published packages: 1
    Country: United Kingdom United Kingdom - PHP professionals from United Kingdom looking for PHP jobs
    Home page: ???

    Browse this author's classes

  • Innovation Award:

  • PHP Programming Innovation award nominee
    April 2008
    Nominee
    Vote
    XML is often used by humans to store information that can easily be parsed by computer programs, like for instance application configuration options.

    However, XML parsing is often a process that consumes too much CPU and memory when parsing many documents or the same document many times.

    This class provides a solution to override the overhead of repeatedly parsing XML configuration files. It creates a PHP class file with variables set to the configuration values retrieved from the XML file.

    This way the XML file does not have to be parsed in all requests on which its information is needed. The speedup can be further optimized by using a PHP caching engine extension, as the generated PHP class does not need to be parsed and compiled again.

    Manuel Lemos
  • Groups:

  • Group folder image
    XML parsing and generation
    View top rated classes
    Group folder image
    Classes using PHP 5 specific features
    View top rated classes
    Group folder image
    Compilers and tools that generate code automatically
    View top rated classes
    Group folder image
    Configuration formats parsing and generation
    View top rated classes
  • Detailed description:

  • Auto-generates a set of php configuration classes from a supplied xml file.

    This class can be used to generate a PHP class from an XML file. The element (tag) names become property names and the text contained in the elements becomes the property's value. It also supports nested elements.

    If the generated php file is older than the xml file, it is re-generated using the data in the newer xml file.

    For example, this xml file:
    <config>
    <database>
    <connString>This is my connection string</connString>
    </database>
    </config>

    Would be accessed in php as follows (after the ConfigurationLoader.update method had been called:
    $config = new config();
    echo $config->database->connString;

    This class also supports array types using the <item> element inside an element whose type attribute is set to "array". Please read the documentation and see example xml files for more details.

    Once you have your configuration classes you can get or set the values as required.
  • Applications that use this class:

  • No application links were specified for this class.
    Add link image If you know an application of this package, send a message to the author to add a link here.
  • Files:

  • File Role Description
    Plain text file config.xml Doc.
    example config file
    Plain text file ConfigurationLoader.class.php Class
    class file
    Plain text file COPYING Lic.
    license
    Plain text file example.php Example
    Example script
    Plain text file example.xml Data
    example xml file
    Plain text file README Doc.
    Setup Instructions
    Download all files: configurationloader.tar.gz configurationloader.zip
    NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.

 
  Advertise on this site   Site map   Statistics   Site tips   Privacy policy   Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2008 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products