Skip to content

Getting Started

Rob Landers edited this page Feb 5, 2024 · 1 revision

This is a rather simple guide on how to get started. It is meant to outline the overall process. This is still very alpha software and not recommended for production use.

Install Durable PHP

composer require bottledcode/durable-php

Install a DI container

A DI container is required, I recommend php-di

Create a bootstrap file

// src/bootstrap.php

require_once __DIR__ . '/../vendor/autoload.php';

return new Container([
  DurableClientInterface::class => autowire(DurableClient::class),
  EntityClientInterface::class => autowire(EntityClient::class),
  OrchestrationClientInterface::class => autowire(OrchestrationClient::class),
]);

Startup durable PHP

First, we need a rethinkdb instance and a beanstalkd instance, then we can start the cli

docker run -d --rm -p 11300:11300 ghcr.io/beanstalkd/beanstalkd:latest
docker run --rm -d -p 28015:28015 -p 8080:8080 rethinkdb

# start durable-php
vendor/bin/dphp run --bootstrap src/bootstrap.php

Clone this wiki locally