X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fseekat;a=blobdiff_plain;f=README.md;h=ca82ab313e3378e675d4fd5ae777f8cc9cc8e6ad;hp=9dccecd00eacdd20a1f9616f45f3d055c52dc885;hb=HEAD;hpb=21ffa2d775c959694776ee3f46f4e2d010a91e72 diff --git a/README.md b/README.md index 9dccecd..ffee664 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,14 @@ [![Build Status](https://travis-ci.org/m6w6/seekat.svg)](https://travis-ci.org/m6w6/seekat) -Fluent Github API access with PHP-7 and [ext-http](https://github.com/m6w6/ext-http). +Fluent Github API access with [ext-http](https://github.com/m6w6/ext-http). + +Support for the following promise providers built in: + * [ReactPHP](https://github.com/reactphp/promise) + * [AmPHP](https://github.com/amphp/amp) + +Supports plugging into your favourite event loop through +[http\Client's custom event loop interface](https://mdref.m6w6.name/http/Client/Curl/User). Simple example: @@ -11,7 +18,7 @@ Simple example: use seekat\API; -$api = new API; +$api = new API(API\Future\react()); $api->repos->m6w6->seekat->readme->as("html")->then(function($readme) { echo $readme; @@ -30,6 +37,7 @@ Full example: require_once __DIR__."/../vendor/autoload.php"; use seekat\API; +use function seekat\API\Links\next; $cli = new http\Client("curl", "seekat"); $cli->configure([ @@ -38,9 +46,9 @@ $cli->configure([ ]); $log = new Monolog\Logger("seekat"); -$log->pushHandler((new Monolog\Handler\StreamHandler(STDERR))->setLevel(Monolog\Logger::WARNING)); +$log->pushHandler(new Monolog\Handler\StreamHandler(STDERR, Monolog\Logger::WARNING)); -$api = new API([ +$api = new API(API\Future\react(), [ "Authorization" => "token ".getenv("GITHUB_TOKEN") ], null, $cli, $log); @@ -50,7 +58,7 @@ $api(function($api) { "affiliation" => "owner" ]); while ($repos) { - $next = $repos->next(); + $next = next($repos); $batch = []; foreach ($repos as $repo) { @@ -76,9 +84,6 @@ $api(function($api) { ``` -> ***Note:*** WIP - - ## Installing ### Composer