Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
R. Eric Wheeler | 63d47141bb | |
R. Eric Wheeler | 7464fe666f | |
R. Eric Wheeler | a278fd6400 | |
R. Eric Wheeler | 24e53cd2cc | |
R. Eric Wheeler | 0f1cca15df | |
R. Eric Wheeler | fead8bbbbc | |
R. Eric Wheeler | 0a59dc5a79 | |
R. Eric Wheeler | 1a03ecde81 | |
R. Eric Wheeler | cc9ccc538b | |
R. Eric Wheeler | 16b4cff214 | |
R. Eric Wheeler | ac7e8c5069 |
|
@ -18,7 +18,6 @@ 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
|
||||
|
@ -35,3 +34,11 @@ 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
|
||||
|
|
|
@ -2,15 +2,12 @@
|
|||
|
||||
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 sikofitt/getch:dev-master
|
||||
$ composer require olivebbs/getch
|
||||
```
|
||||
|
||||
```php
|
||||
use Sikofitt\Console\Getch;
|
||||
use Olive\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.
|
||||
|
@ -45,7 +42,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 Sikofitt\Console\getch;
|
||||
use function Olive\Console\getch;
|
||||
$ord = getch($linuxLibrary = null);
|
||||
print \chr($ord);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ declare(strict_types=1);
|
|||
* You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
use Sikofitt\Console\Getch;
|
||||
use Olive\Console\Getch;
|
||||
|
||||
if (!function_exists('getch')) {
|
||||
function getch(?string $linuxLibrary = null): int
|
||||
|
|
Loading…
Reference in New Issue