https://github.com/secondtruth/php-sapi
A SAPI Library written in PHP.
https://github.com/secondtruth/php-sapi
composer-package input io output php-library sapi
Last synced: 10 months ago
JSON representation
A SAPI Library written in PHP.
- Host: GitHub
- URL: https://github.com/secondtruth/php-sapi
- Owner: secondtruth
- License: mit
- Created: 2020-10-31T20:17:42.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-10T13:09:57.000Z (almost 5 years ago)
- Last Synced: 2025-03-19T20:48:00.772Z (10 months ago)
- Topics: composer-package, input, io, output, php-library, sapi
- Language: PHP
- Homepage: https://www.secondtruth.de
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# PHP SAPI Library
[](https://packagist.org/p/secondtruth/sapi)
[](https://travis-ci.com/github/secondtruth/php-sapi)
[](https://scrutinizer-ci.com/g/secondtruth/php-sapi)
[](https://scrutinizer-ci.com/g/secondtruth/php-sapi)
[](https://packagist.org/p/secondtruth/sapi)
A SAPI Library written in PHP.
## How to use?
```php
$argv = ['foo', 'bar', '--baz'];
$sapi = new CLI($argv);
$input = $sapi->getInput();
$input->getArgs(); // ['foo', 'bar', '--baz']
$input->getArgsCount(); // 3
$input->read();
$input->readLine();
$input->readAll();
$output = $sapi->getOutput();
$output->write('My message...');
```
## Installation
### Install via Composer
[Install Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos) if you don't already have it present on your system.
To install the library, run the following command and you will get the latest version:
$ composer require secondtruth/sapi
## Requirements
* You must have at least PHP version 7.4 installed on your system.