Compare commits

..

No commits in common. "master" and "2.x" have entirely different histories.
master ... 2.x

3 changed files with 8 additions and 12 deletions

View File

@ -18,6 +18,7 @@ before_script:
- php composer.phar install
# Run our tests
# If Xdebug was installed you can generate a coverage report and see code coverage metrics.
test:7.4:
only:
- 1.x
@ -34,11 +35,3 @@ test:8.0:
image: php:8.0
script:
- vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never
test:8.1:
only:
- 1.x
tags:
- default
image: php:8.1
script:
- vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never

View File

@ -2,12 +2,15 @@
This simply uses the FFI extension to enable _getch and _ungetch in Windows and linux.
[![pipeline status](https://repos.bgemi.net/sikofitt/getch/badges/1.x/pipeline.svg)](https://repos.bgemi.net/sikofitt/getch/-/commits/1.x)
[![coverage report](https://repos.bgemi.net/sikofitt/getch/badges/1.x/coverage.svg)](https://repos.bgemi.net/sikofitt/getch/-/commits/1.x)
```shell script
$ composer require olivebbs/getch
$ composer require sikofitt/getch:dev-master
```
```php
use Olive\Console\Getch;
use Sikofitt\Console\Getch;
$g = new Getch($linuxLibrary = null); // can also be a library that implements a function called _getch;
// by default uses the bundled Resources/libgetch.so
// on windows uses the built in _getch function.
@ -42,7 +45,7 @@ Note that if you want to put a word into the STDIN stack, you need to do it in r
There are also helper functions called getch() and ungetch();
```php
use function Olive\Console\getch;
use function Sikofitt\Console\getch;
$ord = getch($linuxLibrary = null);
print \chr($ord);

View File

@ -12,7 +12,7 @@ declare(strict_types=1);
* You can obtain one at https://mozilla.org/MPL/2.0/.
*/
use Olive\Console\Getch;
use Sikofitt\Console\Getch;
if (!function_exists('getch')) {
function getch(?string $linuxLibrary = null): int