定制 mlo/console-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mlo/console-bundle

最新稳定版本:v2.0.0

Composer 安装命令:

composer require mlo/console-bundle

包简介

Symfony Bundle for interacting with the Symfony container through the command line

README 文档

README

Interact with Symfony's container through the command line. Uses Psysh for the console.

Installation

composer require --dev mlo/console-bundle

If you aren't using Symfony Flex, you will need to register the bundle in AppKernel.php in the dev and/or test environment.

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    $bundles[] = new Mlo\ConsoleBundle\MloConsoleBundle();
}

If you are using Symfony 4 or lower, require the v1 version of this package.

composer require --dev mlo/console-bundle:^1.0

Usage

bin/console tinker

This will drop you in a Psysh shell with the variables $container, $kernel and $this, which references the container.

Adding Variables

You can add custom variables to the shell scope with the following config:

mlo_console:
    variables:
        debug: "%kernel.debug%"
        em: "@doctrine.orm.entity_manager"

Now you will have a $debug variable with the value of the kernel.debug parameter and $em with your entity manager.

统计信息

  • 总下载量: 23.16k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-07