>Okay, this is long, but here's some example code. Here's the dbdata
>(settings) cfc. You'd fill in "(yourdefault)" with whatever your default
>info is:
Thanks much Deanna! This indeed helps a lot. I'll be working on it tonight.
:)
Will
~~~
ED]>
Sent: Tuesday, September 20, 2005 8:26 AM
To: CF-Talk
Subject: Re: using an xml file for cfc settingsray style
Okay, this is long, but here's some example code. Here's the dbdata
(settings) cfc. You'd fill in "(yourdefault)" with whatever your default
in
The advantage of an object is that we have multiple applications that all
use this data. By putting it in an object, we can use the same data over
multiple objects, and more importantly, we can store the default data
outside the web root.
We certainly have a lot of code out there that does what
or
whether you read mydsn etc. from an init file, from XML, or maybe derive it
from the host name is subject to debate. However surely storing this data in
an object is just overly complicating something that can be simple?
Mike T
~~~
Okay, this is long, but here's some example code. Here's the dbdata
(settings) cfc. You'd fill in "(yourdefault)" with whatever your default
info is:
variables.dsn = "";
variables.username = "";
variables.password = "";
setDSN(arguments.dsn);
setUsername(arguments.username);
setPasswor
ubject: Re: using an xml file for cfc settingsray style
We create a Config object that wraps up all these sorts of settings
(DSN name, table aliases, application settings, etc.) and then just
pass that Config object into whatever other CFCs need acce
a! Now we're gettin' somewhere!
I was just thinking about doing it like this because I'm looping through and
creating separate app variables with the settings' values. But if I build a
settings struct that can be passed into the cfc, it would be mucho better.
The problem I have someti
I won't say this is "best" by any means - however, what I like to do
lately (and you may not see this in Galleon, or BlogCFC), is simply
pass a struct to all my CFCs. The struct contains all my settings. So
my init functions in the CFCs will take one arg, a structure. That
data is copied to the Var
(So, if we had a cfc
>that needed username, dsn, etc, we'd require that it be passed into an init
>function - the cfc doesn't know that the application scope exists.)
>
>Make sense?
Yes this makes good sense, but I think what would help most is if you could
show us some *REALLY* basic example c
You can also have a settings CFC that's accessible to both apps. You can
"hard code" the needed vars in the settings cfc as variables, but allow them
to be overwritten on initialization and then require an instance of the
settings cfc for each of your other cfcs. When I do this, I place the
set
We create a Config object that wraps up all these sorts of settings
(DSN name, table aliases, application settings, etc.) and then just
pass that Config object into whatever other CFCs need access to them.
On 9/18/05, Andy <[EMAIL PROTECTED]> wrote:
> I SET some of the application variables in eac
Im not sure what your questions/problems are? I have used an xml
config file for a while now and its not difficult. Are you asking how
to work with xml or is it more of an architecture question?
If you have one set of datasources and other resources that multiple
sites and systems will be using,
l Tomlinson <[EMAIL PROTECTED]>
Sent: Sunday, September 18, 2005 8:07 PM
To: CF-Talk
Subject: Re: using an xml file for cfc settingsray style
Can we please get some more input on this topic guys? I'd just like to know how
some o
Will Tomlinson wrote:
> Can we please get some more input on this topic guys? I'd just like to know
> how some of you handle these things.
Umm, we are still use ini rather than xml files but the overall
architecture is much the same. A lot of our sites use code that dates
back to CF 5 or even 4
Can we please get some more input on this topic guys? I'd just like to know how
some of you handle these things.
Thanks,
Will
~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.h
use at the same time."
From: "Andy" <[EMAIL PROTECTED]>
Sent: Sunday, September 18, 2005 3:29 PM
To: CF-Talk
Subject: RE: using an xml file for cfc settingsray style
Wow, I just read what I wrote...it is like English but different. But if
you lower your intelligence by a
Sunday, September 18, 2005 4:38 PM
To: CF-Talk
Subject: Re: using an xml file for cfc settingsray style
>Wow, I just read what I wrote...it is like English but different. But if
>you lower your intelligence by a few notches, you just might get the jist.
>Sorry.
I've been testing diffe
>Wow, I just read what I wrote...it is like English but different. But if
>you lower your intelligence by a few notches, you just might get the jist.
>Sorry.
I've been testing different ways of doin this. Ray tipped me off to a new
feature of XMLParse() in mx7 which lets you use filenames and u
: using an xml file for cfc settingsray style
Dave,
I have just started to use XML for file settings, so take this as a bigger's
stab.
I have about 80 lines in my application.cfc that sets things like file
locations, menus, security context, etc. I am in the process of moving them
into XML files
Dave,
I have just started to use XML for file settings, so take this as a bigger's
stab.
I have about 80 lines in my application.cfc that sets things like file
locations, menus, security context, etc. I am in the process of moving them
into XML files, one for each environment (dev, test, producti
20 matches
Mail list logo