pickling
1.0.0
pickling PHP 拡張コミュニティ ライブラリ、PHP 拡張およびアプリケーション リポジトリ REST API 用のシンプルかつ強力なクライアントです。
基本的に、 pickling HTTPlug Discovery を通じて多くの HTTP クライアントですぐに使用できます。
つまり、次の実装ごとに少なくとも 1 つのパッケージが必要です。
コンポーザーにpickling追加するには:
composer require pecm/ pickling
kriswallsmith/buzz および nyholm/psr7 を使用する HTTP クライアントに関する一般的な提案:
composer require kriswallsmith/buzz nyholm/psr7
以下の単純な使用例以外の使用例は、examples/ フォルダーにあります。
ファクトリーインスタンス化
// pecl client with standard options
$ peclClient = pickling Factory:: createPecl ();
// pear client with standard options
$ pearClient = pickling Factory:: createPear ();
カスタマイズされたインスタンス化
// pecl client
$ peclClient = new pickling Client (
// a class that implements pickling ChannelChannelInterface
new pickling Channel Pecl (),
// a class that implements PsrHttpClientClientInterface
new Http Client Socket Client (),
// a class that implements PsrHttpMessageRequestFactoryInterface
new Nyholm Psr7 Factory Psr17Factory (),
// a class that implements PsrHttpMessageStreamFactoryInterface
new Nyholm Psr7 Factory Psr17Factory ()
);
// pear client
$ pearClient = new pickling Client (
// a class that implements pickling ChannelChannelInterface
new pickling Channel Pear (),
// a class that implements PsrHttpClientClientInterface
new Http Client Socket Client (),
// a class that implements PsrHttpMessageRequestFactoryInterface
new Nyholm Psr7 Factory Psr17Factory (),
// a class that implements PsrHttpMessageStreamFactoryInterface
new Nyholm Psr7 Factory Psr17Factory ()
);
パッケージリストの取得
$ peclClient -> getPackageList ();
pickling Resource PackageList Object
(
[channel: pickling Resource PackageList :private] => " pecl.php.net "
[list: pickling Resource PackageList :private] => Array
(
[ 0 ] => " ahocorasick "
// ...
[ 408 ] => " zstd "
)
)
パッケージリリースリストの取得
$ peclClient -> with ( ' amqp ' )-> getReleaseList ();
pickling Resource Package ReleaseList Object
(
[packageName: pickling Resource Package ReleaseList :private] => " amqp "
[channel: pickling Resource Package ReleaseList :private] => " pecl.php.net "
[list: pickling Resource Package ReleaseList :private] => Array
(
[ 0 ] => pickling Resource Package Release Version Object
(
[number: pickling Resource Package Release Version :private] => " 1.10.2 "
[stability: pickling Resource Package Release Version :private] => " stable "
)
// ...
[ 41 ] => pickling Resource Package Release Version Object
(
[number: pickling Resource Package Release Version :private] => " 0.1.0 "
[stability: pickling Resource Package Release Version :private] => " beta "
)
)
)
パッケージの最新リリースを入手
$ peclClient -> with ( ' amqp ' )-> getLatestVersion ();
" 1.10.2 "
パッケージ情報の取得
$ peclClient -> with ( ' amqp ' )-> getInfo ();
pickling Resource Package Info Object
(
[packageName: pickling Resource Package Info :private] => " amqp "
[channel: pickling Resource Package Info :private] => " pecl.php.net "
[category: pickling Resource Package Info :private] => " Networking "
[license: pickling Resource Package Info :private] => " PHP License "
[licenseUri: pickling Resource Package Info :private] => ""
[summary: pickling Resource Package Info :private] => " Communicate with any AMQP compliant server "
[description: pickling Resource Package Info :private] => " This extension can communicate with any AMQP spec 0-9-1 compatible server, such as RabbitMQ, OpenAMQP and Qpid, giving you the ability to create and delete exchanges and queues, as well as publish to any exchange and consume from any queue. "
[packageReleasesLocation: pickling Resource Package Info :private] => ""
[parentPackage: pickling Resource Package Info :private] => ""
[packageReplaceBy: pickling Resource Package Info :private] => ""
[channelReplaceBy: pickling Resource Package Info :private] => ""
)
リリース情報を取得する
$ peclClient -> with ( ' amqp ' )-> at ( ' 1.10.2 ' )-> getInfo ();
pickling Resource Package Release Info Object
(
[packageName: pickling Resource Package Release Info :private] => " amqp "
[channel: pickling Resource Package Release Info :private] => " pecl.php.net "
[version: pickling Resource Package Release Info :private] => " 1.10.2 "
[stability: pickling Resource Package Release Info :private] => " stable "
[license: pickling Resource Package Release Info :private] => " PHP License "
[releasingMaintainer: pickling Resource Package Release Info :private] => " lstrojny "
[summary: pickling Resource Package Release Info :private] => " Communicate with any AMQP compliant server "
[description: pickling Resource Package Release Info :private] => " This extension can communicate with any AMQP spec 0-9-1 compatible server, such as RabbitMQ, OpenAMQP and Qpid, giving you the ability to create and delete exchanges and queues, as well as publish to any exchange and consume from any queue. "
[releaseDate: pickling Resource Package Release Info :private] => " 2020-04-05 15:41:28 "
[releaseNotes: pickling Resource Package Release Info :private] => " - Windows build: avoid variable lengths arrays (Christoph M. Becker) (https://github.com/pdezwart/php-amqp/issues/368)
For a complete list of changes see:
https://github.com/pdezwart/php-amqp/compare/v1.10.1...v1.10.2 "
[releaseSize: pickling Resource Package Release Info :private] => 107350
[downloadUri: pickling Resource Package Release Info :private] => " https://pecl.php.net/get/amqp-1.10.2 "
[packageLink: pickling Resource Package Release Info :private] => ""
)
このライブラリは、MIT ライセンスに基づいてライセンスされています。