PHPackages                             netglue/laminas-symfony-console - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. netglue/laminas-symfony-console

Abandoned → [laminas/laminas-cli](/?search=laminas%2Flaminas-cli)ArchivedLibrary[CLI &amp; Console](/categories/cli)

netglue/laminas-symfony-console
===============================

Opinionated Laminas and Symfony console integration

0.0.3(5y ago)0176MITPHPPHP &gt;=7.3

Since Mar 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/netglue/laminas-symfony-console)[ Packagist](https://packagist.org/packages/netglue/laminas-symfony-console)[ RSS](/packages/netglue-laminas-symfony-console/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (7)Versions (6)Used By (0)

Laminas/Mezzio + Symfony Console Bootstrap
==========================================

[](#laminasmezzio--symfony-console-bootstrap)

[![PHPUnit Test Suite](https://github.com/netglue/laminas-symfony-console/workflows/PHPUnit%20Test%20Suite/badge.svg)](https://github.com/netglue/laminas-symfony-console/workflows/PHPUnit%20Test%20Suite/badge.svg)[![codecov](https://camo.githubusercontent.com/c5e52749a0946a9dd729501f7d3111a349c9399a7f40c9b9d57dfdd5809f8524/68747470733a2f2f636f6465636f762e696f2f67682f6e6574676c75652f6c616d696e61732d73796d666f6e792d636f6e736f6c652f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/netglue/laminas-symfony-console)

Project Abandoned
-----------------

[](#project-abandoned)

Laminas CLI has been released - please use that instead:

### Introduction

[](#introduction)

This very small component provides a couple of PSR-11 factories and opinionated configuration to get Symfony’s CLI tooling bootstrapped quickly in a Mezzio application *(It might also play nice with Laminas MVC but I don’t really use that anymore…)*.

At the time of writing, I was unaware of [laminas/laminas-cli](https://github.com/laminas/laminas-cli) which does all the things this lib does and more.

**Once laminas-cli is released, I will likely kill this lib off,** so you should probably just go and check out [the official Laminas component](https://github.com/laminas/laminas-cli), that said, it hasn't been released yet so if you want something to install now, this lib will also load commands listed under `config.laminas-cli.commands`, so you can list your commands there and then swap out this library with Laminas CLI when it's released.

Anyhow, this lib assumes that you'll probably be using a PSR-11 compatible container and that you will want to use that container to lazy load your console commands.

### Installation

[](#installation)

```
composer require netglue/laminas-symfony-console
```

During installation into a Mezzio app you should be asked to inject configuration in the same way as other laminas components thanks to the [Laminas component installer](https://docs.laminas.dev/laminas-component-installer/). If you choose not to do this, or want to set things up manually, then you should include `src/ConfigProvider.php` somewhere in your config.

### Handy binary…

[](#handy-binary)

A "binary" is shipped so that you can call `vendor/bin/cli my:command` once you're all setup. You can set the name of the application displayed on the console by setting a configuration value in `console.name`.

As environments and paths differ, this 'binary' will simply try to locate the root of project and then look for `config/container.php` in order to get hold of the container from this conventional location. There's a good chance this might not work in your setup, but making a binary like this is pretty trivial and would look similar to the following:

```
#!/usr/bin/env/php
