Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make ColdFusion on Ubuntu case-insensitive

I've installed apache2 and ColdFusion 9 on an Ubuntu 12.04 box. I've already use the CheckSpelling mod in Apache to disable case-sensitive URLs and other paths that Apache is responsible for.

Now, keep in mind, I'm working with about 4GB of legacy code (about 6 years worth) and very little is up to convention. The coders before me were not concerned with case sensitivity, seeing as how the application was hosted on a Windows Box. For the most part, ColdFusion is behaving with <cfinclude> and CreateObject, but it seems like <cfinvoke> (which is used quite often in the codebase) is still case sensitive.

Now, I've tried the method of moving the code onto a vfat partition, but what I ran into was a whole bunch of encoding issues with filenames (we deal with foreign companies and get a lot of special characters). Deleting and/or renaming the files would be cumbersome, as most are also referred to in the MySQL database, and would have to be modified there as well. So recoding is somewhat of a nightmare.

So, I'm curious if ColdFusion has any special flags when running on Linux to be case insensitive, or if there is another method for making this all come together?

EDIT

I'm Sorry, I was mistaken. cfinvoke seems to work ok. I'm choking on cfobject

like image 212
Kyle Macey Avatar asked May 09 '12 18:05

Kyle Macey


People also ask

Is ColdFusion case sensitive?

ColdFusion is not case sensitive.

Can Linux make cases insensitive?

The case sensitivity attribute can only be set on directories within an NTFS-formatted file system. Directories in the WSL (Linux) file system are case sensitive by default (and cannot be set to be case insensitive using the fsutil.exe tool).

How do you do a case-insensitive search in Linux?

Case-insensitive file searching with the find command The key to that case-insensitive search is the use of the -iname option, which is only one character different from the -name option. The -iname option is what makes the search case-insensitive.

Are Ubuntu cases insensitive?

This is the difference between Windows and Ubuntu (any Linux). Ubuntu file and folder names are case sensitive.


1 Answers

I did some research, and this is what I came up with...

Creating Custom Tags (help.adobe.com)

Note: Although tag names in ColdFusion pages are not case sensitive, custom tag filenames must be lowercase on UNIX.

cfinvoke Documentation (help.adobe.com)

On UNIX systems, ColdFusion searches first for a file with a name that matches the specified component name, but is all lower case. If it does not find the file, it looks for a file name that matches the component name exactly, with the identical character casing.

Since <cfinvoke> is a standard tag, the tag itself is case-insensitive. However, it sounds like all component argument(s) to <cfinvoke> need to have a lower-case filenames in order for calls with irregular casing to succeed consistently. I know you said refactoring is difficult, but this is what I've come up with:

If you have a folder where you specifically keep components, it's trivial to run a shell script in that folder that renames them all to have lower-casing (remove -i if you don't want to be asked if you're sure each time):

for filename in *.cfc; do
  lowercase =`echo $filename | tr '[:upper:]' '[:lower:]'`
  mv -i $filename $lowercase
done

If you don't have the components all in the same folder, try it from the top directory.

Let me know if you were able to give this a shot!

like image 126
Misha Avatar answered Sep 22 '22 15:09

Misha