PHP code example of saxulum / saxulum-console

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

    

saxulum / saxulum-console example snippets

 {.php}
$container->register(new ConsoleProvider());
 {.php}
$container['console.commands'] = $container->extend('console.commands', function ($commands) use ($container) {
    $command = new SampleCommand;
    $command->setContainer($container);
    $commands[] = $command;

    return $commands;
});
 {.php}
$container['console.command.paths'] = $container->extend('console.command.paths', function ($paths) {
    $paths[] = __DIR__ . '/../../Command';

    return $paths;
});
 {.php}
$container['console']->run();