Menu

#921 (ok 2.10.0) End of line in setup generated files

fixed
1
2013-06-11
2006-05-23
No

when i use phpmyadmin 2.8.1 on windows xp, and i run
the setup script, it creates the config file as it
should
when i open the created configuration file, it is all
on one line and almost impossible to edit
Suggestion:
store get_defined_constants() to a variable
then if that ["PHP_OS"] is WINNT store "\r\n" to a
string
if its MAC then store "\r" to the string
otherwise store "\n" to that string
at all places where "\n" is printed, print the string
instead

Discussion

  • Anonymous

    Anonymous - 2006-05-23
    • priority: 5 --> 3
     
  • Jürgen Wind

    Jürgen Wind - 2006-05-24

    Logged In: YES
    user_id=1383652

    >if its MAC then store "\r" to the string...
    is not a good idea, as PHP doesn't like that.
    but adding "\r\n" to a string can be helpful.

     
  • Jürgen Wind

    Jürgen Wind - 2006-05-24

    Logged In: YES
    user_id=1383652

    To avoid such problems, the best way is to use an editor on win
    that is capable of dealing with all three versions like:
    http://www.flos-freeware.ch/notepad2.html
    (small&fast, can replace notepad)

     
  • Anonymous

    Anonymous - 2006-05-25

    Logged In: YES
    user_id=1527566

    i, and a lot of ppl i know, dislike using alternatives to
    notepad, because they are untested, un virus free, etc
    the only windows packaged alternateive to notepad is
    wordpad which is extremely slow

     
  • Anonymous

    Anonymous - 2006-05-25

    Logged In: YES
    user_id=1527566

    what problems are there with using \r in php
    from the little fooling around i did, i could find no error
    i'm currently using php 5.1.4 on apache 2.2.2 and i'm
    curious as to which operating systems and servers and
    versions of php this error occurs in

     
  • Jürgen Wind

    Jürgen Wind - 2006-05-25

    Logged In: YES
    user_id=1383652

    i read it in the pma docs,
    here is someone who obviously had that problem:
    http://forum.textdrive.com/viewtopic.php?pid=83323
    >...my FTP client (Fetch) was set for Mac line breaks ...
    >...Having corrected the line break setting in my fpt
    client, I ... reloaded my site; voila, posts look complete

     
  • Jürgen Wind

    Jürgen Wind - 2006-05-25

    Logged In: YES
    user_id=1383652

    another example :
    http://de.php.net/echo
    a user comment:
    "If you want to use echo <<<ENDOFECHO (here document style)
    and you notice that the server does not seem to recognise
    this form (you get a blank page with no content at all),
    chances are your editor uses a wrong type of line break.... "

     
  • Michal Čihař

    Michal Čihař - 2006-11-02

    Logged In: YES
    user_id=192186

    Should this decision be based on server or user OS?

     
  • Michal Čihař

    Michal Čihař - 2006-11-02
    • assigned_to: nobody --> nijel
     
  • Michal Čihař

    Michal Čihař - 2006-11-02

    Logged In: YES
    user_id=192186

    I made it configurable (with detection based on user
    operating system).

     
  • Michal Čihař

    Michal Čihař - 2006-11-02
    • priority: 3 --> 1
    • summary: carriage returns on windows --> (ok 2.10.0) End of line in setup generated files
    • status: open --> open-fixed
     
  • Jürgen Wind

    Jürgen Wind - 2006-11-02

    Logged In: YES
    user_id=1383652

    nijel,
    don't forget the config.sample.php, a remember some WIN
    users also reported problems
    using the standard editor in the help forum!

     
  • Michal Čihař

    Michal Čihař - 2006-11-02

    Logged In: YES
    user_id=192186

    File included in tarball can be only in one format, so it
    can not satisfy all. Maybe we could add explaining comment
    to the top of this file?

     
  • Jürgen Wind

    Jürgen Wind - 2006-11-02

    Logged In: YES
    user_id=1383652

    i never heard of any *ix editor having problems with win
    format ;)
    so using \r\n should be ok for 99% of all users.

     
  • Michal Čihař

    Michal Čihař - 2006-11-02

    Logged In: YES
    user_id=192186

    Well in worst case you end up with ^M at the end of each
    line. ... Let's open this topic on list.

     
  • Marc Delisle

    Marc Delisle - 2007-02-28
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed