class Client extends AbstractClient implements IdAble, Node

The root of the DAG.

Properties

protected AbstractClient $client from  AbstractClient
protected Client $graphQlClient from  AbstractClient

Methods

__construct(Client $clientOrConnection, QueryBuilderChain $queryBuilderChain = new QueryBuilderChain())

No description

Results
runQuery(Query $query)

No description

null|array|string|int|float|bool
queryLeaf(Query $query, string $leafKey)

No description

object
loadObjectFromId(string $className, Id $id)

Load an object by its ID using node(id:) with an inline fragment.

address(string $value)

initialize an address to load directories, containers, secrets or other object types.

cacheVolume(string $key, Directory|null $source = null, CacheSharingMode|null $sharing = null, string|null $owner = '')

Constructs a cache volume for a given cache key.

changeset()

Creates an empty changeset

cloud()

Dagger Cloud configuration and state

codegen(ModuleSource $modSource, File $introspectionJson)

No description

codegenBase(ModuleSource $modSource, File $introspectionJson)

No description

container(Platform|null $platform = null)

Creates a scratch container, with no image or metadata.

currentFunctionCall()

The FunctionCall context that the SDK caller is currently executing in.

currentModule()

The module currently being served in the session, if any.

currentNode()

The object that received the current module function call, as a Node. Errors when there is no current call, or the call is top-level (e.g. a module constructor).

array
currentTypeDefs(bool|null $returnAllTypes = false, bool|null $hideCore = null)

The TypeDef representations of the objects currently being served in the session.

currentWorkspace()

Detect and return the current workspace.

defaultPlatform()

The default platform of the engine.

directory()

Creates an empty directory.

engine()

The Dagger engine container configuration and state

engineVolume(string $name, string|null $subdir = null)

Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.

envFile(bool|null $expand = null)

Initialize an environment file

error(string $message)

Create a new error.

file(string $name, string $contents, int|null $permissions = 420)

Creates a file with the specified contents.

function(string $name, TypeDef $returnType)

Creates a function.

generatedCode(Directory $code)

Create a code generation result, given a directory containing the generated code.

git(string $url, bool|null $keepGitDir = true, string|null $sshKnownHosts = '', Socket|null $sshAuthSocket = null, string|null $httpAuthUsername = '', Secret|null $httpAuthToken = null, Secret|null $httpAuthHeader = null, Service|null $experimentalServiceHost = null)

Queries a Git repository.

host()

Queries the host environment.

http(string $url, string|null $name = null, int|null $permissions = null, string|null $checksum = null, Secret|null $authHeader = null, Service|null $experimentalServiceHost = null)

Returns a file containing an http remote url content.

Id
id()

A unique identifier for this Query.

json()

Initialize a JSON value

LLM
llm(string|null $model = null, string|null $provider = null)

Initialize a new LLM conversation.

module()

Create a new module.

moduleRuntime(ModuleSource $modSource, File $introspectionJson)

No description

moduleSource(string $refString, string|null $refPin = '', bool|null $disableFindUp = false, bool|null $allowNotExists = false, ModuleSourceKind|null $requireKind = null)

Create a new module source instance from a source ref string

node(Id $id)

Load any object by its ID.

schema(Json $json)

Load a GraphQL introspection schema for merging.

secret(string $uri, string|null $cacheKey = null)

Creates a new secret.

setSecret(string $name, string $plaintext)

Sets a secret given a user defined name to its plaintext and returns the secret.

sourceDir()

No description

sourceMap(string $filename, int $line, int $column)

Creates source map metadata.

sshfsVolume(string $endpoint, Secret $privateKey, Secret|null $knownHosts = null, string|null $cacheKey = null, bool|null $insecureSkipHostKeyCheck = false, Service|null $experimentalServiceHost = null)

Constructs an SSHFS volume.

typeDef()

Create a new TypeDef.

string
version()

Get the current Dagger Engine version.

with(Directory|null $sdkSourceDir = null)

Configure the php-sdk constructor arguments.

Details

in AbstractClient at line 22
__construct(Client $clientOrConnection, QueryBuilderChain $queryBuilderChain = new QueryBuilderChain())

No description

Parameters

Client $clientOrConnection
QueryBuilderChain $queryBuilderChain

in AbstractClient at line 35
Results runQuery(Query $query)

No description

Parameters

Query $query

Return Value

Results

in AbstractClient at line 40
null|array|string|int|float|bool queryLeaf(Query $query, string $leafKey)

No description

Parameters

Query $query
string $leafKey

Return Value

null|array|string|int|float|bool

in AbstractClient at line 66
object loadObjectFromId(string $className, Id $id)

Load an object by its ID using node(id:) with an inline fragment.

Parameters

string $className

Fully-qualified PHP class name (e.g. \Dagger\Container)

Id $id

The object's ID

Return Value

object

at line 19
Address address(string $value)

initialize an address to load directories, containers, secrets or other object types.

Parameters

string $value

Return Value

Address

at line 29
CacheVolume cacheVolume(string $key, Directory|null $source = null, CacheSharingMode|null $sharing = null, string|null $owner = '')

Constructs a cache volume for a given cache key.

Parameters

string $key
Directory|null $source
CacheSharingMode|null $sharing
string|null $owner

Return Value

CacheVolume

at line 52
Changeset changeset()

Creates an empty changeset

Return Value

Changeset

at line 61
Cloud cloud()

Dagger Cloud configuration and state

Return Value

Cloud

at line 67
GeneratedCode codegen(ModuleSource $modSource, File $introspectionJson)

No description

Parameters

ModuleSource $modSource
File $introspectionJson

Return Value

GeneratedCode

at line 75
Container codegenBase(ModuleSource $modSource, File $introspectionJson)

No description

Parameters

ModuleSource $modSource
File $introspectionJson

Return Value

Container

at line 88
Container container(Platform|null $platform = null)

Creates a scratch container, with no image or metadata.

To pull an image, follow up with the "from" function.

Parameters

Platform|null $platform

Return Value

Container

at line 102
FunctionCall currentFunctionCall()

The FunctionCall context that the SDK caller is currently executing in.

If the caller is not currently executing in a function, this will return an error.

Return Value

FunctionCall

at line 111
CurrentModule currentModule()

The module currently being served in the session, if any.

Return Value

CurrentModule

at line 120
Node currentNode()

The object that received the current module function call, as a Node. Errors when there is no current call, or the call is top-level (e.g. a module constructor).

Return Value

Node

at line 129
array currentTypeDefs(bool|null $returnAllTypes = false, bool|null $hideCore = null)

The TypeDef representations of the objects currently being served in the session.

Parameters

bool|null $returnAllTypes
bool|null $hideCore

Return Value

array

at line 144
Workspace currentWorkspace()

Detect and return the current workspace.

Return Value

Workspace

at line 153
Platform defaultPlatform()

The default platform of the engine.

Return Value

Platform

at line 162
Directory directory()

Creates an empty directory.

Return Value

Directory

at line 171
Engine engine()

The Dagger engine container configuration and state

Return Value

Engine

at line 180
Volume engineVolume(string $name, string|null $subdir = null)

Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root.

Parameters

string $name
string|null $subdir

Return Value

Volume

at line 193
EnvFile envFile(bool|null $expand = null)

Initialize an environment file

Parameters

bool|null $expand

Return Value

EnvFile

at line 205
Error error(string $message)

Create a new error.

Parameters

string $message

Return Value

Error

at line 215
File file(string $name, string $contents, int|null $permissions = 420)

Creates a file with the specified contents.

Parameters

string $name
string $contents
int|null $permissions

Return Value

File

at line 229
Function_ function(string $name, TypeDef $returnType)

Creates a function.

Parameters

string $name
TypeDef $returnType

Return Value

Function_

at line 240
GeneratedCode generatedCode(Directory $code)

Create a code generation result, given a directory containing the generated code.

Parameters

Directory $code

Return Value

GeneratedCode

at line 250
GitRepository git(string $url, bool|null $keepGitDir = true, string|null $sshKnownHosts = '', Socket|null $sshAuthSocket = null, string|null $httpAuthUsername = '', Secret|null $httpAuthToken = null, Secret|null $httpAuthHeader = null, Service|null $experimentalServiceHost = null)

Queries a Git repository.

Parameters

string $url
bool|null $keepGitDir
string|null $sshKnownHosts
Socket|null $sshAuthSocket
string|null $httpAuthUsername
Secret|null $httpAuthToken
Secret|null $httpAuthHeader
Service|null $experimentalServiceHost

Return Value

GitRepository

at line 289
Host host()

Queries the host environment.

Return Value

Host

at line 298
File http(string $url, string|null $name = null, int|null $permissions = null, string|null $checksum = null, Secret|null $authHeader = null, Service|null $experimentalServiceHost = null)

Returns a file containing an http remote url content.

Parameters

string $url
string|null $name
int|null $permissions
string|null $checksum
Secret|null $authHeader
Service|null $experimentalServiceHost

Return Value

File

at line 329
Id id()

A unique identifier for this Query.

Return Value

Id

at line 338
JsonValue json()

Initialize a JSON value

Return Value

JsonValue

at line 347
LLM llm(string|null $model = null, string|null $provider = null)

Initialize a new LLM conversation.

Parameters

string|null $model
string|null $provider

Return Value

LLM

at line 362
Module module()

Create a new module.

Return Value

Module

at line 368
Container moduleRuntime(ModuleSource $modSource, File $introspectionJson)

No description

Parameters

ModuleSource $modSource
File $introspectionJson

Return Value

Container

at line 379
ModuleSource moduleSource(string $refString, string|null $refPin = '', bool|null $disableFindUp = false, bool|null $allowNotExists = false, ModuleSourceKind|null $requireKind = null)

Create a new module source instance from a source ref string

Parameters

string $refString
string|null $refPin
bool|null $disableFindUp
bool|null $allowNotExists
ModuleSourceKind|null $requireKind

Return Value

ModuleSource

at line 406
Node node(Id $id)

Load any object by its ID.

Parameters

Id $id

Return Value

Node

at line 416
Schema schema(Json $json)

Load a GraphQL introspection schema for merging.

Parameters

Json $json

Return Value

Schema

at line 426
Secret secret(string $uri, string|null $cacheKey = null)

Creates a new secret.

Parameters

string $uri
string|null $cacheKey

Return Value

Secret

at line 441
Secret setSecret(string $name, string $plaintext)

Sets a secret given a user defined name to its plaintext and returns the secret.

The plaintext value is limited to a size of 128000 bytes.

Parameters

string $name
string $plaintext

Return Value

Secret

at line 449
Directory sourceDir()

No description

Return Value

Directory

at line 458
SourceMap sourceMap(string $filename, int $line, int $column)

Creates source map metadata.

Parameters

string $filename
int $line
int $column

Return Value

SourceMap

at line 470
Volume sshfsVolume(string $endpoint, Secret $privateKey, Secret|null $knownHosts = null, string|null $cacheKey = null, bool|null $insecureSkipHostKeyCheck = false, Service|null $experimentalServiceHost = null)

Constructs an SSHFS volume.

Parameters

string $endpoint
Secret $privateKey
Secret|null $knownHosts
string|null $cacheKey
bool|null $insecureSkipHostKeyCheck
Service|null $experimentalServiceHost

Return Value

Volume

at line 499
TypeDef typeDef()

Create a new TypeDef.

Return Value

TypeDef

at line 508
string version()

Get the current Dagger Engine version.

Return Value

string

at line 517
Client with(Directory|null $sdkSourceDir = null)

Configure the php-sdk constructor arguments.

Parameters

Directory|null $sdkSourceDir

Return Value

Client