Login   Register  
PHP Classes
elePHPant
Icontem

File: config.xml

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of David Wainwright  >  ezphpconfig  >  config.xml  >  Download  
File: config.xml
Role: Documentation
Content type: text/plain
Description: example config file
Class: ezphpconfig
Converts xml config file into a set of php classes
Author: By
Last change: Added more test cases and comments
Date: 6 years ago
Size: 1,656 bytes
 

Contents

Class file image Download
<config>
    <!-- You can add comments as well  -->
    <rootDirectory>/home/user/projects/myProject</rootDirectory>
    <database>
        <primary>
            <host>myDbServer1</host>
            <username>user2</username>
            <password type="string">letmein</password>
            <timeout>10</timeout>
            <portNo />
        </primary>
        <secondary>
            <host>myDbServer2</host>
            <username>user2</username>
            <password></password> <!-- null value  -->
            <timeout type="int">25</timeout>
            <portNo type="string" /> <!-- null value cast as string -->
        </secondary>
    </database>
    <web>
        <cardTypes type="array">
            <item value="Maestro" />
            <item value="UK Visa Debit" />
            <item type="string" index="V" value="Visa" />
            <item type="int" index="N" />
            <item index="M" value="Mastercard" />
            <item /> <!-- null value added with numeric index -->
            <item></item> <!-- null value with numeric index -->
            <item value="" /> <!-- blank string with numeric index -->
            <item index="D">Debit</item>
            <item type="string" /> <!-- null value cast as string -->
        </cardTypes>
    </web>
    <test>
        <test1 value="david">Wainwright</test1> <!-- Should populate with 'david'  -->
        <test2 /> <!-- populates with null value and no cast -->
        <test3 value="12" type="string" /> <!-- Should populate with "12" -->
        <test4 type="string">12</test4> <!-- Should populate with "12" -->
    </test>
</config>