symfony框架常用使用命令

已有數據庫,生成實體類
php bin/console doctrine:mapping:import “App\Entity” annotation --path=src/Entity
生成xml
php bin/console doctrine:mapping:import “App\Entity” xml --path=config/doctrine
添加getter和setter
php bin/console make:entity --regenerate App

建庫
php bin/console doctrine:database:create
打印sql
bin/console doctrine:schema:update --dump-sql
強制執行update
bin/console doctrine:schema:update --force

清緩存
php bin/console cache:clear --env=test
php bin/console cache:clear

單元測試
(依賴codeception/codeception)
vendor\bin\codecept run unit
單元測試覆蓋率 --html --coverage-html
vendor/bin/codecept run unit --coverage --coverage-text
vendor/bin/codecept run api --coverage --coverage-text

command執行
php bin/console --show database:run action1

代碼檢查
(依賴phpstan/phpstan-doctrine)
vendor/bin/phpstan analyse --level=3 -c phpstan.neon src
vendor/bin/phpstan analyse --level=3 -c phpstan.neon src --memory-limit=1G

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章