dabreu / api-client-skeleton
Basic API Client/Service Skeleton
Installs: 14 343
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- cache/adapter-common: ^1.1
- monolog/monolog: *
- psr/cache: ^1.0
- psr/simple-cache: ^1.0
- dev-master
- 2.2.10
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-remove_warnings
This package is auto-updated.
Last update: 2025-03-13 00:10:00 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());