pbergman / ntfy-bundle
There is no license information available for the latest version (1.0.2) of this package.
Symfony bundle for ntfy support
1.0.2
2023-10-20 09:11 UTC
Requires
- php: ^7.4||^8.0
- pbergman/ntfy-php: ^1
- symfony/cache-contracts: ^1.1||^2.4||^3.0
- symfony/config: ^4.4||^5.0||^6.0
- symfony/console: ^4.4||^5.0||^6.0
- symfony/dependency-injection: ^4.4||^5.0||^6.0
- symfony/event-dispatcher: ^4.4||^5.0||^6.0
- symfony/http-client-contracts: ^1.1||^2.4||^3.0
- symfony/http-kernel: ^4.4||^5.0||^6.0
- symfony/polyfill-php80: ^1.22
- symfony/psr-http-message-bridge: ^1.2||^2.0
- symfony/serializer: ^4.4||^5.0||^6.0
This package is auto-updated.
Last update: 2024-11-20 11:40:49 UTC
README
A symfony bundle that makes it easy to manage multiple nfty servers and topics.
When creating services from the config and autowire is enabled there will parameter binds registered for the server and every topic which can be used arguments.
So for example we have the following config:
framework: http_client: scoped_clients: example.client: base_uri: 'https://ntfy.sh' auth_bearer: 'XXXXXXXXXXXXX' p_bergman_ntfy: servers: example: client: example.client topics: - foo - bar
the following binds will be registered:
PBergman\\Bundle\\NtfyBundle\\Api\\StaticTopicClient $exampleFooNtfyClient
PBergman\\Bundle\\NtfyBundle\\Api\\StaticTopicClient $exampleBarNtfyClient
PBergman\\Ntfy\\Api\\Client $exampleNtfyClient
And can be used for example if a controller want to publish on foo a message:
public function indexController(Request $request, StaticTopicClient $exampleFooNtfyClient) :Response
{
$exampleFooNtfyClient->publish(null, 'hello');
Use the
php bin/console config:dump-reference p_bergman_ntfy
Command to see latest configuration options.