zoukankan      html  css  js  c++  java
  • Symfony框架系列----常用命令

    一、常用命令 

    从Entity操作数据库:

    app/console doctrine:database:create # 创建数据库
    app/console doctrine:schema:update --force # 根据entity生成数据库
    app/console doctrine:database:drop --force # 删除数据库
    app/console doctrine:fixtures:load # 根据fixture 文件插入数据
    app/console doctrine:schema:update –dump-sql #生成需要同步数据库结构的sql
    Entity文件操作:
    app/console doctrine:generate:entity --entity=JyCommonStoreBundle:Article #创建Aritle初始化的Entity
    app/console doctrine:generate:entities --no-backup JyAdminStoreBundle # 生成JyAdminBundle下所有Entity的get、set方法
    app/console doctrine:generate:entities --no-backup JyAdminStoreBundle:Article # 生成JyAdminBundle下Article表的get、set方法

    从数据库操作Entity:

    app/console doctrine:mapping:import --em="default" JyLogMobileStoreBundle annotation  #根据数据库结构生成LogMobileStoreBundle下所有的Entity
    app/console doctrine:mapping:import --em="default" JyCommonStoreBundle --filter=Article annotation #根据数据库结构生成Article的Entity

    静态图片和文件相关:

    app/console assets:install --symlink # 在web/bundles下面建立静态文件的软连接(去掉--symlink为直接复制文件到web/bundles )
    app/console assetic:dump #转储静态文件到web
                                                               
    app/console cache:clear # 清除缓存 默认为开发环境
    app/console cache:clear --env=prod # 清除生产环境缓存
    app/console cache:clear --env=dev # 清除开发环境缓存

    路由相关:

    app/console router:debug    # 查看所有被配置的路由(Url地址)
    app/console router:match /hello/a # 查看给定的“/hello/a”匹配到的路由

    SonataAdminBundle:

    app/console sonata:admin:generate -b JyCoreBundle -a Browser #生成Admin文件
    注:

    该命令回车后会提示让输入Model文件路径,即为Entity路径,如:JyCoreBundleEntityBrowser

    Controller相关:

    app/console generate:doctrine:crud JyCoreBundle:Browser # 生成增删改查Controller文件:

    调试:

    用print_r或者var_dump打印会崩溃,我们使用以下方式:

    use DoctrineCommonUtilDebug;
                                 
    Debug::dump($object);

    其他:

    php app/console router:dump-apache -e=prod --no-debug
    php app/console list --no-debug
    php app/console -s --process-isolation
     
  • 相关阅读:
    远程登陆服务——SSH
    A web-based 3D modeling framework for a runner-gate design( 一种基于web的三维建模框架)
    Vue+Element+Echarts+Springboot+微信小程序开发(肿瘤医学项目)
    基于拖放布局的 Twitter Bootstrap 网站生成器
    Ubuntu下git使用华为云/gitee/github
    在 Ubuntu 18.04 上安装 Postman
    在Ubuntu 18.04上安装Git与入门教程
    转载:渲染层和逻辑层
    Ubuntu系统中安装Neo4j
    NosqlBooster连接数据库失败connect ECONNREFUSED 127.0.0.1:27017——mongodb连接失败
  • 原文地址:https://www.cnblogs.com/boystar/p/6008471.html
Copyright © 2011-2022 走看看