kanekoelastic / codenberg-php
PHP Wrapper for Codenberg API
Installs: 34
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
pkg:composer/kanekoelastic/codenberg-php
Requires
- php: >=5.6
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: 2.9.*
- phpunit/phpunit: 5.7.*
- squizlabs/php_codesniffer: 3.2.*
This package is not auto-updated.
Last update: 2021-09-18 12:42:37 UTC
README
codenberg-php
A simple wrapper for Codenberg API, written with PHP5.
Requirements
- PHP >= 5.6
- Guzzle library,
- (optional) PHPUnit to run tests.
Install
Via Composer:
$ composer require kanekoelastic/codenberg-php dev-master
Basic usage
<?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; } ?>
License
codenberg-php
is licensed under the Apache License 2.0 - see the LICENSE file for details