Skip to content

Commit

Permalink
Prepare v0.7.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Feb 26, 2021
1 parent 734fb2d commit 56460c4
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: clue
custom: https://clue.engineering/support
90 changes: 89 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,93 @@
# Changelog

## 0.7.0 (2021-02-26)

* Feature / BC break: Add `BufferInfo` and `Message` to represent complex data types,
represent all map structures as `stdClass` objects instead of assoc arrays,
represent message timestamps as `DateTime` objects and
change `IrcUsersAndChannels` structure to its logic represenation.
(#41, #43, #44, #46, #47 and #49 by @clue)

Incoming buffers/channels and chat messages use complex data models,
so they are represented by `BufferInfo` and `Message` respectively.

All other data types use plain structured data, so you can access its structure very similar to a JSON-like data structure.
All map structures are now represented as `stdClass` object instead of assoc arrays.
This only applies to object maps and lists will continue to be represented as arrays.
This allows for a clear distinction between these concepts and allows you to
differentiate between empty objects and empty lists.
This is in line with how PHP's `json_decode()` function works by default.

This is a major BC break because this means these data structures can no longer be accessed like normal PHP arrays.
However, using the new `BufferInfo` and `Message` models makes accessing these somewhat easier.
See the updated examples for more details on practical effect, for example:

```php
// old
assert(is_array($message));
echo $message['sender'] . ': ' . $message['content'] . PHP_EOL;
assert(is_int($message['timestamp']));
echo 'Date: ' . date('Y-m-d', $message['timestamp']) . PHP_EOL;
assert(is_array($message['bufferInfo']));
echo 'Channel: ' . $message['bufferInfo']['name'] . PHP_EOL;

// new
assert($message instanceof Message);
echo $message->sender . ': ' . $message->contents . PHP_EOL;
assert($message->timestamp instanceof DateTime);
echo 'Date: ' . $message->timestamp->format('Y-m-d') . PHP_EOL;
assert($message->bufferInfo instanceof BufferInfo);
echo 'Channel: ' . $message->bufferInfo->name . PHP_EOL;
```

* Feature / BC break: Update `writeBufferRequestBacklog()` parameters and add new `writeBufferRequestBacklogAll()`.
(#42 by @clue)

```php
// old
$client->writeBufferRequestBacklog($bufferId, 100);

// new
$client->writeBufferRequestBacklog($bufferId, -1, -1, 100, 0);
$client->writeBufferRequestBacklogAll(-1, -1, 100, 0);
```

* Feature / BC Break: Automatically send heartbeat requests and replies (ping messages).
This can be controlled with the new `?ping=0` and `?pong=0` parameters.
(#38 and #39 by @clue)

* Feature: Support passing authentication as part of URL to Quassel core.
(#36 by @clue)

```php
$factory->createClient('quassel://user:h%40llo@localhost')->then(
function (Client $client) {
// client sucessfully connected and authenticated
$client->on('data', function ($data) {
// next message to follow would be "SessionInit"
});
}
);
```

* Feature: Ignore unsolicited `CoreInfo reports` (Quassel v0.13+).
(#45 by @clue)

* Feature: Support permanently removing networks and improve examples to support disconnected networks.
(#48 and #50 by @clue)

```php
// new
$client->writeNetworkRemove($networkId);
```

* Feature: Update QDataStream dependency to no longer depend on `ext-mbstring`.
(#35 by @clue)

* Improve test suite and add `.gitattributes` to exclude dev files from exports.
Prepare PHP 8 support, update to PHPUnit 9 and simplify test matrix.
(#33 by @carusogabriel, #34, #37 and #54 by @clue and #52 and #53 by @SimonFrings)

## 0.6.0 (2017-10-20)

* Feature / BC break: Upcast legacy Network sync model to newer datastream protocol variant
Expand All @@ -8,7 +96,7 @@

This means that both the old "legacy" protocol and the newer "datastream"
protocol now expose message data in the exact same format so that you no
longer have to worry about protocol inconsitencies.
longer have to worry about protocol inconsistencies.

> Note that this is not a BC break for most consumers, it merely updates
the "legacy" fallback protocol to behave just like the the "datastream"
Expand Down
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,30 @@ person has no idea about this and only sees a single contact.

**Table of contents**

* [Support us](#support-us)
* [Quickstart example](#quickstart-example)
* [Usage](#usage)
* [Factory](#factory)
* [createClient()](#createclient)
* [Client](#client)
* [Commands](#commands)
* [Processing](#processing)
* [on()](#on)
* [close()](#close)
* [Factory](#factory)
* [createClient()](#createclient)
* [Client](#client)
* [Commands](#commands)
* [Processing](#processing)
* [on()](#on)
* [close()](#close)
* [Install](#install)
* [Tests](#tests)
* [License](#license)

## Support us

We invest a lot of time developing, maintaining and updating our awesome
open-source projects. You can help us sustain this high-quality of our work by
[becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get
numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue)
for details.

Let's take these projects to the next level together! 🚀

## Quickstart example

The Quassel IRC protocol is not exactly trivial to explain and has some
Expand Down Expand Up @@ -244,7 +255,7 @@ The recommended way to install this library is [through Composer](https://getcom
This will install the latest supported version:

```bash
$ composer require clue/quassel-react:^0.6
$ composer require clue/quassel-react:^0.7
```

See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
Expand Down Expand Up @@ -298,7 +309,10 @@ $ QUASSEL_HOST=127.0.0.1 QUASSEL_USER=quassel QUASSEL_PASS=secret phpunit

## License

Released under the terms of the permissive MIT license.
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.

This library took some inspiration from other existing tools and libraries.
As such, a huge shoutout to the authors of the following repositories!
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"authors": [
{
"name": "Christian Lück",
"email": "christian@lueck.tv"
"email": "christian@clue.engineering"
}
],
"autoload": {
Expand Down

0 comments on commit 56460c4

Please sign in to comment.