Compare commits

..

11 Commits
2.x ... master

Author SHA1 Message Date
R. Eric Wheeler 63d47141bb Merge pull request 'Fix name in composer' (#5) from 2.x into master
Reviewed-on: https://repos.bgemi.net/eric/getch/pulls/5
2024-07-18 13:20:05 -07:00
R. Eric Wheeler 7464fe666f Add composer.lock 2024-07-18 13:18:21 -07:00
R. Eric Wheeler a278fd6400 Merge 2.x into master 2024-07-18 13:18:01 -07:00
R. Eric Wheeler 24e53cd2cc Update master 2024-07-18 13:13:34 -07:00
R. Eric Wheeler 0f1cca15df Merge branch '2.x' 2024-07-18 13:10:10 -07:00
R. Eric Wheeler fead8bbbbc Merge branch '1.x' into 'master'
Merge 1.x into master

See merge request olive/PHP/getch!2
2022-05-17 18:15:14 +00:00
R. Eric Wheeler 0a59dc5a79 Merge 1.x into master 2022-05-17 18:15:13 +00:00
R. Eric Wheeler 1a03ecde81 Merge branch '1.x' into 'master'
Merge 1.x into master

See merge request olive/PHP/getch!1
2022-05-17 17:29:22 +00:00
R. Eric Wheeler cc9ccc538b Merge 1.x into master 2022-05-17 17:29:20 +00:00
R. Eric Wheeler 16b4cff214 Merge branch '1.x' into 'master'
1.x

See merge request sikofitt/getch!1
2021-03-01 19:10:52 +00:00
R. Eric Wheeler ac7e8c5069 1.x 2021-03-01 19:10:51 +00:00
3 changed files with 12 additions and 8 deletions

View File

@ -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

View File

@ -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);

View File

@ -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