views:

22

answers:

1

Currently the php framework I'm dealing with has a simple conf file with define's in it. The update I need to make is basically have simple client settings editable for the application which uses the framework. ( And there is a custom made CMS that is programmed to support this framework )

The framework doesn't rely on a database to store any settings nor content, its purely flat file based.

I'm trying to decide on a file type for the client editable settings file, which will contain simple non-confidential information that is public, such as:

  • site name
  • logo
  • address information
  • google id

I was thinking of just storing this as XML, in a format such as:

<settings>
    <setting name="site_name">Name of Site</setting>
    <setting name="google_id">1248498</setting>
    <setting name="logo" type="image"><![CDATA[ <img src="foo.gif"> ]]></setting>
</settings>

I'm still a bit confused on whether this is a decent file type, it seems like it's fine for most settings but the tricky part is I'll need to make the logo editable where it will be an img element, so I just wrapped it in CDATA section and gave it a custom attribute.

With this hopefully I'll just make a module within the CMS to edit this type of file. Looking for any tips anyone may have - and to reiterate I can't use a database, nor will I store important information such as passwords.. just basic public settings.

Thanks

+1  A: 

This format is fine, if you use a library to read and write the xml file, '<' and '>' should be automatically escaped for you.

Mathieu Pagé