为何Doctrine 2创建〜Entity.php文件? [英] Why does Doctrine 2 create ~Entity.php file?

查看:120
本文介绍了为何Doctrine 2创建〜Entity.php文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我生成我的实体时,我有一个前缀为的文件,就像备份文件或某些东西

When I generate my entities I have a file prefixed with ~ like a backup file or something

是这是一个错误,还是需要手动删除?

Is it a bug or you need to manually remove them?

推荐答案

从Symfony2 CLI命令中的官方文档:

From the official documentation in Symfony2 CLI command:

$> php app / console help doctrine:generate:entities


....

....

默认情况下,备份每个实体的未修改版本,并保存
(例如Product.php〜)。要防止此任务创建
备份文件,请传递--no-backup选项:

By default, the unmodified version of each entity is backed up and saved (e.g. Product.php~). To prevent this task from creating the backup file, pass the --no-backup option:

 php app/console doctrine:generate:entities Blog/Entity --no-backup


总而言之,您可以在命令中添加 - no-backup 选项。

So to summarize, you may add --no-backup option to your command.

这篇关于为何Doctrine 2创建〜Entity.php文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆