0
Setting a server wide variable at startup

/t5/coldfusion-discussions/setting-a-server-wide-variable-at-startup/td-p/530465
May 09, 2007
May 09, 2007
Copy link to clipboard
Copied
Anyone have a way to set a server wide variable (likely in
the server scope) that gets set on server startup rather than in a
specific page request via a cfset.
What I would like to be able to do is set a variable external to any application that describes the servers role (ie. development, integration, staging, production) rather than hardcoding into the applications a test for server ip, name, etc.
Thanks
-Mike
What I would like to be able to do is set a variable external to any application that describes the servers role (ie. development, integration, staging, production) rather than hardcoding into the applications a test for server ip, name, etc.
Thanks
-Mike
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/setting-a-server-wide-variable-at-startup/m-p/530466#M48458
May 09, 2007
May 09, 2007
Copy link to clipboard
Copied
Server scope sounds like it's what you are looking for.
See http://livedocs.adobe.com/coldfusion/7/htmldocs/00001148.htm
Run this:
<cfdump var="#server#">
See http://livedocs.adobe.com/coldfusion/7/htmldocs/00001148.htm
Run this:
<cfdump var="#server#">
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/setting-a-server-wide-variable-at-startup/m-p/530467#M48459
May 09, 2007
May 09, 2007
Copy link to clipboard
Copied
Like I said in my post, I realize that the server scope is
the likely place for the variable. That wasn't my question. I want
to be able to set that variable external to my code base so that my
code can test the value to determine what setup it should be using.
Ideally I would hope that a parameter could be set in one of the files in the cf_root to indicate the role of the server.
Ideally I would hope that a parameter could be set in one of the files in the cf_root to indicate the role of the server.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/setting-a-server-wide-variable-at-startup/m-p/530468#M48460
May 09, 2007
May 09, 2007
Copy link to clipboard
Copied
That's a new one. I can't think of anything internal to CF
that would
accomplish this.
My first idea, assuming a windows world, you could do something in the
services start that would call some resource that would set this for
you. I have no idea how or know for sure this is possible.
My second idea is what might be done in the Java underpinnings. Could
something be done there.
There are several xml files that are parsed at start up, but I have no
idea how, if at all, extensible they are.
accomplish this.
My first idea, assuming a windows world, you could do something in the
services start that would call some resource that would set this for
you. I have no idea how or know for sure this is possible.
My second idea is what might be done in the Java underpinnings. Could
something be done there.
There are several xml files that are parsed at start up, but I have no
idea how, if at all, extensible they are.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/setting-a-server-wide-variable-at-startup/m-p/530469#M48461
May 09, 2007
May 09, 2007
Copy link to clipboard
Copied
What about a simpler idea?
A simple text|dat file in a known location on each server with the
server's role in it. This file could then be read and checked, and even
added into the server scope at that time, if desired.
A simple text|dat file in a known location on each server with the
server's role in it. This file could then be read and checked, and even
added into the server scope at that time, if desired.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/setting-a-server-wide-variable-at-startup/m-p/530470#M48462
Aug 30, 2007
Aug 30, 2007
Copy link to clipboard
Copied
Did anyone come up with a solution for this? I desire to do
the same thing. I don't want to add code to every single
application that checks the server's role. I want that set at
server startup.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/setting-a-server-wide-variable-at-startup/m-p/530471#M48463
Aug 30, 2007
Aug 30, 2007
Copy link to clipboard
Copied

Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

