jooservices / xcrawler-client
Wrapper for Guzzle HTTP Client
Installs: 1 400
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: 8.*
- guzzlehttp/guzzle: ^7.4
- monolog/monolog: ^2
- nesbot/carbon: ^2.50
- psr/log: ^1.1
- symfony/dom-crawler: ^5.3
Requires (Dev)
README
Wrapped for GuzzleHttp Client
Factory
used for making Client with wrapped middlewares
- Cache
- Mocking for Tests
XCrawlerClient
is Factory
wrapper with advanced thing
- Parse
response
(ResponseInterface
)
Here are few implementation of ResponseInterface
DomResponse
automatically concert to DomCrawlerJsonResponse
automatically convert json to arrayFlickrResponse
specific for Flickr jsonNow
specific for NowService
How to work with cache
$local = new FlysystemStorage(new Local(__DIR__ . '/cache'));
$url = $this->faker->url;
$cache = new CacheMiddleware(
new PrivateCacheStrategy(
$local
)
);
$factory = new Factory($this->logger, 200);
How to work with mocks
Provide 4xx - 5xx for Error case
$factory = new Factory($this->logger, 200);
TODO
- Support OAuth 1/2
- Support Flickr