Skip to content

Commit

Permalink
Prepare v1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Sep 19, 2019
1 parent fdbfb61 commit 2b50bca
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 11 deletions.
94 changes: 94 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,98 @@
# Changelog

## 1.0.0 (2019-09-19)

* First stable release, now following SemVer!

* Feature: Update all ReactPHP dependencies to latest versions and
significantly improve performance (see included benchmark examples).
(#51 and #56 by @clue)

* Feature / BC break: Replace `Factory` with simplified `Client` constructor.
(#49 by @clue)

```php
// old
$factory = new Clue\React\Docker\Factory($loop);
$client = $factory->createClient($url);

// new
$client = new Clue\React\Docker\Client($loop, $url);
```

* Feature / BC break: Change JSON stream to always report `data` events instead of `progress`,
follow strict stream semantics, support backpressure and improve error handling.
(#27 and #50 by @clue)

```php
// old: all JSON streams use custom "progress" event
$stream = $client->eventsStream();
$stream->on('progress', function ($data) {
var_dump($data);
});

// new: all streams use default "data" event
$stream = $client->eventsStream();
$stream->on('data', function ($data) {
var_dump($data);
});

// new: stream follows stream semantics and supports stream composition
$stream = $client->eventsStream();
$stream->pipe($logger);
```

* Feature / BC break: Add `containerArchive()` and `containerArchiveStream()` methods and
remove deprecated `containerCopy()` and `containerCopyStream()` and
remove deprecated HostConfig parameter from `containerStart()`.
(#42, #48 and #55 by @clue)

```php
// old
$client->containerCopy($container, array('Resource' => $path));

// new
$client->containerArchive($container, $path);
```

* Feature / BC break: Change `execCreate()` method to accept plain params instead of config object.
(#38 and #39 by @clue)

* Feature / BC break: Change `execStart()` method to resolve with buffered string contents.
(#35 and #40)

* Feature: Add `execStartDetached()` method to resolve without waiting for exec data.
(#38 by @clue)

* Feature: Add `execStartStream()` method to return stream of exec data.
(#37 and #40)

* Feature: Add `execInspect()` method.
(#34 by @clue)

* Feature: Add `containerLogs()` and `containerLogsStream()` methods.
(#53 and #54 by @clue)

* Feature: Add `containerStats()` and `containerStatsStream()` methods.
(#52 by @clue)

* Feature: Add `events()` and `eventsStream()` methods
(#32 by @clue)

* Feature: Add `containerRename()` method.
(#43 by @clue)

* Feature: Timeout `$t` is optional for `containerStop()` and `containerRestart()`.
(#28 by @clue)

* Fix: The `containerResize()` and `execResize()` to issue `POST` request to resize TTY.
(#29 and #30 by @clue)

* Improve test suite by adding PHPUnit to `require-dev`, support PHPUnit 7 - legacy PHPUnit 4
and test against legacy PHP 5.3 through PHP 7.3,
improve documentation and update project homepage.
(#31, #46 and #47 by @clue)

## 0.2.0 (2015-08-11)

* Feature: Add streaming API for existing endpoints (TAR and JSON streaming).
Expand All @@ -19,3 +112,4 @@
## 0.0.0 (2014-11-26)

* Initial concept
# Changelog
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,11 @@ See also the [pull example](examples/pull.php) and the [push example](examples/p
The recommended way to install this library is [through Composer](https://getcomposer.org).
[New to composer?](https://getcomposer.org/doc/00-intro.md)

```JSON
{
"require": {
"clue/docker-react": "~0.2.0"
}
}
This project follows [SemVer](https://semver.org/).
This will install the latest supported version:

```bash
$ composer require clue/docker-react:^1.0
```

This project aims to run on any platform and thus does not require any PHP
Expand All @@ -382,4 +381,7 @@ $ php vendor/bin/phpunit

## License

MIT
This project is released under the permissive [MIT license](LICENSE).

> Did you know that I offer custom development services and issuing invoices for
sponsorships of releases and for contributions? Contact me (@clue) for details.
12 changes: 8 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,11 @@ public function containerExportStream($container)
* If you want to monitor live stats events as they happen, you
* should consider using `imageStatsStream()` instead.
*
* Available as of Docker Engine API v1.19 (Docker v1.7), use `containerStatsStream()` on legacy versions
*
* @param string $container container ID
* @return PromiseInterface Promise<array> JSON stats
* @link https://docs.docker.com/engine/api/v1.40/#operation/ContainerStats
* @since 0.3.0 Available as of Docker Engine API v1.19 (Docker v1.7), use `containerStatsStream()` on legacy versions
* @see self::containerStatsStream()
*/
public function containerStats($container)
Expand All @@ -484,10 +485,11 @@ public function containerStats($container)
* - error: once if an error occurs, will close() stream then
* - close: once the stream ends (either finished or after "error")
*
* Available as of Docker Engine API v1.17 (Docker v1.5)
*
* @param string $container container ID
* @return ReadableStreamInterface JSON stats stream
* @link https://docs.docker.com/engine/api/v1.40/#operation/ContainerStats
* @since 0.3.0 Available as of Docker Engine API v1.17 (Docker v1.5)
* @see self::containerStats()
*/
public function containerStatsStream($container)
Expand Down Expand Up @@ -726,12 +728,13 @@ public function containerRemove($container, $v = false, $force = false)
* for this library. Several libraries are available, one that is known to
* work is clue/reactphp-tar (see links).
*
* Available as of Docker Engine API v1.20 (Docker v1.8)
*
* @param string $container container ID
* @param string $resource path to file or directory to archive
* @return PromiseInterface Promise<string> tar stream
* @link https://docs.docker.com/engine/api/v1.40/#operation/ContainerArchive
* @link https://github.com/clue/reactphp-tar
* @since 0.3.0 Available as of Docker Engine API v1.20 (Docker v1.8)
* @see self::containerArchiveStream()
*/
public function containerArchive($container, $path)
Expand Down Expand Up @@ -763,12 +766,13 @@ public function containerArchive($container, $path)
* The resulting stream is a well-behaving readable stream that will emit
* the normal stream events.
*
* Available as of Docker Engine API v1.20 (Docker v1.8)
*
* @param string $container container ID
* @param string $path path to file or directory to archive
* @return ReadableStreamInterface tar stream
* @link https://docs.docker.com/engine/api/v1.40/#operation/ContainerArchive
* @link https://github.com/clue/reactphp-tar
* @since 0.3.0 Available as of Docker Engine API v1.20 (Docker v1.8)
* @see self::containerArchive()
*/
public function containerArchiveStream($container, $path)
Expand Down

0 comments on commit 2b50bca

Please sign in to comment.