rquadling/abstract-console

There is no license information available for the latest version (v2.0.0) of this package.

Abstract Application and Command with Input and Output helpers used by RQuadling's projects

v2.0.0 2020-06-29 18:42 UTC

This package is auto-updated.

Last update: 2024-12-06 18:34:32 UTC


README

Build Status Code Coverage GitHub issues

PHP Version Stable Version

Total Downloads Monthly Downloads Daily Downloads

Abstract Application and Command with Input and Output helpers used by RQuadling's projects

Installation

Using Composer:

composer require rquadling/abstract-console

Dependency Injection

Add the following entries to your di.php

    // Symfony Console Input wrapper to allow potential operation via a web based controller
    \Symfony\Component\Console\Input\InputInterface::class => function () {
        return new \RQuadling\Console\Input\Input(array_get($_SERVER, 'argv', []));
    },
    // Symfony Console Output wrapper to allow potential operation via a web based controller
    \Symfony\Component\Console\Output\OutputInterface::class => function (\Psr\Container\ContainerInterface $c) {
        return PHP_SAPI == 'cli'
            ? $c->get(\Symfony\Component\Console\Output\ConsoleOutput::class)
            : $c->get(\Symfony\Component\Console\Output\BufferedOutput::class);
    },

Environment variables

  1. COMMAND_DIRECTORY - Define the location of the Commands.
  2. COMMAND_NAMESPACE - Define the namespace for the Commands.