php-extended / php-useragentstring-com-api
A php API wrapper to connect to useragentstring.com API
Installs: 1 076
Dependents: 0
Suggesters: 0
Security: 0
pkg:composer/php-extended/php-useragentstring-com-api
Requires
- php: >=7.1
- php-extended/php-json-object: ^5
- php-extended/polyfill-php80-stringable: >=1
- psr/http-client: ^1
- psr/http-factory: ^1
README
A php API wrapper to connect to useragentstring.com API
Installation
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-useragentstring-com-api": "^3",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
Basic Usage
You may use this library the following way :
use PhpExtended\UserAgent\UserAgentStringComApiEndpoint;
/* @var $client \Psr\Http\Client\ClientInterface */
/* @var $uriFactory \Psr\Http\Message\UriFactory */
/* @var $requestFactory \Psr\Http\Message\RequestFactory */
/* @var $apiKey string */
$endpoint = new UserAgentStringComApiEndpoint($client, $uriFactory, $requestFactory, $apiKey);
$userAgent = $endpoint->getUserAgent('<put here your user agent string (raw ascii, not encoded)>');
// $userAgent is now a \PhpExtended\UserAgent\UserstackComApiUserAgent
License
MIT (See license file).