symfony - Symfony 3.4 CLI:命令“doctrine:generate:entity”未定义
问题描述
我正在使用 Symfony 3.4,两周前我在这个项目中多次使用了学说:生成:实体,今天我遇到了一个问题,我不知道是什么原因!
$ php bin/console doctrine:generate:entity AppBundle:Payement
Command "doctrine:generate:entity" is not defined.
Did you mean one of these?
doctrine:cache:clear-entity-region
doctrine:generate:entities
命令教义:生成:实体,形式和杂物从 CLI 中消失:
$ bin/console | grep "doctrine"
doctrine
doctrine:cache:clear-collection-region Clear a second-level cache collection region.
doctrine:cache:clear-entity-region Clear a second-level cache entity region.
doctrine:cache:clear-metadata Clears all metadata cache for an entity manager
doctrine:cache:clear-query Clears all query cache for an entity manager
doctrine:cache:clear-query-region Clear a second-level cache query region.
doctrine:cache:clear-result Clears result cache for an entity manager
doctrine:cache:contains Check if a cache entry exists
doctrine:cache:delete Delete a cache entry
doctrine:cache:flush [doctrine:cache:clear] Flush a given cache
doctrine:cache:stats Get stats on a given cache provider
doctrine:database:create Creates the configured database
doctrine:database:drop Drops the configured database
doctrine:database:import Import SQL file(s) directly to Database.
doctrine:ensure-production-settings Verify that Doctrine is properly configured for a production environment.
doctrine:generate:entities [generate:doctrine:entities] Generates entity classes and method stubs from your mapping information
doctrine:mapping:convert [orm:convert:mapping] Convert mapping information between supported formats.
doctrine:mapping:import Imports mapping information from an existing database
doctrine:mapping:info
doctrine:query:dql Executes arbitrary DQL directly from the command line.
doctrine:query:sql Executes arbitrary SQL directly from the command line.
doctrine:schema:create Executes (or dumps) the SQL needed to generate the database schema
doctrine:schema:drop Executes (or dumps) the SQL needed to drop the current database schema
doctrine:schema:update Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata.
doctrine:schema:validate Validate the mapping files.
解决方案
您必须验证 SensioGeneratorBundle 的安装,在我的 AppKernel 中,我忘记了这行注释,我只是取消注释它:
if ('dev' === $this->getEnvironment()) {
//$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
}
推荐阅读
- r - 计算当两水平因子交替时重新开始的差异
- reactjs - Dotenv-webpack 在生产中?
- java - 如何在 Jdialog 中正确关闭我的 jasperReport?
- php - 为什么 wp_mail() 在本地主机上不起作用?
- google-cloud-platform - 磁盘映像的 GCP API 格式不正确
- python - 选项列表的 Clio API v4 自定义字段值
- c++ - 使用 clion 设置 eigen 时遇到问题
- javascript - 如何使用'for循环'更改一些标签的'src'值?
- c# - 窗口最大化时ListBox控件不调整大小
- python - 使用 area 参数时的 pygame surface.blits