PHP code example of gboddin / drone-php-client

1. Go to this page and download the library: Download gboddin/drone-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gboddin / drone-php-client example snippets



onfigure API key authorization: accessToken
DroneClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// DroneClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer');

$api_instance = new DroneClient\Api\BuildsApi();
$owner = "owner_example"; // string | owner of the repository
$name = "name_example"; // string | name of the repository

try {
    $result = $api_instance->reposOwnerNameBuildsGet($owner, $name);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BuildsApi->reposOwnerNameBuildsGet: ', $e->getMessage(), PHP_EOL;
}


composer