Some thoughts on Application Configuration

I've checked in some code into the BlogCFC 6 repo. Don't consider any code there as final code. Anything this early on is (most likely) temporary. While my main focus is on theming, there are some basic things I need to get out of the way. One of them is how the blog is configured at runtime. I've made some design decisions for v6 that I wanted to share (and get comments on).

1) In the past, you could have N blogs and one ORG folder. You configured the blog via the INI file. While this was handy, it separated your blog config from your blog install. I've moved to having config info in the same physical space as the blog client.

2) I switched from INI to XML. INI files had issues with non-latin chars. To be fair - it wasn't the INI file's fault, CF's functions to read them in. I never could them to correctly read in foreign chars. Even if I could - I'd move to XML anyway.

3) BlogCFC supports dynamic configuration. By that I mean you could configure it on the fly. I love this. It is what drives the blogs at RIAForge and other places. But to do so you edited Application.cfm. That's bad. What I'll be doing now is (most likely) simply including a file that is blank by default. This way you could edit the file for your settings and not worry about updates to Application.cfm in the core product.

4) If you look at the code I checked in, you will also see that I'm using the factory that Rob Gonda had made for Galleon. I plan on using this to help with the CFC creation. Why not ColdSpring? I'll say the same thing I say when folks ask why I don't use Model-Glue for BlogCFC. While I love MG, I prefer keeping BlogCFC as easy to install as possible, and with as few dependencies as possible.

TweetBacks
Comments
Scott P's Gravatar I pulled it down the other night and peeked at it. Could a person make a config folder with an extended application.cfc that doesn't allow pages to run out of it? That would protect the config file so you wouldn't need the comments to hide it.

make sense?
# Posted By Scott P | 11/1/07 10:53 AM
Raymond Camden's Gravatar CF can't block non-CF requests. Or do you mean - keep it as settings.cfm, but remove the comments?

Sure I could... but it seems like overkill compared to comments. I don't know. I could be convinced. If I did use another subfolder, I could put a override.cfm in there to handle the custom settings I mentioned earlier. Then all the config stuff is in a config folder.
# Posted By Raymond Camden | 11/1/07 10:59 AM
Scott P's Gravatar yeah - keep it .cfm but have onRequest check arguments.thepage to block the include of that file.

As far as overhead, it would only be fired if somone tried to pull the page up in the config folder.

   <cffunction name="onRequest" returnType="void">
      <cfargument name="thePage" type="string" required="true">

         <cfif arguments.thePage neq "settings.xml.cfm">
            <cfinclude template="#arguments.thePage#">
         <cfelse>
            <cfinclude template="../index.cfm">      
         </cfif>
   </cffunction>
# Posted By Scott P | 11/1/07 11:25 AM
Scott P's Gravatar or for that matter, don't run any cfm file from the config folder.

   <cffunction name="onRequest" returnType="void">
      <cfargument name="thePage" type="string" required="true">

         <cfinclude template="../index.cfm">      
   </cffunction>
# Posted By Scott P | 11/1/07 11:27 AM
Raymond Camden's Gravatar Or - just return false. Period. Ie, let the onRequestStart fail.
# Posted By Raymond Camden | 11/1/07 11:41 AM
Jake Munson's Gravatar "I prefer keeping BlogCFC as easy to install as possible, and with as few dependencies as possible."

Thanks for that, Ray. I wholeheartedly agree.
# Posted By Jake Munson | 11/1/07 1:34 PM
Tomas Fjetland's Gravatar Looks like you've made some excellent decisions, Ray. Sounds great!
# Posted By Tomas Fjetland | 11/1/07 7:51 PM
Ian Winter's Gravatar Keeping it simple is good. The beauty of BlogCFC is that it doesn't need any frameworks. Like the sound of themeing enhancements as well! Go Ray :)
# Posted By Ian Winter | 11/2/07 12:14 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.6.001. Contact Blog Owner