crtdev / crt-php-client
PHP Client for CRT REST API
dev-master
2016-09-14 06:28 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2025-01-18 21:36:09 UTC
README
Requirements
- PHP 5.3 or later
- php-curl
Getting Started
$ wget https://github.com/CrtDev/CrtPhpClient/archive/master.zip $ unzip master.zip
<?php require_once('CrtPhpClient-master/init.php'); use CrtPhpClient\Crt; $crt = new Crt(); $models = $crt->catalog() ->mark('TOYOTA') ->market('JAPAN') ->model(); print_r($models); // Array // ( // [0] => ALLEX // [1] => ALLION // [2] => ALPHARD // ...
Installation via Composer
$ composer require crtdev/crt-php-client:1.*@dev
<?php require __DIR__.'/vendor/autoload.php'; use CrtPhpClient\Crt; $crt = new Crt(); print_r($crt->catalog()->mark()); // Array // ( // [0] => AUDI // [1] => BMW // [2] => CHEVROLET // ...
Tests
$ composer require crtdev/crt-php-client:1.*@dev
$ phpunit vendor/crtdev/crt-php-client
API documentation
You can browse the whole documentation at crt.ru/api/doc.
There is an optional api format - .json and .xml:
- crt.ru/api/v1/marks.json - json
- crt.ru/api/v1/marks.xml - xml
- crt.ru/api/v1/marks - html page example
By calling an URL with the parameter ?_doc=1, you will get the corresponding documentation: