Migrating a legacy PHP Project from Windows to Linux (inconsistent case disaster)
i have a Problem with a low-quality PHP Project (i didnt write it :)) and a migration towards a linux file system, that is, in contrast to windows' case sensitive. The includes and image-names are somewhat inconsistent to the real filenames that i need a kind of automatic solution.
So i thought about a script, that parses the project directory recursively for for php, js, jpg and gif files and replaces all occurrencies of the wrong case filename with the real filename in the project's php files.
the algorithm would be like:
foreach (php,js,jpg,png,gif..) as $found in dir: find all php in dir : replace ignoreCase($found) with $found
i tried to write this with perl and File::Find, but im currently stuck :/