1

I'm so confused with a strange behaviour. Actually I have edited some php files remotely with my PhpDesigner8 (a php editor). Everything goes right, but when my teammates reopen the files that I have edited the source code have blank lines like below:

class AdminController extends Controller

{

    function __construct()

    {

        parent::__construct();



        if (!$this->session->can_admin())

        {

            show_error('Solo para administradores.');

        }

        $this->load->library('backend');

    }

}

Instead of

class AdminController extends Controller
{
    function __construct()
    {
        parent::__construct();
        if (!$this->session->can_admin())
        {
            show_error('Solo para administradores.');
        }
        $this->load->library('backend');
    }
}

Did you have experience these kinds of problems?

3

This is the standard line ending issue.

On Unix, line endings end with LF ("\n"), while Dos and Windows machines used a CRLF combination ("\r\n"). If your editor is changing the line endings as it writes files, the other system won't automatically adjust that.

On the opposite end, older versions of Windows Notepad doesn't recognize line endings from Unix systems, and places everything into one large line.

|improve this answer|||||
  • I got it! So, I think that I need to set the "end line caracter" in my phpEditor, right? – manix Oct 6 '12 at 16:13
  • Yep.. You was correct. I set the value File format from windows to UNIX and it works! Thank you! – manix Oct 6 '12 at 16:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.