Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,35 @@ task my_task

Since `current_date` is overridden, the callback is never executed.

:::note
If you need to create a new configuration option based on the overridden one, use dynamic configuration syntax:

```php

set('dir_name', 'test');

// calling get during recipe initialization will give you the original value defined above
set('uses_original_dir_name', '/path/to/' . get('dir_name'));

// use dynamic configuration syntax if you need to get a value passed via -o option
set('uses_overridden_dir_name', function () {
return '/path/to/' . get('dir_name');
});

task('my_task', function () {
writeln('Path: {{uses_original_dir_name}}');
writeln('Path: {{uses_overridden_dir_name}}');
});
```

```sh
$ dep my_task deployer.org -v -o dir_name="prod"
task my_task
[deployer.org] Path: /path/to/test
[deployer.org] Path: /path/to/prod
```
:::

---

By now, you should have a solid understanding of Deployer’s basics, from defining tasks and hosts to working with
Expand Down