An open API service indexing awesome lists of open source software.

https://github.com/bauhausphp/cli


https://github.com/bauhausphp/cli

Last synced: 12 months ago
JSON representation

Awesome Lists containing this project

README

          

# Cli

```php
write("my entrypoing\n");
}
}

class MyCliMiddleware implements Middleware
{
public function execute(Input $input,Output $output, Handler $next): void
{
$output->write("my middleware\n");
$next->execute($input, $output);
}
}

$settings = CliSettings::default()
->withOutput('/var/tmp/file') // default is php://stdout
->withEntrypoints(
new MyCliEntrypoint(),
)
->withMiddlewares(
new MyCliMiddleware(),
);

$cliApplication = Cli::bootstrap($settings);

$cliApplication->run('./bin', 'command-id'); // it could be $cliApplication->run($_SERVER['argv']);
```