Line ending troubles when working on OS X and other Unix platforms
| Project: | Database Scripts |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I am experiencing some issues when trying to dump and restore on systems other than those I normally use. The normal setup, where I develop on OS X and where my production servers are FreeBSD is working as smooth as Drupal staging can be. Recently I was deploying on a Linux distro and I was encountering some strange problems. I have cooked it down to relate to the PHP file() function with FILE_IGNORE_NEW_LINES in dbscripts_process_tables(). The problems is that the line endings are not ignored, and therefore no table names are read. Dump and restore are unable to find any tables to do operations on.
I understand this is not all DBscripts related but I was wondering if anybody have experienced these issues. There is a lot of topics about file() and FILE_IGNORE_NEW_LINES with the latest versions of PHP, but I can't find any consistency in the errors related to my problems.
Thanks.

#1
I believe I'm running into the same problem and it is a show stopper for me.
I can succesfully dump, restore and merge when using two local OS X servers but can't get any of the scripts to work when using a local OS X dev server and a shared host for production running Linux.
The sort of errors a dump for example will show are hundreds of "sh: line 3: .sql: command not found" output.
-----
Update:
ACTUALLY - it appears the linux server's shell was pointing php -> php4 so I will have to retest. Probably not your problem after all.
-----
Update 2:
I am somewhat successfully developing on OS X and deploying on linux via svn. Any remaining problems I am having aren't related to this. Sorry.
#2
I am using the 1and1 hosting server and I had the same exact issue. In my case, 1and1 came stock with PHP4, so when I used PHP5 I was able to get it all to work. For example, this code did not work "./dbscripts/merge.php" but "php5 dbscripts/merge.php" did work.
Another idea is to rtrim() all the results from the php file() command. That is a big pain in the butt but will solve your problem if you do not have php5 installed.