PHP code example of luismulinari / consoleful

1. Go to this page and download the library: Download luismulinari/consoleful library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

luismulinari / consoleful example snippets



use Lcobucci\DependencyInjection\ContainerConfig;
use LuisMulinari\Consoleful\Application;

$autoloader = ices.xml') // services.[xml|yml|php]
);

$application->add(new ExampleCommand());

$application->run();



namespace Vendor\ExampleApp\Command;

use LuisMulinari\Consoleful\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class ExampleCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this->setName("example");
        $this->setDescription('Description example');
    }
    
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getContainer();
        
        $container->get('service.example');
        $container->getParameter('parameter.example');
    }
}