zoukankan      html  css  js  c++  java
  • symfony 常用命令

    (以下所有命令都是在 php-fpm 容器下运行)--docker

    初始化环境

    • 创建数据库,执行以下命令

      $php app/console doctrine:database:create
      
    • 然后升级数据库

    升级数据库

    • 首先更新代码
    • 然后执行以下命令

      $ php app/console doctrine:migrations:migrate
      

    开发命令

    修改实体

    • 首先修改实体,标好 Doctrine2 的 annotation
    • 然后执行以下命令,生成 getter 和 setter

      # 不支持 PSR4, 见 https://github.com/doctrine/DoctrineBundle/issues/282
      # 使用 PSR4 的需要另外生成或者手工写
      $ php app/console doctrine:generate:entities ENTITY/CLASS/FULL/NAME
      

    修改(升级)表结构

    • 然后 执行以下命令

      $ php app/console doctrine:migrations:diff
      $ php app/console doctrine:migrations:migrate
      

    加载 fixtures

    • 首先更新代码
    • 然后执行以下命令

      $ php app/console doctrine:fixtures:load
      

    跑单元测试

    跑全部

        $ ./bin/phpunit -c build/
    

    跑单个类

        $ ./bin/phpunit -c build/ src/AppBundle/Tests/Api/Client/PocApiCommunicatorTest.php
    

    跑单个方法

        $ ./bin/phpunit -c build/ src/AppBundle/Tests/Api/Client/PocApiCommunicatorTest.php --filter testUserAuthenticate
    

    语言包更新

        $ php app/console translation:update --force --output-format=xlf th
        $ php app/console translation:update --force --output-format=xlf zh_CN
    

    发布 assets

    存放在 app/Resources/public 目录下的 css 和 js 文件,需要发布才能使用。

    要发布 assets,执行以下命令:

        $ php app/console assetic:dump

    参考文章https://gitlab.ywqian.com:8081/hs/effective-happiness/wikis/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA-Symfony-%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4
  • 相关阅读:
    django创建表单以及表单数据类型和属性
    Django-debug-toolbar(调试使用)
    POJ 2828 Buy Tickets
    Bsoj 1322 第K小数
    bzoj3555 企鹅QQ
    洛谷P1141 01迷宫
    NOIP2008普及组题解
    NOIP2014 day2 T2 洛谷P2296 寻找道路
    POJ2892 Tunnel Warfare
    BZOJ 3224 TYVJ 1728 普通平衡树 [Treap树模板]
  • 原文地址:https://www.cnblogs.com/taho/p/7490827.html
Copyright © 2011-2022 走看看