2017 © Pedro Peláez
 

library consoler

Extensions for symfony/console adding support for using any container-interop/container-interop compatible package.

image

vaibhavpandeyvpz/consoler

Extensions for symfony/console adding support for using any container-interop/container-interop compatible package.

  • Sunday, April 10, 2016
  • by vaibhavpandeyvpz
  • Repository
  • 1 Watchers
  • 2 Stars
  • 35 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

vaibhavpandeyvpz/consoler

Extensions for symfony/console adding support for using any container-interop/container-interop compatible package., (*1)

Install

composer require vaibhavpandeyvpz/consoler

You may also want to install vaibhavpandeyvpz/katora to provide Interop\Container\ContainerInterface. To do so, run following:, (*2)

composer require vaibhavpandeyvpz/katora

Usage

Initialize a instance of Consoler\Application with an Interop\Container\ContainerInterface instance and run as usual., (*3)

#!/usr/bin/env php
<?php

require_once __DIR__ . '/vendor/autoload.php';

$app = new Consoler\Application();

$app->setContainer($container = new Katora\Container());

$container[PDO::class] = $container->share(function () {
    return new PDO(/** args */);
});

$app->add(new SearchCommand());

$app->run();

Since Consoler\Command class implements Interop\Container\ContainerInterface, you can just extend it & use the container as below:, (*4)

use Consoler\Command;
use Symfony\Component\Console\Input\InputInterface as Input;
use Symfony\Component\Console\Output\OutputInterface as Output;

class SearchCommand extends Command
{
    protected function execute(Input $input, Output $output)
    {
        /** @var \PDO $pdo */
        $pdo = $this->get(\PDO::class);
        // ...more code!
    }
}

License

See LICENSE.md file., (*5)

The Versions

10/04 2016

dev-master

9999999-dev http://vaibhavpandeyvpz.github.io/consoler

Extensions for symfony/console adding support for using any container-interop/container-interop compatible package.

  Sources   Download

MIT

The Requires

 

extension container console symfony interop

10/04 2016

1.0.2

1.0.2.0 http://vaibhavpandeyvpz.github.io/consoler

Extensions for symfony/console adding support for using any container-interop/container-interop compatible package.

  Sources   Download

MIT

The Requires

 

extension container console symfony interop

10/04 2016

1.0.1

1.0.1.0 http://vaibhavpandeyvpz.github.io/consoler

Extensions for symfony/console adding support for using any container-interop/container-interop compatible package.

  Sources   Download

MIT

The Requires

 

extension container console symfony interop

03/04 2016

1.0.0

1.0.0.0 http://vaibhavpandeyvpz.github.io/consoler

Extensions for symfony/console adding support for using any container-interop/container-interop compatible package.

  Sources   Download

MIT

The Requires

 

extension container console symfony interop