deployer/UPGRADE.md

49 lines
1007 B
Markdown
Raw Normal View History

2016-11-05 16:42:46 +07:00
# Upgrade from 3.x to 4.x
2015-02-05 17:14:35 +03:00
2016-11-07 13:57:38 +07:00
1. Namespace for functions
Add to beginning of *deploy.php* next line:
```php
use function Deployer\{server, task, run, set, get, add};
```
If you are using PHP version less than 5.6, you can use this:
```php
namespace Deployer;
```
2. `env()` to `set()`/`get()`
2016-11-05 17:50:18 +07:00
2016-11-05 17:56:11 +07:00
Rename all calls `env($name, $value)` to `set($name, $value)`.
2016-11-05 17:50:18 +07:00
Rename all rvalue `env($name)` to `get($name)`.
Rename all `server(...)->env(...)` to `server(...)->set(...)`.
2015-02-05 17:14:35 +03:00
2016-11-07 13:57:38 +07:00
3. Writable mode
Deployer v4 use `chgrp` instead of acl.
If you want to return to previous mode add `set('writable_mode', 'acl');`.
Also sudo turn off by default. To run commands with sudo add `set('writable_use_sudo', true);`.
2015-02-05 17:14:35 +03:00
2016-11-05 16:42:46 +07:00
# Upgrade from 2.x to 3.x
2015-02-05 17:14:35 +03:00
2016-11-05 16:43:41 +07:00
1. ### `->path('...')`
Replace your server paths configuration:
```php
server(...)
->path(...);
```
to:
```php
server(...)
->env('deploy_path', '...');
```