⭐️This project's code is generated by Swagger Codegen ⭐️
A simple wrapper for Codenberg API, written with PHP5.
- PHP >= 5.6
- Guzzle library,
- (optional) PHPUnit to run tests.
Via Composer:
$ composer require kanekoelastic/codenberg-php dev-master<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = \Kanekoelastic\PhpCodenberg\Configuration::getInstance(
'your-api-key',
'your-secret-key'
);
try {
// Get Access Token first
$authApi = new \Kanekoelastic\PhpCodenberg\Api\AuthApi($config);
$token = $authApi->getAccessToken();
$config->setAccessToken($token->getAccessToken());
// Then call API
$templatesApi = new \Kanekoelastic\PhpCodenberg\Api\TemplatesApi($config);
print_r($templatesApi->getTemplates());
} catch (Exception $e) {
echo 'Exception when calling codenberg Api', $e->getMessage(), PHP_EOL;
}
?>codenberg-php is licensed under the Apache License 2.0 - see the LICENSE file for details