application.cfm question
I'm testing some error checking stuff and don't understand why the application.cfm doesn't abort before an error is found in a file. Here's the application.cfm cfabort Here's the index.cfm cftest When the index.cfm is run, it shows the error information (Unknown tag: cftest). I would think that application.cfm would fire first and not even get to index.cfm. What am I'm missing here? Thanks in advance. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340333 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: application.cfm question
On 31/12/2010 9:55 PM, Richard Steele wrote: I'm testing some error checking stuff and don't understand why the application.cfm doesn't abort before an error is found in a file. Here's the application.cfm cfabort Here's the index.cfm cftest When the index.cfm is run, it shows the error information (Unknown tag: cftest). I would think that application.cfm would fire first and not even get to index.cfm. It is failing at compile time as that is a bad tag, it never gets as far as actually running the code because ity cannot compile it. Try putting a bad(unknown) variable name instead of a bad tag so the code compiles and then as it runs it will hit the cfabort and stop before it gets to the bad variable. If you are trying to error check at runtime for bad tags then you can't because it never gets that far. Hope that answer helps as I have to dash, some midnight fireworks to go to :-) Happy New Year everyone. -- Yours, Kym Kovan mbcomms.net.au ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340334 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: application.cfm question
The error you have there is a *compile time* *syntax* error, the code will be compiled before the request is 'run' which is why you see the error. If you change the code in index.cfm to cfset variable = undefinedVar /, the code will compile fine and will then abort in your app.cfm as the error that would be thrown by the undefined var would be a *runtime* error. HTH Dominic On 31 December 2010 10:55, Richard Steele r...@photoeye.com wrote: I'm testing some error checking stuff and don't understand why the application.cfm doesn't abort before an error is found in a file. Here's the application.cfm cfabort Here's the index.cfm cftest When the index.cfm is run, it shows the error information (Unknown tag: cftest). I would think that application.cfm would fire first and not even get to index.cfm. What am I'm missing here? Thanks in advance. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340335 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Googlebot got me good last night...Application.cfm question
Al Musella, DPM wrote: ever since then, I never use a link to make a change in my database. It is just too easy to trigger it by accident. Google ran into the same issue with their web accelerator plugin a while back. Too many people had actionable items behind links and it caused a lot of problems for people. It's actually part of the specifications that GET requests (links) are to be used only for retrieving information. Actions are not supposed to be taken based on a GET request to the server. Actions are supposed to be reserved for form, or POST requests. Unfortunately, many applications (some of my older ones included) don't follow those rules all the time and things get weird as a result. -Justin ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319623 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Googlebot got me good last night...Application.cfm question
cfif structKeyExists(cookie, CFID) AND structKeyExists(cookie, CFTOKEN) cfcookie name=CFID value=#cookie.cfid# / cfcookie name=CFTOKEN value=#cookie.cftoken# / /cfif OK, that works, but I don't get exactly what it's doing. It replaces the two standard CF-generated cookies which don't expire with two that will expire immediately the browser closes (the default behaviour of cfcookie). Ahhh... and I had just looked at the CF docs for cfcookie tag and noticed the following: If this tag specifies that a cookie is saved beyond the current browser session, the client browser writes or updates the cookie in its local cookies file. Until the browser is closed, the cookie resides in browser memory. If the expires attribute is not specified, the cookie is not written to the browser cookies file. Now it all makes sense :) Thanks! Mike ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319643 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Googlebot got me good last night...Application.cfm question
cfif structKeyExists(cookie, CFID) AND structKeyExists(cookie, CFTOKEN) cfcookie name=CFID value=#cookie.cfid# / cfcookie name=CFTOKEN value=#cookie.cftoken# / /cfif OK, that works, but I don't get exactly what it's doing. It replaces the two standard CF-generated cookies which don't expire with two that will expire immediately the browser closes (the default behaviour of cfcookie). btw, what's the purpose of the if statement? Why not just overwrite them regardless? Or is that to confirm that session management is enabled? Is there no other way to test that session management is enabled or is that the most efficient method? thanks! Mike ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319644 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Googlebot got me good last night...Application.cfm question
cfif structKeyExists(cookie, CFID) AND structKeyExists(cookie, CFTOKEN) cfcookie name=CFID value=#cookie.cfid# / cfcookie name=CFTOKEN value=#cookie.cftoken# / /cfif OK, that works, but I don't get exactly what it's doing. It replaces the two standard CF-generated cookies which don't expire with two that will expire immediately the browser closes (the default behaviour of cfcookie). btw, what's the purpose of the if statement? Why not just overwrite them regardless? Or is that to confirm that session management is enabled? Is there no other way to test that session management is enabled or is that the most efficient method? The point of cookies is that they're set once and kept for some duration; there's no need to set them on each subsequent page request (and it'll annoy people who've configured their browsers to prompt before accepting a cookie). Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319645 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Googlebot got me good last night...Application.cfm question
Dave Watts wrote: cfif structKeyExists(cookie, CFID) AND structKeyExists(cookie, The point of cookies is that they're set once and kept for some duration; there's no need to set them on each subsequent page request (and it'll annoy people who've configured their browsers to prompt before accepting a cookie). I guess the part I was wondering about was the logic for checking for both variables. Is there no other way to check if session management and client cookies are enabled? Don't know if you know the answer to this, but does CF automatically lose its session if one of those cookies are deleted? thanks! Mike ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319650 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Googlebot got me good last night...Application.cfm question
I guess the part I was wondering about was the logic for checking for both variables. Is there no other way to check if session management and client cookies are enabled? Don't know if you know the answer to this, but does CF automatically lose its session if one of those cookies are deleted? CF doesn't lose its session. But, if the browser doesn't return both cookies on each page request, CF will not be able to associate that session with that browser. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319651 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Googlebot got me good last night...Application.cfm question
--- Application --- CFPARAM NAME=session.allowin DEFAULT=false cfif session.allowin neq true cfif ListLast(CGI.SCRIPT_NAME, /) EQ ../login.cfm cfelseif ListLast(CGI.SCRIPT_NAME, /) EQ login_process.cfm cfelse !--- NOT LOGGED IN --- cflocation url=../login.cfm / /cfif /cfif Right now, I can login, and go to a page in the admin folder, copy the address, close the browser, and for the next 10 minutes, still get back in simply by putting the page address back in again. Currently, looking at my application.cfm file: clientmanagement=Yes sessionmanagement=Yes sessiontimeout=#CreateTimeSpan(0,0,10,0)# applicationtimeout=#CreateTimeSpan(0,0,10,0)# What's the best docs I need to be looking at to be **sure** that when they close their browser they are *OUT* and can't get back in without loggin in again REGARDLESS. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319573 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Googlebot got me good last night...Application.cfm question
cfif structKeyExists(cookie, CFID) AND structKeyExists(cookie, CFTOKEN) cfcookie name=CFID value=#cookie.cfid# / cfcookie name=CFTOKEN value=#cookie.cftoken# / /cfif ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319574 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Googlebot got me good last night...Application.cfm question
use j2ee sessions (setting in cf admin) Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Les Mizzell wrote: Right now, I can login, and go to a page in the admin folder, copy the address, close the browser, and for the next 10 minutes, still get back in simply by putting the page address back in again. Currently, looking at my application.cfm file: clientmanagement=Yes sessionmanagement=Yes sessiontimeout=#CreateTimeSpan(0,0,10,0)# applicationtimeout=#CreateTimeSpan(0,0,10,0)# What's the best docs I need to be looking at to be **sure** that when they close their browser they are *OUT* and can't get back in without loggin in again REGARDLESS. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319575 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Googlebot got me good last night...Application.cfm question
Matt Quackenbush wrote: cfif structKeyExists(cookie, CFID) AND structKeyExists(cookie, CFTOKEN) cfcookie name=CFID value=#cookie.cfid# / cfcookie name=CFTOKEN value=#cookie.cftoken# / /cfif OK, that works, but I don't get exactly what it's doing. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319576 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Googlebot got me good last night...Application.cfm question
Matt Quackenbush wrote: cfif structKeyExists(cookie, CFID) AND structKeyExists(cookie, CFTOKEN) cfcookie name=CFID value=#cookie.cfid# / cfcookie name=CFTOKEN value=#cookie.cftoken# / /cfif Hey Matt, I use that same code - how does it actually work? I never quite understood how it accomplished the goal killing the session when you closed the browser. Thanks! Mike ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319577 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Googlebot got me good last night...Application.cfm question
Les Mizzell wrote: Matt Quackenbush wrote: cfif structKeyExists(cookie, CFID) AND structKeyExists(cookie, CFTOKEN) cfcookie name=CFID value=#cookie.cfid# / cfcookie name=CFTOKEN value=#cookie.cftoken# / /cfif OK, that works, but I don't get exactly what it's doing. It replaces the two standard CF-generated cookies which don't expire with two that will expire immediately the browser closes (the default behaviour of cfcookie). -- Yours, Kym Kovan mbcomms.net.au ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319578 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Googlebot got me good last night...Application.cfm question
Nobody else mentioned it yet, but I had something similar happen many years ago - a link checking program was accidentally run on a password protected area of the website and did a lot of funny things to our database.. ever since then, I never use a link to make a change in my database. It is just too easy to trigger it by accident. I changed everything to use forms, or where that is not practical, javascript with a confirmation, in such a way that if javascript is disabled, the link can't work. And I always log every change made, (a copy of the old data, new data, user who changed it, datestamp, IP address of user) so in case of problems, I can reverse the damage (in addition to insanely frequent backups to multiple locations) As a bonus, I use this log to display the last 10 changes made on the website in my footer... so for example, when entering checks received, the user can see the last few things he entered and if there was a mistake, he can easily go back and edit it. Takes some fear out of computer illiterate people if they know they can fix any mistakes. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319583 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Googlebot got me good last night...Application.cfm question
I think it is probably a moot point, but it probably bears repeating. If you can run a link checker on your 'password protected' site, and that link checker can cause 'damage' to anything. Then you are not properly protecting your area. I have not yet come across a link checker that can submit a form, so the link checker should never have the authorization to run those pages in the protected area. An easy way to check this, without endangering your database, is to call a properly 'protected' page in your area directly from a browser that has it's javascript turned off and has had all of its cookies/session cookies, flushed. If the page runs as normal, then you have done something wrong. The good news is that we are here to help out. If, of course, you just need someone to do it for you. don't lose my number. :^) William -Original Message- From: Al Musella, DPM [mailto:muse...@virtualtrials.com] Sent: Thursday, February 19, 2009 8:46 PM To: cf-talk Subject: Re: Googlebot got me good last night...Application.cfm question Nobody else mentioned it yet, but I had something similar happen many years ago - a link checking program was accidentally run on a password protected area of the website and did a lot of funny things to our database.. ever since then, I never use a link to make a change in my database. It is just too easy to trigger it by accident. I changed everything to use forms, or where that is not practical, javascript with a confirmation, in such a way that if javascript is disabled, the link can't work. And I always log every change made, (a copy of the old data, new data, user who changed it, datestamp, IP address of user) so in case of problems, I can reverse the damage (in addition to insanely frequent backups to multiple locations) As a bonus, I use this log to display the last 10 changes made on the website in my footer... so for example, when entering checks received, the user can see the last few things he entered and if there was a mistake, he can easily go back and edit it. Takes some fear out of computer illiterate people if they know they can fix any mistakes. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319587 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
application.cfm question
One more newb question while I am at it. Does CF load application.cfm and onrequestend.cfm the application.cfm from an included file directory? IE: include.cfm - pulls /lib/foo/bar.cfm does /lib/foo/application.cfm also get loaded or does CF ignor that directory since in effect it is now include.cfm? Thanks again. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259752 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfm question
Coldfusion will look for an application.cfm at the current folder level and carry on up the directory tree until it finds one. The first that it finds will override any further up the tree On 11/9/06, John Cox [EMAIL PROTECTED] wrote: One more newb question while I am at it. Does CF load application.cfm and onrequestend.cfm the application.cfm from an included file directory? IE: include.cfm - pulls /lib/foo/bar.cfm does /lib/foo/application.cfm also get loaded or does CF ignor that directory since in effect it is now include.cfm? Thanks again. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259753 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: application.cfm question
On 11/9/06, RichL [EMAIL PROTECTED] wrote: Coldfusion will look for an application.cfm at the current folder level and carry on up the directory tree until it finds one. The first that it finds will override any further up the tree Thanks, I understand that part. What I don't understand is when you include a file from a different directory. Does it look at the included file's directory or just the directory that is calling the file. IE, is it possible that several application.cfms are loaded, or does ColdFusion only load the the application.cfm from the processed file's directory? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259754 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: application.cfm question
Application.cfm is called once per request. CFINCLUDE is not considered to be a request. However, the easiest way to test it is to add a CFMAIL or CFLOG tag to the application.cfm file and then try it on an included file. M!ke -Original Message- From: John Cox [mailto:[EMAIL PROTECTED] Sent: Thursday, November 09, 2006 7:31 AM To: CF-Talk Subject: Re: application.cfm question On 11/9/06, RichL [EMAIL PROTECTED] wrote: Coldfusion will look for an application.cfm at the current folder level and carry on up the directory tree until it finds one. The first that it finds will override any further up the tree Thanks, I understand that part. What I don't understand is when you include a file from a different directory. Does it look at the included file's directory or just the directory that is calling the file. IE, is it possible that several application.cfms are loaded, or does ColdFusion only load the the application.cfm from the processed file's directory? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259756 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: application.cfm question
Thanks Mike and Rich! On 11/9/06, Dawson, Michael [EMAIL PROTECTED] wrote: Application.cfm is called once per request. CFINCLUDE is not considered to be a request. However, the easiest way to test it is to add a CFMAIL or CFLOG tag to the application.cfm file and then try it on an included file. M!ke ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259758 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: application.cfm question
John CF will just process the application.cfm of the original file not from any directory where the included file comes from (if different from the calling file) e.g. /dir1/ /dir1/dir2 - both dir1 and dir2 have their own application.cfm If you have a file in dir1 and this includes a file in dir2, even though dir2 has an application.cfm, the application.cfm will be called from the directory of the original calling file e.g. dir1 Hope that helps and makes sense On 11/9/06, John Cox [EMAIL PROTECTED] wrote: Thanks Mike and Rich! On 11/9/06, Dawson, Michael [EMAIL PROTECTED] wrote: Application.cfm is called once per request. CFINCLUDE is not considered to be a request. However, the easiest way to test it is to add a CFMAIL or CFLOG tag to the application.cfm file and then try it on an included file. M!ke ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259759 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Simple Application.cfm Question
In the application.cfm I write the following: CFSET APPLICATION.webroot = http://www.mysite.com; Then I call this on certain pages in the application, such as: CFOUTPUT#APPLICATION.webroot#/CFOUTPUT My question is this: 1) Do I need to use locks around everytime I call this APPLICATION variable? 2) Can I get away with using a REQUEST variable instead of APPLICATION variable when I write CFSET commands, such as (I know I can do REQUEST variables for calling DSN connections): CFSET REQUEST.webroot = http://www.mysite.com; then CFOUTPUT#REQUEST.webroot#/CFOUTPUT Thanks, Mark __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Simple Application.cfm Question
In the application.cfm I write the following: CFSET APPLICATION.webroot = http://www.mysite.com; Then I call this on certain pages in the application, such as: CFOUTPUT#APPLICATION.webroot#/CFOUTPUT My question is this: 1) Do I need to use locks around everytime I call this APPLICATION variable? Well, the generic recommendation I give in this situation is, yes, you must lock every instance of any memory variable. There are those who disagree, specifically with Application or Server variables, who will argue that as long as the variable is locked, and only written to once, there shouldn't be any problem. In my opinion, I'd rather be safe than sorry, since memory variables have caused enough trouble in applications I've seen. 2) Can I get away with using a REQUEST variable instead of APPLICATION variable when I write CFSET commands, such as (I know I can do REQUEST variables for calling DSN connections): CFSET REQUEST.webroot = http://www.mysite.com; then CFOUTPUT#REQUEST.webroot#/CFOUTPUT Yes, not only can you get away with it, but in the case of variables which are essentially static through the lifespan of the application - datasource names, file paths, and the like - I'd strongly recommend that you use either the Request or the local Variables scope and simply set these variables in Application.cfm. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Simple Application.cfm Question
Thanks for your help Dave - this really helps. Thanks, Mark -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 14, 2002 2:16 PM To: CF-Talk Subject: RE: Simple Application.cfm Question In the application.cfm I write the following: CFSET APPLICATION.webroot = http://www.mysite.com; Then I call this on certain pages in the application, such as: CFOUTPUT#APPLICATION.webroot#/CFOUTPUT My question is this: 1) Do I need to use locks around everytime I call this APPLICATION variable? Well, the generic recommendation I give in this situation is, yes, you must lock every instance of any memory variable. There are those who disagree, specifically with Application or Server variables, who will argue that as long as the variable is locked, and only written to once, there shouldn't be any problem. In my opinion, I'd rather be safe than sorry, since memory variables have caused enough trouble in applications I've seen. 2) Can I get away with using a REQUEST variable instead of APPLICATION variable when I write CFSET commands, such as (I know I can do REQUEST variables for calling DSN connections): CFSET REQUEST.webroot = http://www.mysite.com; then CFOUTPUT#REQUEST.webroot#/CFOUTPUT Yes, not only can you get away with it, but in the case of variables which are essentially static through the lifespan of the application - datasource names, file paths, and the like - I'd strongly recommend that you use either the Request or the local Variables scope and simply set these variables in Application.cfm. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Simple Application.cfm Question
- Original Message - From: Mark Leder [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Sunday, April 14, 2002 11:54 AM Subject: Simple Application.cfm Question In the application.cfm I write the following: CFSET APPLICATION.webroot = http://www.mysite.com; Then I call this on certain pages in the application, such as: CFOUTPUT#APPLICATION.webroot#/CFOUTPUT My question is this: 1) Do I need to use locks around everytime I call this APPLICATION variable? Yes. You should. 2) Can I get away with using a REQUEST variable instead of APPLICATION variable when I write CFSET commands, such as (I know I can do REQUEST variables for calling DSN connections): CFSET REQUEST.webroot = http://www.mysite.com; then CFOUTPUT#REQUEST.webroot#/CFOUTPUT Yes. Or you can just use the standard variables scope if you don't need to access the variable from within cf tags. Either one avoids the need to lock the variable, but comes at a (very) slight performance hit since the variable is created and set in every request. Jim __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Simple Application.cfm Question
My preference in this situation is to always use request vars and create a struct for them. I use a local page for all scoping of variables and just do an include in my application page IE: !--- initialize the structures --- cfsilent !---Set our struct for global site variables//--- cfset request.site=structnew() !---Set our struct for local page variables//--- cfset request.page=structnew() !--- Root folder variable //--- cfparam name=request.site.cfroot default=/2netcorp.com !--- Site DSN variable --- cfparam name=request.site.forum_dsn default=2Netboard !--- Global Email address variables//--- cfset request.site.webmaster_email = [EMAIL PROTECTED] cfset request.site.support_email = [EMAIL PROTECTED] cfset request.site.info_email = [EMAIL PROTECTED] cfset request.site.sales_email = [EMAIL PROTECTED] cfset request.site.cust_service_email = [EMAIL PROTECTED] cfset request.site.forum_name = 2Net Corp Message Board /cfsilent Success is a journey, not a destination!! Doug Brown - Original Message - From: Dave Watts [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Sunday, April 14, 2002 11:16 AM Subject: RE: Simple Application.cfm Question In the application.cfm I write the following: CFSET APPLICATION.webroot = http://www.mysite.com; Then I call this on certain pages in the application, such as: CFOUTPUT#APPLICATION.webroot#/CFOUTPUT My question is this: 1) Do I need to use locks around everytime I call this APPLICATION variable? Well, the generic recommendation I give in this situation is, yes, you must lock every instance of any memory variable. There are those who disagree, specifically with Application or Server variables, who will argue that as long as the variable is locked, and only written to once, there shouldn't be any problem. In my opinion, I'd rather be safe than sorry, since memory variables have caused enough trouble in applications I've seen. 2) Can I get away with using a REQUEST variable instead of APPLICATION variable when I write CFSET commands, such as (I know I can do REQUEST variables for calling DSN connections): CFSET REQUEST.webroot = http://www.mysite.com; then CFOUTPUT#REQUEST.webroot#/CFOUTPUT Yes, not only can you get away with it, but in the case of variables which are essentially static through the lifespan of the application - datasource names, file paths, and the like - I'd strongly recommend that you use either the Request or the local Variables scope and simply set these variables in Application.cfm. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Simple Application.cfm Question
One nice thing about the request scope is that it's a structure, as opposed to the variables scope. -- Yes, not only can you get away with it, but in the case of variables which are essentially static through the lifespan of the application - datasource names, file paths, and the like - I'd strongly recommend that you use either the Request or the local Variables scope and simply set these variables in Application.cfm. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Simple Application.cfm Question
My understanding though is that you have to do a duplicate on any complex data types (structs, arrays, queries etc.) you copy from application to local page vars (whatever the scope) otherwise, without locks you are still open to corruption because you are accessing the original application var via a pointer rather than a unique local version of it. Douglas Brown wrote: My preference in this situation is to always use request vars and create a struct for them. I use a local page for all scoping of variables and just do an include in my application page IE: !--- initialize the structures --- cfsilent !---Set our struct for global site variables//--- cfset request.site=structnew() !---Set our struct for local page variables//--- cfset request.page=structnew() !--- Root folder variable //--- cfparam name=request.site.cfroot default=/2netcorp.com !--- Site DSN variable --- cfparam name=request.site.forum_dsn default=2Netboard !--- Global Email address variables//--- cfset request.site.webmaster_email = [EMAIL PROTECTED] cfset request.site.support_email = [EMAIL PROTECTED] cfset request.site.info_email = [EMAIL PROTECTED] cfset request.site.sales_email = [EMAIL PROTECTED] cfset request.site.cust_service_email = [EMAIL PROTECTED] cfset request.site.forum_name = 2Net Corp Message Board /cfsilent Success is a journey, not a destination!! Doug Brown - Original Message - From: Dave Watts [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Sunday, April 14, 2002 11:16 AM Subject: RE: Simple Application.cfm Question In the application.cfm I write the following: CFSET APPLICATION.webroot = http://www.mysite.com; Then I call this on certain pages in the application, such as: CFOUTPUT#APPLICATION.webroot#/CFOUTPUT My question is this: 1) Do I need to use locks around everytime I call this APPLICATION variable? Well, the generic recommendation I give in this situation is, yes, you must lock every instance of any memory variable. There are those who disagree, specifically with Application or Server variables, who will argue that as long as the variable is locked, and only written to once, there shouldn't be any problem. In my opinion, I'd rather be safe than sorry, since memory variables have caused enough trouble in applications I've seen. 2) Can I get away with using a REQUEST variable instead of APPLICATION variable when I write CFSET commands, such as (I know I can do REQUEST variables for calling DSN connections): CFSET REQUEST.webroot = http://www.mysite.com; then CFOUTPUT#REQUEST.webroot#/CFOUTPUT Yes, not only can you get away with it, but in the case of variables which are essentially static through the lifespan of the application - datasource names, file paths, and the like - I'd strongly recommend that you use either the Request or the local Variables scope and simply set these variables in Application.cfm. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Scheduler and application.cfm question
Hi, I am starting a project where a template will designed to be run from either the web-browser or via the CF scheduler. My question is: When the template is run buy the scheduler will it run the application.cfm template in the same directory or above as it does when run by a web browser? I have never had this come up before so I am not sure if I need to design the scheduled template different. Thanks in advance for your response. Best regards, Dennis Powers UXB Internet (203)879-2844 http://www.uxbinfo.com/ ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Scheduler and application.cfm question
yes, it will Vygandas Razhas Senior Web Developer/ Project Manager Eriss Macromedia Certified ColdFusion Developer, MCSD [EMAIL PROTECTED] ERISS San Diego, California From: Dennis Powers [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Subject: Scheduler and application.cfm question Date: Tue, 28 Aug 2001 14:59:42 -0400 Hi, I am starting a project where a template will designed to be run from either the web-browser or via the CF scheduler. My question is: When the template is run buy the scheduler will it run the application.cfm template in the same directory or above as it does when run by a web browser? I have never had this come up before so I am not sure if I need to design the scheduled template different. Thanks in advance for your response. Best regards, Dennis Powers UXB Internet (203)879-2844 http://www.uxbinfo.com/ ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Scheduler and application.cfm question
I am starting a project where a template will designed to be run from either the web-browser or via the CF scheduler. My question is: When the template is run buy the scheduler will it run the application.cfm template in the same directory or above as it does when run by a web browser? Yes, it will. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Scheduler and application.cfm question
Yes, it will. It acts like a 'real' web browser hit. === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus My ally is the Force, and a powerful ally it is. - Yoda -Original Message- From: Dennis Powers [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 28, 2001 3:00 PM To: CF-Talk Subject: Scheduler and application.cfm question Hi, I am starting a project where a template will designed to be run from either the web-browser or via the CF scheduler. My question is: When the template is run buy the scheduler will it run the application.cfm template in the same directory or above as it does when run by a web browser? I have never had this come up before so I am not sure if I need to design the scheduled template different. Thanks in advance for your response. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Scheduler and application.cfm question
On Tue, 28 Aug 2001, Dennis Powers wrote: My question is: When the template is run buy the scheduler will it run the application.cfm template in the same directory or above as it does when run by a web browser? Yes ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: application.cfm question a n other question
couldn't you put a file in the root directory, set CF_TEMPLATE_PATH to some var, then include that file and call the var? you'd have to strip out the name of the file that sets the var though. Yeah, that's a good idea. Didn't think about using a file other than Application.cfm (doh!). Thanks for the suggestion. -- Aidan Whitehall [EMAIL PROTECTED] Netshopper UK Ltd Advanced Web Solutions Services http://www.netshopperuk.com/ Telephone +44 (01744) 648650 Fax +44 (01744) 648651 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: application.cfm question
-- Original Message -- From: "river" [EMAIL PROTECTED] /root/ /root/www/ /root/www/cgi-bin/ Now, let's say there are multiple application.cfm files, one in each directory. When CF server executes a template in /root/www/cgi-bin/ directory, does it just look at the application.cfm file in the directory? yes Or does it go up to www and root to look at the application.cfm files in there as well? no How does it exactly work? it searches the current directory of Application.cfm, and if it DOESN'T find it then goes up a directory and searches again, and if doesn't find Application.cfm there, it goes up a directory and searches again, etc. And when it find Application.cfm it looks in that same directory for OnRequestEnd.cfm, which as appended to each file, just like Application.cfm is prepended to each file. Chris Norloff ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
application.cfm question
How does CF server look for application.cfm? For example, let's say there is a directory structure like this: /root/ /root/www/ /root/www/cgi-bin/ Now, let's say there are multiple application.cfm files, one in each directory. /root/application.cfm /root/www/application.cfm /root/www/cgi-bin/application.cfm When CF server executes a template in /root/www/cgi-bin/ directory, does it just look at the application.cfm file in the directory? Or does it go up to www and root to look at the application.cfm files in there as well? How does it exactly work? Thanks for help in advance. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: application.cfm question
It looks in Current directory first... if it doesn't find one there, it continues looking in every parent directory up to the root of the hard drive that the template sits on... If it finds one, it stops. Heath -Original Message- From: river [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 11:17 AM To: CF-Talk Subject: application.cfm question How does CF server look for application.cfm? For example, let's say there is a directory structure like this: /root/ /root/www/ /root/www/cgi-bin/ Now, let's say there are multiple application.cfm files, one in each directory. /root/application.cfm /root/www/application.cfm /root/www/cgi-bin/application.cfm When CF server executes a template in /root/www/cgi-bin/ directory, does it just look at the application.cfm file in the directory? Or does it go up to www and root to look at the application.cfm files in there as well? How does it exactly work? Thanks for help in advance. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: application.cfm question
ColdFusion first looks in the directory where the current template is being executed. If no application.cfm file is found, it will traverse up the DIRECTORY tree, ALL THE WAY to the root of the drive the application is on: /root/www/cgi-bin/ /root/www/ /root/ -Andy -Original Message- From: river [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 11:17 AM To: CF-Talk Subject: application.cfm question How does CF server look for application.cfm? For example, let's say there is a directory structure like this: /root/ /root/www/ /root/www/cgi-bin/ Now, let's say there are multiple application.cfm files, one in each directory. /root/application.cfm /root/www/application.cfm /root/www/cgi-bin/application.cfm When CF server executes a template in /root/www/cgi-bin/ directory, does it just look at the application.cfm file in the directory? Or does it go up to www and root to look at the application.cfm files in there as well? How does it exactly work? Thanks for help in advance. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: application.cfm question a n other question
How does CF server look for application.cfm? For example, let's say there is a directory structure like this: [ snip ] It looks for an application.cfm file in the same directory as the template that is being called. If it can't find one, it goes up a directory and looks for one there. If there's not one there, it keeps going up and up and up until well, I'm not quite sure. Perhaps someone else can enlighten you on that point. Oh, and it only ever processes the first one it comes across. When if finds an application.cfm file, it stops looking for any others. As an aside, it actually CFINCLUDES the application.cfm file into the template that's being called. Therefore, as far as ColdFusion is concerned, the physical location of the Application.cfm file *as it's seen from the template that it's being included in* can vary (don't know if that's explained that very well). I discovered this when I wanted to find out the hard drive path to my images directory. I thought you could do this in the application.cfm file: CFSET request.RootDir = GetDirectoryFromPath(GetTemplatePath()) CFSET request.ImagesDir = request.RootDir "images\" but request.RootDir always changes, depending on the location of the template that's being called. BTW, does anyone know how to do this? Is there a way of being able to find out the hard drive path to the root folder of a website? It's something I've never quite worked out and often needed... Thanks -- Aidan Whitehall [EMAIL PROTECTED] Netshopper UK Ltd Advanced Web Solutions Services http://www.netshopperuk.com/ Telephone +44 (01744) 648650 Fax +44 (01744) 648651 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: application.cfm question
Cold Fusion Server will look for Application.cfm in the directory that the template was called from and continue up the directory tree until it hits the root. This is an example using NT and IIS. So, If you call your application from d:\inetpub\root\www\cgi-bin\, it will look here first then d:\inetpub\root\www\, then d:\inetpub\root\, then d:\inetpub\, then d:\ stops here at the root of the drive. remember it's based on the physical path to the folder, not the mapped path in the webserver. HTH Jeff Garza Web Developer/Webmaster Spectrum Astro, Inc. 480.892.8200 [EMAIL PROTECTED] http://www.spectrumastro.com -Original Message- From: river [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 9:17 AM To: CF-Talk Subject: application.cfm question How does CF server look for application.cfm? For example, let's say there is a directory structure like this: /root/ /root/www/ /root/www/cgi-bin/ Now, let's say there are multiple application.cfm files, one in each directory. /root/application.cfm /root/www/application.cfm /root/www/cgi-bin/application.cfm When CF server executes a template in /root/www/cgi-bin/ directory, does it just look at the application.cfm file in the directory? Or does it go up to www and root to look at the application.cfm files in there as well? How does it exactly work? Thanks for help in advance. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: application.cfm question a n other question
couldn't you put a file in the root directory, set CF_TEMPLATE_PATH to some var, then include that file and call the var? you'd have to strip out the name of the file that sets the var though. e.g. in D:\inetpub\wwwroot create root_dir.cfm in root_dir.cfm just have CFSET rootdir=#Replace(CF_TEMPLATE_PATH, "root_dir.cfm", "", "ALL")# then when you need it, include /root_dir.cfm and call #rootdir# i'm making this up as i go...but seems like it would work. or at least something like it. -Original Message- From: Aidan Whitehall [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 8:35 AM To: CF-Talk Subject: RE: application.cfm question a n other question How does CF server look for application.cfm? For example, let's say there is a directory structure like this: [ snip ] It looks for an application.cfm file in the same directory as the template that is being called. If it can't find one, it goes up a directory and looks for one there. If there's not one there, it keeps going up and up and up until well, I'm not quite sure. Perhaps someone else can enlighten you on that point. Oh, and it only ever processes the first one it comes across. When if finds an application.cfm file, it stops looking for any others. As an aside, it actually CFINCLUDES the application.cfm file into the template that's being called. Therefore, as far as ColdFusion is concerned, the physical location of the Application.cfm file *as it's seen from the template that it's being included in* can vary (don't know if that's explained that very well). I discovered this when I wanted to find out the hard drive path to my images directory. I thought you could do this in the application.cfm file: CFSET request.RootDir = GetDirectoryFromPath(GetTemplatePath()) CFSET request.ImagesDir = request.RootDir "images\" but request.RootDir always changes, depending on the location of the template that's being called. BTW, does anyone know how to do this? Is there a way of being able to find out the hard drive path to the root folder of a website? It's something I've never quite worked out and often needed... Thanks -- Aidan Whitehall [EMAIL PROTECTED] Netshopper UK Ltd Advanced Web Solutions Services http://www.netshopperuk.com/ Telephone +44 (01744) 648650 Fax +44 (01744) 648651 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Application.cfm Question...
For to improve performance, should each directory have an application.cfm file in it? Perhaps just containing an include of the one in the Root Directory? Or is the overhead of searching upwards for the application.cfm so small that it is not worth the effort? Andy -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Application.cfm Question...
One other thing I forgot to mention in my previous mail is that once it finds the first application.cfm file during the search from the current directory upwards, it stops. It does not search upwards for any more application.cfm files. So, if you have an application.cfm file in your root, and another application.cfm in a subdirectory of /control, and you open any template in the /control directory, it will pre-pend the application.cfm file from the /control directory and nothing else. dBIII+ -Original Message- From: Gary McNeel, Jr. [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 25, 2000 4:42 PM To: Cf-Talk Subject: Application.cfm Question... Are application.(variablename) variables truly persistent. I am a bit confused here. I know that only one application.cfm file is executed automatically at any given time (others would have to be CFINCLUDEd). I have a main application.cfm file in the root of the site. I set the cfapplication (application and session management, name, etc.). I then set a few application variables like application.dsn and application.sitename, etc. That's about it. (ex: main root application.cfm) cfapplication name="BugTracking" setclientcookies="Yes" sessionmanagement="Yes" sessiontimeout="#CreateTimeSpan(0,0,20,0)#" applicationtimeout="#CreateTimeSpan(2,0,0,0)#" cflock timeout="30" throwontimeout="Yes" type="EXCLUSIVE" name="#Application.ApplicationName#" cfset application.dsn = "BugTracking" !--- Sets the datasource to use --- cfset application.sitename = "Item Tracking" /cflock A directory level down I add another application.cfm that does a very quick security check for user access to this area (yes/no field in db). In the CFQUERY I use a datasourcename="#application.dsn#". I have, in the past, just copied the application.cfm from the root into the other folder and deleted anything not necessary, leaving the cfapplication and application variables, then adding any other code. ex: sub directory application.cfm cfif isdefined("cookie.PeopleID") cfquery datasource="#application.dsn#" name="qryAuthen" SELECT PeopleID, PeopleFirstName, PeopleLastName, PeopleDACStaff FROM tblPeople WHERE PeopleID = #cookie.PeopleID# /cfquery cfelse cflocation addtoken="No" url="../mainMenu.cfm" cfabort /cfif Today I went ahead and deleted everything EXCEPT the little security query (above) to see what would happen. Now the application can't seem to find my application.dsn variable. Does the running of another application.cfm file flush the variables created previously? Shouldn't the application variables be available for the life of the application AS LONG as they are not flushed (STRUCTCLEARED or DELETED) or changed? Why would running another application.cfm, that does not delete or change the earlier set application variables, make them unavailable to the application? Do you have to re-create the application.cfm file for each subfolder? TIA Gary McNeel, Jr. Project Manager - DAC-Net, Research Graduate Studies Rice University - Houston [Lovett Hall] 713-348-6266 (Primary) [DAC] 713-348-5184 [M] 713-962-0885 [H] 713-723-9240 "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Application.cfm Question...
in your subdirectory application.cfm did you name the application again? CFAPPLICATION NAME="bugTracking"? since application variables belong to specific applications, i think you need to specifically declare that it's stil part of the same application. -emily At 03:41 PM 4/25/2000 -0500, you wrote: Are application.(variablename) variables truly persistent. I am a bit confused here. I know that only one application.cfm file is executed automatically at any given time (others would have to be CFINCLUDEd). -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Application.cfm Question...
Whoops. Here's a classic case of not understanding the question before answering it. (Hey! It was 1am!) Sorry 'bout that. I'm booking passage off-planet now. ;) dBIII+ -Original Message- From: Daniel Wm Brick III [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 26, 2000 1:08 AM To: [EMAIL PROTECTED] Subject: RE: Application.cfm Question... Application variables are only persistent because application.cfm file is pre-pended to each and every template that is opened (not CFINCLUDED) by the CF server. The rule goes that the CF server will first search the current directory where the CF template is located for an application.cfm file and pre-pend it. If not found in the current directory, it will search upwards from the current directory until it finds one. I believe the search stops at the web root. Hope this answers your question. dBIII+ -Original Message- From: Gary McNeel, Jr. [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 25, 2000 4:42 PM To: Cf-Talk Subject: Application.cfm Question... Are application.(variablename) variables truly persistent. I am a bit confused here. I know that only one application.cfm file is executed automatically at any given time (others would have to be CFINCLUDEd). I have a main application.cfm file in the root of the site. I set the cfapplication (application and session management, name, etc.). I then set a few application variables like application.dsn and application.sitename, etc. That's about it. (ex: main root application.cfm) cfapplication name="BugTracking" setclientcookies="Yes" sessionmanagement="Yes" sessiontimeout="#CreateTimeSpan(0,0,20,0)#" applicationtimeout="#CreateTimeSpan(2,0,0,0)#" cflock timeout="30" throwontimeout="Yes" type="EXCLUSIVE" name="#Application.ApplicationName#" cfset application.dsn = "BugTracking" !--- Sets the datasource to use --- cfset application.sitename = "Item Tracking" /cflock A directory level down I add another application.cfm that does a very quick security check for user access to this area (yes/no field in db). In the CFQUERY I use a datasourcename="#application.dsn#". I have, in the past, just copied the application.cfm from the root into the other folder and deleted anything not necessary, leaving the cfapplication and application variables, then adding any other code. ex: sub directory application.cfm cfif isdefined("cookie.PeopleID") cfquery datasource="#application.dsn#" name="qryAuthen" SELECT PeopleID, PeopleFirstName, PeopleLastName, PeopleDACStaff FROM tblPeople WHERE PeopleID = #cookie.PeopleID# /cfquery cfelse cflocation addtoken="No" url="../mainMenu.cfm" cfabort /cfif Today I went ahead and deleted everything EXCEPT the little security query (above) to see what would happen. Now the application can't seem to find my application.dsn variable. Does the running of another application.cfm file flush the variables created previously? Shouldn't the application variables be available for the life of the application AS LONG as they are not flushed (STRUCTCLEARED or DELETED) or changed? Why would running another application.cfm, that does not delete or change the earlier set application variables, make them unavailable to the application? Do you have to re-create the application.cfm file for each subfolder? TIA Gary McNeel, Jr. Project Manager - DAC-Net, Research Graduate Studies Rice University - Houston [Lovett Hall] 713-348-6266 (Primary) [DAC] 713-348-5184 [M] 713-962-0885 [H] 713-723-9240 "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Application.cfm Question...
For to improve performance, should each directory have an application.cfm file in it? Perhaps just containing an include of the one in the Root Directory? Or is the overhead of searching upwards for the application.cfm so small that it is not worth the effort? Andy -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.