dabreu / api-client-skeleton
Basic API Client/Service Skeleton
2.2.10
2022-10-12 19:05 UTC
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- cache/adapter-common: ^1.1
- monolog/monolog: *
- psr/cache: ^1.0
- psr/simple-cache: ^1.0
This package is auto-updated.
Last update: 2026-07-13 02:59:10 UTC
README
Basic API Client/Service
Usage
// Initialization
//$cacheAdapter = new \CSApi\Cache\Adapter\FilesystemPool('./_cache');
$mCli = class_exists('Memcached') ? new \Memcached() : new \Memcache();
$mCli->addServer('localhost', 11211);
$cacheAdapter = new \CSApi\Cache\Adapter\MemcachePool($mCli);
\CSApi\Api::init(
'http://domain.com/api/v1',
[
'clientId' => 'app1',
'serviceId' => 'service1'
],
[
'debug' => true,
'cache' => [
'adapter' => $cacheAdapter,
'ttl' => 20
]
]
);
// Object driven request
$testInfo = (new \CSApi\Objects\Test())
->get();
print_r($testInfo->getData());