1. Go to this page and download the library: Download php-io-extensions/kqueue library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php-io-extensions / kqueue example snippets
function kqueue(): int;
function kevent(int $kq, array $changelist, int $nchanges, ?array &$eventlist, int $nevents, ?timespec $timeout): int;
function kevent64(int $kq, array $changelist, int $nchanges, ?array &$eventlist, int $nevents, int $flags, ?timespec $timeout): int;
function EV_SET(kevent $kevp, mixed $ident, int $filter, int $flags, int $fflags, int $data, int $udata): void;
function EV_SET64(kevent64_s $kevp, mixed $ident, int $filter, int $flags, int $fflags, int $data, int $udata, int $ext0, int $ext1): void;
function kqueue_errno(): int;
final class kevent { int $ident, $filter, $flags, $fflags, $data, $udata; }
final class kevent64_s { int $ident, $filter, $flags, $fflags, $data, $udata; array $ext = [0, 0]; }
final class timespec { int $tv_sec, $tv_nsec; }
$kq = kqueue();
$timer = new kevent();
EV_SET($timer, 1, EVFILT_TIMER, EV_ADD | EV_ONESHOT, 0, 250, 0);
$wait = new timespec();
$wait->tv_sec = 1;
$n = kevent($kq, [$timer], 1, $events, 8, $wait); // 1, $events[0] is a kevent
sh
composer install
php -d extension=/path/to/kqueue.so vendor/bin/pest # or plain php once installed
sh
php "$(php-config --prefix)/lib/php/build/gen_stub.php" kqueue.stub.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.