Younly
2016-10-21 10:46:39浏览 4176
PHP代码规范:
https://github.com/PizzaLiu/PHP-FIG
Symfony源码:
https://github.com/symfony/symfony
List of Commands
查看所有服务
php bin/console debug:container
查看所有路由
php bin/console debug:router
查看所有事件
php bin/console debug:event-dispatcher
触发指定事件
php bin/console debug:event-dispatcher {eventName}
生成 Bundle
php bin/console generate:bundle
生成 Controller
php bin/console generate:controller
新建数据库
php bin/console doctrine:database:create
生成数据表
php bin/console doctrine:schema:update --force
生成实体 getter && setter
php bin/console doctrine:generate:entities {bundleName}
生成实体 form type
php bin/console generate:doctrine:form {bundleName:entityName}
根据已存在的数据表生成实体
php bin/console doctrine:mapping:import --force {bundleName} {annotation|yml|xml}
装载测试数据
php bin/console doctrine:fixtures:load
创建静态资源的快捷方式到 web 目录
php bin/console assets:install web --symlink
导出 FOSJsRoutingBundle 下的路由到 web 目录
php bin/console fos:js-routing:dump
合并资原文件
php bin/console assetic:dump --env=prod
优化自动加载
composer dump-autoload --optimize
删除缓存:
rm -rf ./var/logs/*;
rm -rf ./var/cache/*;
rm -rf ./var/sessions/*;
rm -rf ./web/bundles;
rm -rf ./web/images;
rm -rf ./web/css;
rm -rf ./web/js;
php bin/console assets:install web;
chmod 0777 -R ./var/logs;
chmod 0777 -R ./var/cache;
chmod 0777 -R ./var/sessions;
composer require knplabs/knp-paginator-bundle
添加中国镜像(composer update)
composer config repo.packagist composer https://packagist.phpcomposer.com