Skip to content

Commit

Permalink
Merge pull request #11 from SimonFrings/loop
Browse files Browse the repository at this point in the history
Update example to new eventloop and new S3 API
  • Loading branch information
clue authored Sep 3, 2021
2 parents 7c7c7a4 + 15e6fbb commit d9f6407
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ Once [installed](#install), you can use the following code to read a file from
your S3 file storage:

```php
$loop = React\EventLoop\Factory::create();
$browser = new React\Http\Browser($loop);
<?php

$s3 = new Clue\React\S3\Client($browser, $key, $secret, $bucket, $region, $endpoint);
require __DIR__ . '/vendor/autoload.php';

$s3 = new Clue\React\S3\S3Client($key, $secret, $bucket, $region, $endpoint);

$s3->read('example.txt')->then(function (string $contents) {
echo $contents;
}, function (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
});

$loop->run();
```

## Install
Expand Down

0 comments on commit d9f6407

Please sign in to comment.