Compare commits
No commits in common. "master" and "2.x" have entirely different histories.
|
@ -18,6 +18,7 @@ before_script:
|
||||||
- php composer.phar install
|
- php composer.phar install
|
||||||
|
|
||||||
# Run our tests
|
# Run our tests
|
||||||
|
# If Xdebug was installed you can generate a coverage report and see code coverage metrics.
|
||||||
test:7.4:
|
test:7.4:
|
||||||
only:
|
only:
|
||||||
- 1.x
|
- 1.x
|
||||||
|
@ -34,11 +35,3 @@ test:8.0:
|
||||||
image: php:8.0
|
image: php:8.0
|
||||||
script:
|
script:
|
||||||
- vendor/bin/phpunit --configuration phpunit.xml --coverage-text --colors=never
|
- 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
|
|
||||||
|
|
|
@ -2,12 +2,15 @@
|
||||||
|
|
||||||
This simply uses the FFI extension to enable _getch and _ungetch in Windows and linux.
|
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
|
```shell script
|
||||||
$ composer require olivebbs/getch
|
$ composer require sikofitt/getch:dev-master
|
||||||
```
|
```
|
||||||
|
|
||||||
```php
|
```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;
|
$g = new Getch($linuxLibrary = null); // can also be a library that implements a function called _getch;
|
||||||
// by default uses the bundled Resources/libgetch.so
|
// by default uses the bundled Resources/libgetch.so
|
||||||
// on windows uses the built in _getch function.
|
// 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();
|
There are also helper functions called getch() and ungetch();
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use function Olive\Console\getch;
|
use function Sikofitt\Console\getch;
|
||||||
$ord = getch($linuxLibrary = null);
|
$ord = getch($linuxLibrary = null);
|
||||||
print \chr($ord);
|
print \chr($ord);
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ declare(strict_types=1);
|
||||||
* You can obtain one at https://mozilla.org/MPL/2.0/.
|
* You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Olive\Console\Getch;
|
use Sikofitt\Console\Getch;
|
||||||
|
|
||||||
if (!function_exists('getch')) {
|
if (!function_exists('getch')) {
|
||||||
function getch(?string $linuxLibrary = null): int
|
function getch(?string $linuxLibrary = null): int
|
||||||
|
|
Loading…
Reference in New Issue