PHP code example of gridonic / console-service-provider

1. Go to this page and download the library: Download gridonic/console-service-provider 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/ */

    

gridonic / console-service-provider example snippets






use Gridonic\Provider\ConsoleServiceProvider;

$app->register(new ConsoleServiceProvider(), array(
    'console.name' => 'MyApplication',
    'console.version' => '1.0.0',
    'console.project_directory' => __DIR__.'/..'
));




$app = new Silex\Application();

// Your beautiful silex bootstrap

return $app;


#!/usr/bin/env php


set_time_limit(0);

$app = sole'];
$application->add(new MyCommand());
$application->run();




use My\Command\MyCommand;
use Gridonic\Console\ConsoleEvents;
use Gridonic\Console\ConsoleEvent;

$app['dispatcher']->addListener(ConsoleEvents::INIT, function(ConsoleEvent $event) {
    $app = $event->getApplication();
    $app->add(new MyCommand());
});