I am running two COTS open source systems under my web root - Mura CMS and project tracker - and they both have a ini file with a cfm ending, and precautions to <cfabort> if it is accessed directly. The files are in a separate 'config' folder. http://svn.riaforge.org/projecttracker/trunk/config/
For Mura it seems to be written during install time, since I can't see it when browsing the svn repo. /Hugo -- Hugo Ahlenius [email protected] | -----Original Message----- | From: [email protected] [mailto:[email protected]] On Behalf Of | Aaron J. White | Sent: Saturday, March 17, 2012 21:08 | To: Open BlueDragon | Subject: Making it easy for users to define global application settings | | Hey all, | | Trying to write an open source application with OpenBD that is very | simple to deploy. A lot of opensource applications I use in php like | YOURLS or Joomla! usually have a simple configuration.php file that | you can open with a text editor to modify the variables. To me this | seems clean and easy for most users to do. I would like to emulate | this behavior in my app, but I don't want users to have to touch the | application.cfc. | | How would you guys do this? Below is my first attempt that works, | however, I don't know if there is a cleaner way or a way that doesn't | require an application restart. | | //** Start Code in Application.cfc **// | <cffunction name="onApplicationStart" returnType="boolean" | output="false"> | | <!--- define default settings ---> | <cfset application.defaults= { | setting1="notOverwritten", | setting2="notOverwritten", | setting3="notOverwritten", | setting4="notOverwritten" | } /> | | <!--- grab user settings ---> | <cfinclude template="settings.cfm" /> | | <cfreturn true > | </cffunction> | //** End Code Application.cfc **// | //** Start Code in Settings.cfm **// | <cfscript> | structAppend(application.settings, { | /*Change settings below this line*/ | | setting1: 'setting1', /* true */ | setting2: 'setting2', /* 'big' */ | setting3: 'setting3' /* 10 */ | | }); | </cfscript> | | //** End Code Settings.cfm **// | | -- | online documentation: http://openbd.org/manual/ | google+ hints/tips: https://plus.google.com/115990347459711259462 | http://groups.google.com/group/openbd?hl=en -- online documentation: http://openbd.org/manual/ google+ hints/tips: https://plus.google.com/115990347459711259462 http://groups.google.com/group/openbd?hl=en
