The library provides a wrapper for GUS TERYT SOAP API.
Recommended way of installation is via composer
composer require unit27/teryt-sdk
Create an instance of the API:
use Goosfraba\Teryt\Soap\TerytApiFactory;
use Goosfraba\Teryt\Soap\Dsn;
$factory = new TerytApiFactory();
$dsn = Dsn::prod("your-user", "your-pass");
// or
$dsn = Dsn::test(); // public test credentials
// or
$dsn = Dsn::parse("gus+teryt://your-user:your-pass@prod"); // your production credentials
$api = $factory->create($dsn);
Use API according to their documentation:
use Goosfraba\Teryt\TerytApi;
/** @var TerytApi $api */
$catalogFile = $api->PobierzKatalogSIMCAdr(); // downloads the SIMC catalogue in address version
$fileObject = $catalogFile->dump(); // Dumps the catalogue content into a file \SplFileObject
For know the SDK supports the following functions:
- CzyZalogowany
- PobierzDateAktualnegoKatTerc
- PobierzDateAktualnegoKatNTS
- PobierzDateAktualnegoKatSimc
- PobierzDateAktualnegoKatUlic
- PobierzListeWojewodztw
- PobierzListePowiatow
- PobierzListeGmin
- PobierzGminyiPowDlaWoj
- PobierzKatalogTERC
- PobierzKatalogTERCAdr
- PobierzKatalogNTS
- PobierzKatalogSIMCAdr
- PobierzKatalogSIMC
- PobierzKatalogSIMCStat
- PobierzKatalogULIC
- PobierzKatalogULICAdr
- PobierzKatalogULICBezDzielnic
- PobierzKatalogWMRODZ
- PobierzSlownikRodzajowJednostek
- PobierzSlownikCechULIC
- PobierzSlownikRodzajowSIMC
- WyszukajMiejscowosc
- WyszukajUlice
Feel free to contribute and add support for more functions.