|
Revision 5, 0.7 kB
(checked in by DanWilson, 17 years ago)
|
|
Initial Commit Of ModelGlue? Website (upgrade to blogcfc 511)
|
| Line | |
|---|
| 1 | <cfcomponent displayName="Galleon" hint="Core CFC for the application.galleon. Main purpose is to handle settings."> |
|---|
| 2 | |
|---|
| 3 | <cffunction name="getSettings" access="public" returnType="struct" output="false" |
|---|
| 4 | hint="Returns application settings as a structure."> |
|---|
| 5 | |
|---|
| 6 | <!--- load the settings from the ini file ---> |
|---|
| 7 | <cfset var settingsFile = replace(getDirectoryFromPath(getCurrentTemplatePath()),"\","/","all") & "/settings.ini.cfm"> |
|---|
| 8 | <cfset var iniData = getProfileSections(settingsFile)> |
|---|
| 9 | <cfset var r = structNew()> |
|---|
| 10 | <cfset var key = ""> |
|---|
| 11 | |
|---|
| 12 | <cfloop index="key" list="#iniData.settings#"> |
|---|
| 13 | <cfset r[key] = getProfileString(settingsFile,"settings",key)> |
|---|
| 14 | </cfloop> |
|---|
| 15 | |
|---|
| 16 | <cfreturn r> |
|---|
| 17 | |
|---|
| 18 | </cffunction> |
|---|
| 19 | |
|---|
| 20 | </cfcomponent> |
|---|