如何为Doctrine生成的代码设置换行符分隔符?

I am working on a Symfony 2 project which uses Doctrine. Development is mainly happening on Windows which is why all files have as newline separator.

However, when adding new properties to my entity classes and then running app/console doctrine:generate:entities Doctrine will add the generated code with newline separators. This results in files with inconsistent newline separators. The next time I open them my editor/IDE will replace all the with and show all those lines as changed even though the only change was the newline separator.

How can I tell Doctrine that it should respect the newline separators which are already present in the file when generating code?

展开翻译

译文

我正在使用一个使用Doctrine的Symfony 2项目。 开发主要发生在Windows上,这就是为什么所有文件都有
作为换行分隔符的原因。</ p>

但是,在我的实体类中添加新属性然后运行 app / console doctrine:generate:entities </ code> Doctrine将使用
换行分隔符添加生成的代码。 这会导致新行分隔符不一致的文件。 下次打开它们时,我的编辑器/ IDE将用
替换所有
,并将所有这些行显示为已更改,即使唯一的更改是换行符分隔符。</ p>

如何 我可以告诉Doctrine它应该尊重生成代码时文件中已经存在的换行分隔符吗?</ p>
</ div>

1个回答

Why you don't wont to use unix style newlines? Every IDE can hadle that for you. And there is no problem for windows php implementation to handle unix style newlines.

展开翻译

译文



为什么你不习惯使用unix样式的换行符? 每个IDE都可以为您提供帮助。 Windows php实现处理unix样式换行没有问题。</ p>
</ div>

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!