Using the SDK
Technical Preview
The PHP SDK is a technical preview. Its API surface may still evolve and changes may not follow semantic versioning. Pin an exact version if you need stability.
The SDK provides two clients with matching surfaces:
CamundaClient— synchronous. Every method blocks until the response arrives. Use it in scripts, CLI tools, and traditional request/response applications.CamundaAsyncClient— asynchronous. Every operation returns a GuzzlePromiseInterface. Use it when you want to issue concurrent requests.
function readme_sync_client(): void
{
$client = CamundaClient::fromEnvironment();
$result = $client->deployResourcesFromFiles('order-process.bpmn');
// ...
}
function readme_async_client(): void
{
$client = CamundaAsyncClient::fromEnvironment();
$client->deployResourcesFromFilesAsync('order-process.bpmn')
->then(static function ($result): void {
// handle the DeploymentResult once the request resolves
})
->wait();
}