thgs/laminas-feed-amphp-adapter

An adapter to use Amphp HTTP client in Laminas Feed

v1.1.0 2024-02-19 15:02 UTC

This package is auto-updated.

Last update: 2024-04-19 16:30:28 UTC


README

This package provides an adapter to use Amphp HTTP Client with Laminas Feed.

Usage

There is a convenience static method provided to create and install the adapter

<?php
use thgs\Adapter\LaminasFeedHttpClient\LaminasFeedAmphpHttpClientAdapter;

LaminasFeedAmphpHttpClientAdapter::installNew($httpClient = null);

If an HttpClient is not passed to installNew a default one will be created.

If you prefer to manually install into Laminas Feed you may use the constructor.

<?php
use thgs\Adapter\LaminasFeedHttpClient\LaminasFeedAmphpHttpClientAdapter;

$adapter = new LaminasFeedAmphpHttpClientAdapter($httpClient = null);
\Laminas\Feed\Reader\Reader::setHttpClient($adapter);