beta · sdk · 0.1.0
PHP first sandbox request
git clone https://github.com/q10242/MiniCenter.git minicenter-source
test "$(cat minicenter-source/sdks/php/VERSION)" = "0.1.0"
composer config repositories.minicenter '{"type":"path","url":"minicenter-source/sdks/php","options":{"versions":{"minicenter/sdk":"0.1.0"}}}'
composer require minicenter/sdk:0.1.0
<?php
require __DIR__.'/vendor/autoload.php';
use MiniCenter\Client;
$correlationId = getenv('MINICENTER_CORRELATION_ID');
if (! is_string($correlationId) || $correlationId === '') {
throw new RuntimeException('MINICENTER_CORRELATION_ID is required');
}
$client = new Client(
rtrim(getenv('MINICENTER_URL'), '/').'/api/v1',
getenv('MINICENTER_PROJECT_CREDENTIAL'),
null,
fn (): string => $correlationId,
);
print_r($client->request('GET', '/project-client'));
echo "HTTP 200 correlation_id={$correlationId}\n";