Skip to content

Commit ea0e1dc

Browse files
committed
Update UPGRADE.md
1 parent 9963b7a commit ea0e1dc

1 file changed

Lines changed: 89 additions & 4 deletions

File tree

docs/UPGRADE.md

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,95 @@
22

33
## Upgrade from 7.x to 8.x
44

5-
- `run()` and `runLocally()` doesn't accept `options` parameter anymore. Use named arguments instead.
6-
- `no_throw` is now `nothrow`.
7-
- `real_time_output` is now `forceOutput`.
8-
- `idle_timeout` is now `idleTimeout`.
5+
### Requirements
6+
7+
- PHP 8.3 or later is required.
8+
- Symfony 7.4+ or 8.0+ components are now required.
9+
10+
### `run()` and `runLocally()` changes
11+
12+
The `$options` array parameter has been removed. Use named arguments instead.
13+
14+
```php
15+
# Before (v7):
16+
run('command', ['timeout' => 5, 'no_throw' => true]);
17+
18+
# After (v8):
19+
run('command', timeout: 5, nothrow: true);
20+
```
21+
22+
Parameter renames:
23+
- `no_throw``nothrow`
24+
- `real_time_output``forceOutput`
25+
- `idle_timeout``idleTimeout`
26+
27+
The `secret` parameter has been replaced with `secrets` (an associative array of multiple named secrets):
28+
29+
```php
30+
# Before (v7):
31+
run('echo %secret%', secret: getenv('MY_SECRET'));
32+
33+
# After (v8):
34+
run('echo %my_secret%', secrets: ['my_secret' => getenv('MY_SECRET')]);
35+
```
36+
37+
A new `cwd` parameter allows setting the working directory directly:
38+
39+
```php
40+
run('ls', cwd: '/var/www');
41+
```
42+
43+
### `escapeshellarg()``quote()`
44+
45+
All uses of PHP's `escapeshellarg()` have been replaced with Deployer's own `quote()` function,
46+
which uses ANSI-C `$'...'` quoting syntax for better shell compatibility:
47+
48+
```php
49+
# Before (v7):
50+
run('echo ' . escapeshellarg($arg));
51+
52+
# After (v8):
53+
run('echo ' . quote($arg));
54+
```
55+
56+
You can also use the `quote` filter in config templates:
57+
58+
```php
59+
run('echo {{ message | quote }}');
60+
```
61+
62+
### Template escaping
63+
64+
To output literal `{{` in commands without config replacement, escape with a backslash:
65+
66+
```php
67+
run('echo \{{not_replaced}}'); // outputs: {{not_replaced}}
68+
```
69+
70+
### `Httpie` changes
71+
72+
- `Httpie::send()` now returns an `HttpResponse` object instead of a string.
73+
Use `->send()->body()` to get the response body as a string.
74+
- `Httpie::getJson()` is deprecated. Use `sendJson()` instead.
75+
- `Httpie` methods no longer clone the object — they mutate and return `$this`.
76+
- The `fetch()` function now supports `put`, `patch`, and `delete` methods.
77+
78+
79+
### Other breaking changes
80+
81+
- Self-update functionality has been removed.
82+
83+
### New features
84+
85+
- **MAML recipes**: A new `deploy.maml` recipe format is now supported alongside PHP and YAML recipes.
86+
- **`local_archive` strategy**: A new `update_code_strategy` option that copies code from the local machine instead of fetching from a remote repository.
87+
- **`composer_version` config**: Install a specific Composer version on the remote host:
88+
```php
89+
set('composer_version', '2.7');
90+
```
91+
- **`Host::setShellPath()`**: Customize the shell path per host.
92+
- **CI user detection**: Automatic detection of CI usernames from GitLab, GitHub Actions, CircleCI, and Drone CI environments.
93+
- **ACL improvements**: New `writable_acl_groups` and `writable_acl_force` config options for `deploy:writable`.
994

1095
## Upgrade from 6.x to 7.x
1196

0 commit comments

Comments
 (0)