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

https://github.com/utopia-php/console

Lightweight & fast PHP console framework.
https://github.com/utopia-php/console

Last synced: 21 days ago
JSON representation

Lightweight & fast PHP console framework.

Awesome Lists containing this project

README

          

# Utopia Console

Small collection of helpers for working with PHP command line applications. The Console class focuses on everyday needs such as logging, prompting users for input, executing external commands, and building long-running daemons.

## Installation

Install using Composer:

```bash
composer require utopia-php/console
```

## Usage

```php
&1 echo "success"', $input, $output, 3);

echo $exitCode; // 0
echo $output; // "success\n"
```

### Create a Daemon

Use `Console::loop()` to build daemons without tight loops. The helper sleeps between iterations and periodically triggers garbage collection.

```php