pbergman / ntfy-bundle
该软件包最新版本(1.0.2)没有提供许可证信息。
支持ntfy的Symfony软件包
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-09-20 11:20:45 UTC
README
一个Symfony软件包,使管理多个 nfty 服务器和主题变得简单。
当从配置文件创建服务并且启用自动注入时,将为服务器和每个主题注册参数绑定,这些绑定可以用作参数。
例如,我们有以下配置
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
将注册以下绑定
PBergman\\Bundle\\NtfyBundle\\Api\\StaticTopicClient $exampleFooNtfyClient
PBergman\\Bundle\\NtfyBundle\\Api\\StaticTopicClient $exampleBarNtfyClient
PBergman\\Ntfy\\Api\\Client $exampleNtfyClient
例如,如果控制器想向foo发布一条消息,可以使用以下绑定
public function indexController(Request $request, StaticTopicClient $exampleFooNtfyClient) :Response
{
$exampleFooNtfyClient->publish(null, 'hello');
使用
php bin/console config:dump-reference p_bergman_ntfy
命令查看最新的配置选项。