|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Sharing Application Files
Hey Everyone
I have an application I have written and so far I have 3 different sites running it. The only thing different on all these sites is the data source name that coldfusion uses to get the data. I want to know if there is a way to have all the sites use the same files so every time I make a change I don’t have to upload it to three places. I have been looking and can’t find anything that will help me. The first thing my application.cfm page does is set the data source and that’s the only piece of information I need to change. I tried a virtual directory in IIS but it will not carry over the Application variable into a virtual folder. Any help would be greatly appreciated |
|
#2
|
|||
|
|||
|
The short answer is, of course there is...you should never have duplicate code if you can avoid it.
Now how you do this gets more complex depending on what you need to do. The easiest thing is probably to have the files that you want to reuse in a common directory, and then you can create a CF mapping and/or an IIS mapping to that "common" directory, and from your applications you just use cfinclude to call the common files. You could also consider creating custom tags to wrap up the logic that you want to reuse, or create a set of ColdFusion Components (CFCs) to encapsulate the common code if you prefer a more OO solution.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
I took some time last night and made a switch statement in the application.cfm to read the CGI.SERVER_NAME then set the data source according to that. Is it ok to have IIS reading these files for multiple sites at the same time.
|
|
#4
|
|||
|
|||
|
Quote:
|
|
#5
|
|||
|
|||
|
Thanks for all your help.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Sharing Application Files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|