Andrew Clarke

systems architect, internet developer, team leader

Andrew Clarke

settings.ini

Here's an example settings.ini:

[Values]

mapping_CFCs_base=ca.clarke.cfscaffold

mapping_factory_custom=

mapping_templates_base=/CFScaffold

emailErrors=false

email_errors_from=CFScaffold_from@andrewclarke.ca

email_errors_to=CFScaffold_to@andrewclarke.ca

path_logs=

path_layouts=layouts

layout=default

staticSalt=34D79953-F149-448E-D267FAC12DA79491

secretKey=RVPhbPovZtZTxu%2FJZG%2BQEAbElMVZWlczTsa41Wkl0rk%3D

allowAutoRelocation=true

actionVariableName=action

 

[dev]

allowAutoRelocation=false

 

The first thing to know is that you don't need a [dev] section (or [test] or [staging] sections, not shown).  By default, any value listed under [Values] will be placed as a setting, available by using Settings.getSetting("<setting name>").  You'll probably never need to actually GET a setting, as that's done within CFScaffold.

If you set request.siteMode to "live", the values from [Values] will be used.  If you set request.siteMode to "dev", "test", or "staging", the setting from that section will override the default "live" value in [Values] if it exists.  For example, above in dev enableAutoRelocation==false, whereas in all other siteModes it is true.  This way you can use one settings.ini file hopefully for all your environments without having to modify it as you move code from development into production.

Now for an explanation of all the variables.  If it's not listed here and you see it in your settings.ini, it's probably just something I forgot to delete.

mapping_CFCs_base: This is the default mapping to your CFScaffold objects.  Note that they inherit from objects located in ca.clarke (i.e. extends="ca.clarke.Base") so even though technically you can move the mapping of the CFScaffold objects, you can't move the mappings of the ca.clarke general objects without modifying code.  This value should not have a trailing dot.

mapping_factory_custom: You can override the default factory object with your own.  This way you could put your own factory in, say, someMapping.Factory and extend the CFScaffold factory.  If you do this, set the mapping to your Factory object using this line.  This will just be used for loading your factory, but won't be used for instantiating any other objects, which will still be in the variable you set in mapping_CFCS_base.  If you set a value for this, it will need a trailing dot, i.e. "com.example.".

mapping_templates_base: This is the base location for your layout templates.  If you have put CFScaffold in /CFScaffold under your web root you don't need to change this.  If you put your layouts somewhere else, modify this variable.

emailErrors: You can optionally have errors that CFScaffold generates emailed out.  Set this to true if you want it.  By default this is off.  Data with names that look like they should be secure, i.e. "password", will be encrypted or hashed.

email_errors_from: The address from which error emails will be sent, if you have them turned on.

email_errors_to: The address to which error emails will be sent, if you have them turned on.  If you want to be really nice, you can include CFSCaffold_to@andrewclarke.ca in the "to" field to have errors sent to me too.  That will help me understand what's going wrong and fixing issues faster.

path_logs: By default, error logs will be written to <cfscaffold_home>/logs.  If you want to write them somewhere else, put the full path here.

path_layouts: This is the subdirectory where your layouts are stored, under whatever you have put for mapping_templates_base.

layout: This is the name of the default layout you wish to use.  So, this layout will be stored in <mapping_templates_base>/<path_layouts>/<layout>

staticSalt: This variable is used in Security.cfc, and is generated automatically by that object.

secretKey: This variable is used in Security.cfc, and is generated automatically by that object.

allowAutoRelocation: You'll probably want to have this set to true all the time.  You can set it to false to bypass automatic cflocations in the code and have it generate a link instead.  The generated links aren't really customer-friendly but are useful for debugging.

actionVariableName: The default URL or form variable name for CFScaffold's actions is "action".  However, this may interfere with your framework's action variable if you are embedding CFScaffold in another application.  You can change the variable name that CFScaffold passes for its action by changing the value here.

3 Comments

3 responses so far ↓

  • 1 Mark // Feb 19, 2011 at 9:24 PM

    Is there no create tables script for mySQL?
  • 2 Andrew Clarke // May 5, 2011 at 11:03 AM

    In case anyone else is wondering about this, CFScaffold uses ColdFusion's ORM (object-relational mapping). Therefore, you do not use SQL to create your tables. Your CFML engine (Railo or ColdFusion) will do this for you, based on the information you provide when you create your entities.

Leave a Comment

Leave this field empty