Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1280

Generated proxy classes have mixed line endings on Windows

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      WinXP SP3, PHP 5.3.6

      Description

      When Doctrine\ORM\Proxy\ProxyFactory generates proxy classes on Windows, it mixes LF an CR/LF line endings. This is causing VCS issues in our mixed Windows/Linux dev team (we keep the proxies under version control for deployment purposes).

      This seems to be a regression. It did not happen with Doctrine 2.0.x.

      It is caused by the template string in the static property $_proxyClassTemplate using LF, while the string concatenations in the methods use the PHP_EOL constant, which resolves to CR/LF on Windows.

      Other code generators like Doctrine\ORM\Tools\EntityGenerator use "\n" instead of PHP_EOL.

      I propose to always use "\n" in favour of PHP_EOL. It's easier to implement in this case and every editor/IDE on Windows can handle Unix line endings nowadays.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Stan Imbt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: