jobcloud / php-console-kafka-schema-registry
Kafka模式注册表的命令行工具
v2.3.0
2023-09-19 11:26 UTC
Requires
- php: ^8.0
- ext-json: *
- flix-tech/avro-php: ^3.0|^4.0|^5.0
- jobcloud/php-kafka-schema-registry-client: ^2.0
- kriswallsmith/buzz: ^1.2
- nyholm/psr7: ^1.4
- pimple/pimple: ^3.2
- symfony/console: ^5.1|^6.0
Requires (Dev)
- infection/infection: ^0.26
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.5
- rregeer/phpunit-coverage-check: ^0.3.1
- squizlabs/php_codesniffer: ^3.6
- dev-main
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.1
- v2.0.0
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- v1.0.0-beta
- v1.0.0-alpha
- 0.1.x-dev
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-feat/CDH-457/symfony-upgrade
- dev-debug/delete-command
- dev-chore/remove-guzzle
This package is auto-updated.
Last update: 2024-09-23 08:36:43 UTC
README
安装
composer require jobcloud/php-console-kafka-schema-registry
需求
- php: >= 7.4
注册命令
您可以将每个命令单独注册,如下所示
<?php use Symfony\Component\Console\Application; use Jobcloud\SchemaConsole\Command\ListAllSchemasCommand; use Jobcloud\SchemaConsole\SchemaRegistryApi; use GuzzleHttp\Client; $client = new Client( [ 'base_uri' => 'url-to-your-schema-api', //'auth' => ['schema-username', 'schema-password'] ] ); $schemaRegistryApi = new SchemaRegistryApi($client); $console = new Application(); $console->add(new ListAllSchemasCommand($schemaRegistryApi));
或者您也可以通过服务提供者注册它们
<?php use Jobcloud\SchemaConsole\ServiceProvider\CommandServiceProvider; use Pimple\Container; $container = new Container(); $container->register(new CommandServiceProvider());
注意:要使用服务提供者,您需要在容器中设置以下内容
- 或者
kafka.schema.registry.client
,即guzzle客户端,或者可以选择性地设置kafka.schema.registry.url
- 如果您需要使用基本认证,需要设置
kafka.schema.registry.username
和kafka.schema.registry.password