Compare commits

...

13 Commits
2.x ... 1.x

Author SHA1 Message Date
R. Eric Wheeler 44b3d2ce4a Bump min php version to 8.0 2023-02-09 20:49:51 -08:00
R. Eric Wheeler 14fa05424a Merge branch 'master' into '1.x'
# Conflicts:
#   composer.lock
2022-05-17 18:11:44 +00:00
R. Eric Wheeler 347a1b9456 Fix .gitlab-ci.yml file 2022-05-17 18:03:20 +00:00
R. Eric Wheeler 08e20d2e7a Add test for PHP v8.1 2022-05-17 11:02:08 -07:00
R. Eric Wheeler 76d81d5d0b Update composer.json 2022-05-17 10:45:07 -07: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 8eb9cd5167 Merge branch 'master' into '1.x'
# Conflicts:
#   README.md
#   composer.lock
#   src/Console/Getch.php
2022-05-17 17:21:25 +00:00
R. Eric Wheeler 1b01ff78f2 Fix readme 2022-05-17 10:04:07 -07:00
R. Eric Wheeler 5b92106e46 Update readme 2022-05-17 09:53:07 -07:00
R. Eric Wheeler d12cd38456 Move to new namespace 2022-05-17 09:47:34 -07: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
8 changed files with 428 additions and 971 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,16 @@
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)
[![Pipeline status](https://code.bgemi.net/olive/PHP/getch/badges/1.x/pipeline.svg)](https://code.bgemi.net/olive/PHP/getch/-/commits/1.x)
[![Coverage report](https://code.bgemi.net/olive/PHP/getch/badges/1.x/coverage.svg)](https://code.bgemi.net/olive/PHP/getch/-/commits/1.x)
[![Latest Release](https://code.bgemi.net/olive/PHP/getch/-/badges/release.svg)](https://code.bgemi.net/olive/PHP/getch/-/releases)
```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 +46,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

@ -1,19 +1,19 @@
{
"name": "sikofitt/getch",
"name": "olivebbs/getch",
"description": "Implements _getch and _ungetch for windows and linux using ffi",
"type": "library",
"keywords": ["getch", "windows", "conio", "linux", "console", "conio.h", "hotkey", "termios"],
"require": {
"php": ">=7.4",
"php": ">=8.0",
"ext-ffi": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.18",
"jetbrains/phpstorm-stubs": "dev-master",
"friendsofphp/php-cs-fixer": "^3.14",
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
"Sikofitt\\Console\\": "src/Console/"
"Olive\\Console\\": "src/Console/"
},
"files": [
"functions.php"
@ -21,7 +21,7 @@
},
"autoload-dev": {
"psr-4": {
"Sikofitt\\Tests\\Console\\": "tests/"
"Olive\\Tests\\Console\\": "tests/"
}
},
"license": "MPL-2.0",
@ -30,5 +30,8 @@
"name": "R. Eric Wheeler",
"email": "sikofitt@gmail.com"
}
]
],
"conflict": {
"sikofitt/getch": "*"
}
}

1350
composer.lock generated

File diff suppressed because it is too large Load Diff

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

View File

@ -12,7 +12,7 @@ declare(strict_types=1);
* You can obtain one at https://mozilla.org/MPL/2.0/.
*/
namespace Sikofitt\Console;
namespace Olive\Console;
use FFI;
use RuntimeException;

View File

@ -1,9 +1,9 @@
<?php
namespace Sikofitt\Tests\Console\Getch;
namespace Olive\Tests\Console\Getch;
use PHPUnit\Framework\TestCase;
use Sikofitt\Console\Getch;
use Olive\Console\Getch;
class GetchTest extends TestCase
{

View File

@ -1,9 +1,9 @@
<?php
namespace Sikofitt\Tests\Console\Ungetch;
namespace Olive\Tests\Console\Ungetch;
use PHPUnit\Framework\TestCase;
use Sikofitt\Console\Getch;
use Olive\Console\Getch;
class UngetchTest extends TestCase
{