|
My MO has always been to create a little cffunction that loads up
all the ini vars (things like datasource name, file paths, admin
emails, external servers, etc) - and put them into the application
scope. I hit the little function onApplicationStart - and I might have some other event or trigger to fire off that little function as needed. Because it's often the app's administrator who can change the contents of the ini file - he or she just knows to trigger the reload if he/she changes it (often by placing a secret word in a url query string, like "domain.com/?iniReload=1" - that's picked up with a code snippet you can put in the onRequestStart function. I will often place these ini files in the cfml engine's root, using the Application.name as part of the file spec and the platform's 'server' scope to find it. This feature is generally provided as a mechanism to store variables - that are exclusive to that machine - outside the public web path and also your source code control (like SVN); so that your application code base remains pure (does not become riddled with the bunch of "if I'm a dev machine then I'll do this" files or conditions). You could also get all fancy pants, and actually "sense" when the file has changed automatically, but now you're starting to stretch the whole purpose of what "ini" even stands for. If they change all the time, then they're not really "initialize" values at all, are they? ;-] If they change like ... per-user, then put 'em in a database, session scope or encrypted cookie, load 'em up when the user authenticates. Al On 3/31/2012 11:26 AM, Aaron J. White wrote: --Hey Guys, I recently choose .ini files to store user defined application variables in. I will be grabbing the variables I need throughout my application with the getprofilestring and getprofilessection functions. online documentation: http://openbd.org/manual/ google+ hints/tips: https://plus.google.com/115990347459711259462 http://groups.google.com/group/openbd?hl=en |
- [OpenBD] ini file caching -- Is it necessary? Aaron J. White
- Re: [OpenBD] ini file caching -- Is it necessary? Alan Holden
- [OpenBD] Re: ini file caching -- Is it necessary? Aaron J. White
