Skip to main content
Inspiring
July 10, 2009
Question

Application.cfc importing variables

  • July 10, 2009
  • 3 replies
  • 1689 views

Hi all
In my application.cfc I have:

<cffunction name="onApplicationStart" returnType="boolean" output="false">
        <cfscript>
               Application.DNS = "BS";
               Application.SitePath = "D:\Sites\FF";
               Application.IPP = "10";
               Application.SiteName = "meta site name";
               Application.SiteKeywords = "equipmnet";
               Application.SiteDescription = "Meta Description";
               Application.SiteLogo = "logo.gif";
               Application.Key = "myzlvEmrSbUcyDFdwdfsdfsdfE";
          </cfscript>
        <cfreturn true>
    </cffunction>


I would like to move these variables into file outside the site folder.  How can I import this file into application.cfc again and set application variables?

This topic has been closed for replies.

3 replies

TiGGiAuthor
Inspiring
July 29, 2009

The reason I want to do this is to hide some sensisite data from that application.cfc file place it somewhere off the site.

July 29, 2009

You can do a few things, a cffile tag should be able to read something outside the web root. generally any shsared hosting gives you that for the exact purpose.

next - if you are really paranoid about it, store your parameters either encoded or encrypted, then decrypt before reading into the application scope -

most of that stuff does not look sensitive enough to be worth the bother, maybe the key value ...  but you could also store the params in a database [cept for the dsn]

-sean

BKBK
Community Expert
Community Expert
July 28, 2009

How can I import this file into application.cfc again and set application variables?

Why would you want to do that?

Inspiring
July 28, 2009

Well there are many ways to go about this.

  1. Load them from the database and then set them into application scope.
  2. create a configuration file that has them in, read that off the file system and then set them into application scope.

It really depends what you are trying to do. Is it because you are in a shared hosting and do not want these settings in a easily read text file? Or is there some other reason?