https://github.com/dagger/dagger-php-sdk
A read-only mirror of the Dagger PHP SDK. Do not use directly! To contribute, see https://github.com/dagger/dagger/tree/main/sdk/php
https://github.com/dagger/dagger-php-sdk
Last synced: 9 months ago
JSON representation
A read-only mirror of the Dagger PHP SDK. Do not use directly! To contribute, see https://github.com/dagger/dagger/tree/main/sdk/php
- Host: GitHub
- URL: https://github.com/dagger/dagger-php-sdk
- Owner: dagger
- License: apache-2.0
- Created: 2023-12-21T13:25:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-11T14:49:29.000Z (9 months ago)
- Last Synced: 2025-04-11T15:53:33.777Z (9 months ago)
- Language: PHP
- Size: 555 KB
- Stars: 23
- Watchers: 10
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
> **Warning** This SDK is experimental. Please do not use it for anything
> mission-critical. Possible issues include:
- Missing features
- Stability issues
- Performance issues
- Lack of polish
- Upcoming breaking changes
- Incomplete or out-of-date documentation
> **Warning**
> The Dagger PHP SDK requires Dagger v0.9.3 or later
# Dagger PHP SDK
An experimental [Dagger.io](https://dagger.io) SDK for PHP.
## Usage
```php
$client = Dagger::connect();
$output = $client
->container()
->from('alpine')
->withExec(['apk', 'add', 'curl'])
->withExec(['curl', 'https://dagger.io'])
->stdout();
echo substr($output, 0, 300);
```
## Development environment
You can launch a basic development environment by using the provided docker-compose file.
1. Launch the cli : `docker compose up -d cli`
2. Spawn a shell inside : `docker compose exec cli bash`
3. Install dependencies : `composer install`
4. Run the tests : `phpunit`
You can regenerate the files by using the `./codegen` command
## Developing with the PHP SDK runtime
From a parent directory of the PHP SDK, run `dagger init --sdk=/sdk/php`.
This will use the PHP SDK runtime with local source code which will make the feedback loop much faster than
pulling changes from the remote repository.