PHP code example of dwendrich / console-config-resolver

1. Go to this page and download the library: Download dwendrich/console-config-resolver 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/ */

    

dwendrich / console-config-resolver example snippets


return [
    'Example\Console' => [
        'name'     => 'My console application',
        'version'  => '1.0.0',
        'commands' => [
            // provide a class name or a service name configured in service manager
            MyConsoleCommand::class,
            
            // instances have to extend Symfony\Component\Console\Command\Command
            new OtherConsoleCommand(),
        ],
    ],
    
    // in zend framework applications this section is called 'service_manager'
    'dependencies' => [
        'factories' => [
            'Example\Console' => ConsoleConfigResolver\Factory\ConfigResolverFactory::class,
        ],
    ],
];

#!/usr/bin/env php


chdir(dirname(__FILE__));

call_user_func(function () {
    // get your service manager instance
    $container = / run the application
    $console->run();
});
sh
$ php console.php list