Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix depraction in in doc about run() #586

Merged
merged 1 commit into from
Nov 28, 2024
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
8 changes: 5 additions & 3 deletions doc/getting-started/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,30 +154,32 @@ do that by setting the `tty` option to `true`:
use Castor\Attribute\AsTask;

use function Castor\run;
use function Castor\context;

#[AsTask()]
function foo(): void
{
run('echo "bar"', tty: true);
run('echo "bar"', context: context()->withTty(true));
}
```

> [!WARNING]
> When using a TTY, the output of the command is empty in the process object
> (when using `getOutput()` or `getErrorOutput()`).

You can also disable the pty by setting the `pty` option to `false`. If `pty`
You can also disable the PTY by setting the `pty` option to `false`. If `pty`
and `tty` are both set to `false`, the standard input will not be forwarded to
the process:

```php
use Castor\Attribute\AsTask;

use function Castor\run;
use function Castor\context;

#[AsTask()]
function foo(): void
{
run('echo "bar"', pty: false);
run('echo "bar"', context: context()->withPty(false));
}
```