Handyman wrote:dhn wrote: Not wanting to sound like a Coldfusion advocate, but after having to work with it for two projects, it was actually quite fun (as long as one ignores the stupid syntax, seriously wtf: I don't want to use tag based syntax in core code). It has very good and informative debugging messages, database handling is a breeze (ever tried to get Oracle to work with PHP?), and in my experience it was not as slow as people claim it it to be.
The main advantage is that Coldfusion makes a lot of stuff very easy for you, which of course is also the main disadvantage for serious developers. It doesn't give you a lot of options to play with.
well... you have me there. I've never tried to work with Oracle
I've only worked with MySQL and it's pretty easy
Probably because php and MySQL are both open source so they make sure they work together.
You should investigate cfscript if you are like allot of people and do not like the tag syntax. It gives more of an oo type feel to it. The only real exception is you still need to use <cfquery> for querying a database...although you could create a simple function that you can globally include to query via cfscript.
small example from one of my ses scripts:
Code: Select all
// depending on the web server, get the info from different cgi vars.
currentPath = '';
if (Len(cgi.request_uri)) {
currentPath = cgi.request_uri;
}
else if (Len(cgi.path_info)) {
currentPath = cgi.path_info;
}
if ((Len(currentPath)) AND ((Len(cgi.script_name) GT Len(currentPath)) OR (NOT find(".",currentPath)))) {
currentPath = cgi.script_name;
}
/* only do stuff if currentPath has len, otherwise it breaks the RemoveChars() function */
if (Len(currentPath)) {
/* replace any ?,&,= characters that are in the url for some reason */
cleanpathinfo=REReplace(currentPath, "\&|\=", "/" ,"ALL");
/* get everything after the first occurence of ".XXX/",
where XXX is .cfm, or whatever you use for your templates
In other words, get the query string */
cleanpathinfo=RemoveChars(cleanpathinfo,1,Find("/",cleanpathinfo,Find(".",cleanpathinfo,1)));
Code: Select all
<cfscript>
switch (URL.cmd) {
// Index
case "Home": {
GetPageContext().include('_content/index.cfm');
break;
}
// Collection
case "collection.index": {
GetPageContext().include('_content/collection/collection.cfm');
break;
}
case "collection.ejournals": {
GetPageContext().include('_content/collection/ejournals.cfm');
pagename='Electronic Journals List';
break;
}
default: {
GetPageContext().include('_content/index.cfm');
break;
}
}
</cfscript>
Code: Select all
<cfscript>
pageContent = variables.fullpage;
getPageContext().getOut().clearBuffer();
pageContent = reReplace(pageContent, chr(9),"", "all" );
pageContent = reReplace(pageContent, " ","", "all" );
pageContent = reReplace(pageContent, chr(13)&chr(10)&chr(13)&chr(10),chr(13)&chr(10), "all" );
pageContent = reReplace(pageContent, chr(10)&chr(13),"", "all" );
pageContent = reReplace(pageContent, "[[:space:]]+", " ","ALL");
writeOutput(pageContent);
getPageContext().getOut().flush();
</cfscript>