Skip to content

Commit 15e6fbb

Browse files
committed
Update example to new eventloop and new S3 API
1 parent 7c7c7a4 commit 15e6fbb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ Once [installed](#install), you can use the following code to read a file from
1515
your S3 file storage:
1616

1717
```php
18-
$loop = React\EventLoop\Factory::create();
19-
$browser = new React\Http\Browser($loop);
18+
<?php
2019

21-
$s3 = new Clue\React\S3\Client($browser, $key, $secret, $bucket, $region, $endpoint);
20+
require __DIR__ . '/vendor/autoload.php';
21+
22+
$s3 = new Clue\React\S3\S3Client($key, $secret, $bucket, $region, $endpoint);
2223

2324
$s3->read('example.txt')->then(function (string $contents) {
2425
echo $contents;
26+
}, function (Exception $e) {
27+
echo 'Error: ' . $e->getMessage() . PHP_EOL;
2528
});
26-
27-
$loop->run();
2829
```
2930

3031
## Install

0 commit comments

Comments
 (0)