Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.
/ ares Public archive

Simple library for fetching address information from ARES.cz

License

Notifications You must be signed in to change notification settings

EdgedesignCZ/ares

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edgedesign ARES

Simple library for fetching information about legal subjects from Czech database called ARES.cz

Usage

In simplest case, without using any proxy server, library can be instantiated like this:

$parser = new \Edge\Ares\Parser\AddressParser();
$provider = new \Edge\Ares\Provider\HttpProvider();
$ares = new \Edge\Ares\Ares($parser, $provider);

In case proxy server needs to be specified, you can use this way:

$proxyDecorator = new \Edge\Ares\Decorator\ProxyCurlDecorator($hostname, $proxy);
$parser = new \Edge\Ares\Parser\AddressParser();
$provider = new \Edge\Ares\Provider\HttpProvider($proxyDecorator);
$ares = new \Edge\Ares\Ares($parser, $provider);

When credentials needs to be specified too, you can slightly modify the example above:

$proxyDecorator = new \Edge\Ares\Decorator\ProxyCurlDecorator($hostname, $proxy, $username, $password);
$parser = new \Edge\Ares\Parser\AddressParser();
$provider = new \Edge\Ares\Provider\HttpProvider($proxyDecorator);
$ares = new \Edge\Ares\Ares($parser, $provider);

When \Edge\Ares\Ares is instantiated, you can use it like this:

try {
    /** @var \Edge\Ares\Ares $ares */
    /** @var \Edge\Ares\Container\Address $address */
    $address = $ares->fetchSubjectAddress(12345678);
} catch (\Edge\Ares\Exception\ExceptionInterface $e) {
    // Do some error handling here.
}

About

Simple library for fetching address information from ARES.cz

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages