Doctrine 1
  1. Doctrine 1
  2. DC-495

Allow the end of line style to be set in the record builder

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.2
    • Component/s: Record, Schema Files
    • Labels:
      None
    • Environment:
      All

      Description

      When building base models on multiple boxes with different operating systems, the use of PHP_EOL in the model builder is problematic since when you rebuild you basically change every line of every file, leading to huge commits that are impossible to review.

      I therefore added an eolStyle option to the Doctrine_Import_Builder class that allows you to specify which EOL markers to use.

      It works perfectly fine here and the patch is attached, if the option is not specified the code remains the same as before btw so no performance loss or any possible BC break.

      Thanks

        Activity

        Hide
        Jordi Boggiano added a comment - - edited

        The applied fix is NOT correct. My patch did it at the end of the file generation specifically because the file contains stuff generated by many other classes (or something).

        With the current state, and eolStyle set to \n, the result looks like this, which is completely wrong:

        {\n
        $this->setTableName('foo);\n
        $this->hasColumn('id', 'integer', 4, array(\r\n
        'type' => 'integer',\r\n

        Please revert and apply the original patch that was working perfectly fine..

        Show
        Jordi Boggiano added a comment - - edited The applied fix is NOT correct. My patch did it at the end of the file generation specifically because the file contains stuff generated by many other classes (or something). With the current state, and eolStyle set to \n, the result looks like this, which is completely wrong: {\n $this->setTableName('foo);\n $this->hasColumn('id', 'integer', 4, array(\r\n 'type' => 'integer',\r\n Please revert and apply the original patch that was working perfectly fine..

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Jordi Boggiano
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: