Skip to content

Commit 18b4851

Browse files
committed
Updated events docs !
1 parent 3b23b5b commit 18b4851

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ EventManager::getInstance()->unbindEventCallback('onCacheGetItem', 'myCallbackNa
252252
```
253253
:new: As of the **V8** you can simply subscribe to **every** events of Phpfastcache.
254254

255-
More information about the implementation and the events are available on the [Wiki](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%5D-Introducing-to-events)
255+
More information about the implementation and the events are available on the [Wiki](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%CB%96%5D-Introducing-to-events)
256256

257257
---------------------------
258258
Introducing new helpers
@@ -261,9 +261,7 @@ Introducing new helpers
261261

262262
- (:warning: Removed in v8, [why ?](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%CB%96%5D-Act-on-all-instances)) ~~The [ActOnAll Helper](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%CB%96%5D-Act-on-all-instances) to help you to act on multiple instance at once.~~
263263
- The [CacheConditional Helper](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%CB%96%5D-Cache-Conditional) to help you to make the basic conditional statement more easier.
264-
265-
#### Important note:
266-
- The [Psr16 adapter](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%CB%96%5D-Psr16-adapter) previously introduced in **V6** have been removed in **V8** in profit of aggregated cluster support.
264+
- The [Psr16 adapter](https://github.com/PHPSocialNetwork/phpfastcache/wiki/%5BV6%CB%96%5D-Psr16-adapter)
267265

268266
May more will come in the future, feel free to contribute !
269267

docs/EVENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,14 @@ EventManager::getInstance()->unbindEventCallback('onCacheGetItem', 'myCallbackNa
206206
- **Risky Circular Methods**
207207
- *ExtendedCacheItemInterface::expiresAt()*
208208

209+
:new: As of the **V8** you can simply subscribe to **every** events at once of Phpfastcache.
210+
```php
211+
<?php
212+
use Phpfastcache\EventManager;
213+
214+
EventManager::getInstance()->onEveryEvents(static function (string $eventName, ...$args) {
215+
echo sprintf("Triggered event '{$eventName}' with %d arguments provided", count($args));
216+
}, 'debugCallback');
217+
```
218+
209219
This is an exhaustive list and it will be updated as soon as new events will be added to the Core.

0 commit comments

Comments
 (0)