Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fapi-cz/fapi-client
Fapi php client
https://github.com/fapi-cz/fapi-client
fapi fapi-client http http-client nette nette-extension nette-framework php
Last synced: 26 days ago
JSON representation
Fapi php client
- Host: GitHub
- URL: https://github.com/fapi-cz/fapi-client
- Owner: fapi-cz
- License: mit
- Created: 2018-11-14T21:19:08.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-13T22:18:15.000Z (10 months ago)
- Last Synced: 2024-09-30T14:01:42.640Z (about 1 month ago)
- Topics: fapi, fapi-client, http, http-client, nette, nette-extension, nette-framework, php
- Language: PHP
- Homepage: https://web.fapi.cz/api-doc/
- Size: 484 KB
- Stars: 5
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
[![build](https://github.com/fapi-cz/fapi-client/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/fapi-cz/fapi-client/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/fapi-cz/fapi-client/branch/master/graph/badge.svg)](https://codecov.io/gh/fapi-cz/fapi-client)
[![Maintainability](https://api.codeclimate.com/v1/badges/f364fbba86383aaab443/maintainability)](https://codeclimate.com/github/fapi-cz/php-client/maintainability)# fapi-cz/fapi-client
Library for accessing FAPI API.## Requirements
Library fapi-cz/fapi-client requires PHP 7.1 or higher and [fapi-cz/http-client](https://github.com/fapi-cz/http-client).## Installation
The best way to install fapi-cz/fapi-client is using [Composer](http://getcomposer.org/).Run command `composer require fapi-cz/fapi-client`.
## How to run tests
Run command `vendor/bin/tester -C tests`.## How to create client
```php
$clientFactory = new \Fapi\FapiClientFapiClientFactory('https://api.fapi.cz', new \Fapi\HttpClient\GuzzleHttpClient());
$fapiClient = $clientFactory->createFapiClient('Username', 'password');
```You can also use `\Fapi\HttpClient\GuzzleHttpClient` instead of `\Fapi\HttpClient\CurlHttpClient`.
## Nette DI
```yaml
extensions:
httpClient: Fapi\HttpClient\Bridges\NetteDI\HttpClientExtension
fapiClient: Fapi\FapiClient\DI\FapiClientExtension
httpClient:
type: 'guzzle' #default curl
logging: true #default false
bar: true #default falsefapiClient:
username: fapi
password: fapi
```