I've moved all my web projects over to my new Mac OS X machine. I have hand-hacked a few of the smaller ones to make sure they work under my Apache/PHP combo. They do!
However, the show-stopper is that most of my BBedit files have MAC newline characters... this displays without problem with TextEdit and BBedit. Even when I edit the files in Pico, the newlines are treated as newlines. The whole system handles mac newlines nicely.
Except, however, the PHP interpreter can't seem to handle them, and always kicks up an error on "line 3" (actually really something like 103, because the mac newlines aren't counted as real lines).
A long time ago, I saw a *very short* PERL script that could recursively traverse a directory tree, and swap characters as needed. I have it in mind to swap all ^M characters for \n, for all files and directories in Library/WebServer/Documents/*.php*.
This would be so much easier than manually changing newlines in BBedit every time a script throws up an error. Some of my projects have zillions of files.
Anybody have this magic script? This *has* to have come up already.
However, the show-stopper is that most of my BBedit files have MAC newline characters... this displays without problem with TextEdit and BBedit. Even when I edit the files in Pico, the newlines are treated as newlines. The whole system handles mac newlines nicely.
Except, however, the PHP interpreter can't seem to handle them, and always kicks up an error on "line 3" (actually really something like 103, because the mac newlines aren't counted as real lines).
A long time ago, I saw a *very short* PERL script that could recursively traverse a directory tree, and swap characters as needed. I have it in mind to swap all ^M characters for \n, for all files and directories in Library/WebServer/Documents/*.php*.
This would be so much easier than manually changing newlines in BBedit every time a script throws up an error. Some of my projects have zillions of files.
Anybody have this magic script? This *has* to have come up already.