Skip to content

Commit a4e097b

Browse files
authored
Actualize readme, dependencies, codebase (#70)
* chore: bump packages * chore: use get:binaries instead of load:binaries for consistency * fix: roadrunner failed on first run * docs: refresh documentation
1 parent e291d40 commit a4e097b

File tree

13 files changed

+1040
-858
lines changed

13 files changed

+1040
-858
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.idea
22
app/**/rr
33
app/**/rr.exe
4-
app/**/temporal-test-server
5-
app/**/temporal-test-server.exe
4+
app/**/temporal
5+
app/**/temporal.exe
66
app/tests/**/*.log
77
app/runtime
88
app/vendor

README.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,49 @@ to start the application on host machine.
1111

1212
## Docker Compose setup
1313
**1. Download the repository.**
14-
```bash
15-
$ git clone git@github.com:temporalio/samples-php.git
16-
$ cd samples-php
14+
```shell
15+
git clone git@github.com:temporalio/samples-php.git
16+
cd samples-php
1717
```
1818

1919
**2. Build docker images.**
20-
```bash
21-
$ docker compose build
20+
```shell
21+
docker compose build
2222
```
2323

2424
**3. Start server and application containers.**
25-
```bash
26-
$ docker compose up
25+
```shell
26+
docker compose up
2727
```
2828

2929
**4. Run a sample**
3030

3131
To run a sample in docker use:
3232

33-
```bash
34-
$ docker compose exec app php app.php {sample-name}
33+
```shell
34+
docker compose exec app php app.php {sample-name}
3535
```
3636

3737
To observe active workers:
3838

39-
```bash
40-
$ docker compose exec app rr workers -i
39+
```shell
40+
docker compose exec app rr workers -i
4141
```
4242

4343
To run feature tests in docker use:
4444

45-
```bash
46-
$ docker compose exec app composer test:feat
45+
```shell
46+
docker compose exec app composer test:feat
4747
````
4848

4949
## Local Setup
5050
**1. Make sure you have PHP 8.1, or higher, installed.**
5151

5252
**2. Clone this repo and change directory into the root of the project.**
5353

54-
```bash
55-
$ git clone https://github.com/temporalio/samples-php
56-
$ cd samples-php
54+
```shell
55+
git clone https://github.com/temporalio/samples-php
56+
cd samples-php
5757
```
5858

5959
**3. Install the gRPC PHP extension**
@@ -64,41 +64,42 @@ Follow the instructions here: [https://cloud.google.com/php/grpc](https://cloud.
6464

6565
Note: For Windows machines, you can download the `php_grpc.dll` from the [PECL website](https://pecl.php.net/package/gRPC)
6666

67-
Make sure you follow the all the steps to activate the gRPC extension in your `php.ini` file and install the protobuf runtime library in your project.
67+
Make sure you follow all the steps to activate the gRPC extension in your `php.ini` file and install the protobuf runtime library in your project.
6868

6969
**4. Install additional PHP dependencies**
7070

71-
```bash
72-
$ cd app
73-
$ composer install
71+
```shell
72+
cd app
73+
composer install
7474
```
7575

76-
**5. Download RoadRunner application server**
76+
**5. Download Temporal server and RoadRunner application server **
7777

78-
The Temporal PHP SDK requires the RoadRunner v2023.2 application server and supervisor to run Activities and Workflows in a scalable way.
78+
The Temporal PHP SDK requires the RoadRunner application server and supervisor to run Activities and Workflows scalably.
7979

80-
```bash
81-
$ cd app
82-
$ ./vendor/bin/rr get
80+
Run the following command to download the necessary binaries:
81+
82+
```shell
83+
composer get:binaries
8384
```
8485

8586
Note: You can install RoadRunner manually by downloading its binary from the [release page](https://github.com/spiral/roadrunner/releases/tag/v1.9.2).
8687

87-
**6. Run the Temporal Server**
88+
Note: Check the [Quick install guide](https://docs.temporal.io/docs/server/quick-install) to install Temporal Server manually.
8889

89-
The Temporal Server must be up and running for the samples to work.
90-
The fastest way to do that is by following the [Quick install guide](https://docs.temporal.io/docs/server/quick-install).
90+
**6. Run the Temporal Server**
9191

92-
You can also run the included `docker-compose.yml` file. Make sure to comment `app` section.
92+
```shell
93+
./temporal server start-dev
94+
```
9395

9496
**7. Start the application using RoadRunner**
9597

9698
By default, all samples run using a single RoadRunner Server instance.
9799
To start the application using RoadRunner:
98100

99-
```bash
100-
$ cd app
101-
$ ./rr serve
101+
```shell
102+
./rr serve
102103
```
103104

104105
You can now interact with the samples.

app/composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
"minimum-stability": "dev",
33
"prefer-stable": true,
44
"require": {
5-
"spiral/tokenizer": "^3.14.5",
6-
"temporal/sdk": "^2.13",
7-
"temporal/open-telemetry-interceptors": "dev-master",
8-
"open-telemetry/exporter-otlp": "^1.1",
5+
"spiral/tokenizer": "^3.16.0",
6+
"temporal/sdk": "^2.16",
7+
"temporal/open-telemetry-interceptors": "^1.0",
8+
"open-telemetry/exporter-otlp": "^1.3",
99
"open-telemetry/transport-grpc": "^1.1",
1010
"symfony/console": "^5.4 || ^6.0 || ^7.0"
1111
},
1212
"require-dev": {
13-
"buggregator/trap": "^1.13",
14-
"internal/dload": "^1.0",
13+
"buggregator/trap": "^1.15",
14+
"internal/dload": "^1.8.0",
1515
"phpunit/phpunit": "^10.5"
1616
},
1717
"autoload": {
@@ -32,7 +32,7 @@
3232
}
3333
},
3434
"scripts": {
35-
"load:binaries": "dload",
35+
"get:binaries": "dload get --no-interaction -vv",
3636
"test:feat": "phpunit --testsuite=Feature --color=always --testdox"
3737
}
3838
}

0 commit comments

Comments
 (0)