Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Process] document command-as-arrays#9988

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
xabbuh merged 1 commit intosymfony:3.4fromnicolas-grekas:process-up
Aug 4, 2018

Conversation

@nicolas-grekas
Copy link
Member

Fixed#9897

command-line is parsed by the underlying shell of your operating system. This allows
using e.g. stream redirections or conditional execution, but this is a lot less portable
since each OS (esp. Windows vs Unix-like) deals with escaping and parsing differently.
When passing a command-line string, it becomes your responsibility to deal this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

deal with this

@nicolas-grekasnicolas-grekasforce-pushed theprocess-up branch 2 times, most recently from80aa41d tof9a9eaaCompareJuly 1, 2018 16:11
$process = new Process('echo %MESSAGE%');

// On both Unix-like and Windows
$process->run(null, 'MESSAGE' => 'Something to output']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The command is missing or what did I miss?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The command isecho ... This line is the->run() method call, which is the same for all OS. Only the command definition depends on the OS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I see, when I read this part it feels like it wants to show me the difference between using a string or an array value which is not the case. That's a bit confusing.
Not sure you understand what I mean. So when I readOn both Unix-like and Windows it sounds to me like the example should tell me how I could make the command run on both systems without dealing with escaping. Oh man, this is hard to explain 😄

Symfony 3.3.

Defining commands as arrays of arguments is recommended because the Process
component escapes those arguments automatically. Defining commands as
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

"Automatically escaping" does not seem to be the right wording according to your comment insymfony/symfony#27796 (comment) 😄

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

reworded :)

@nicolas-grekasnicolas-grekasforce-pushed theprocess-up branch 3 times, most recently from21b2bf2 to7cff554CompareJuly 3, 2018 11:25
@xabbuh
Copy link
Member

Thank you@nicolas-grekas.

@xabbuhxabbuh merged commitb638c88 intosymfony:3.4Aug 4, 2018
xabbuh added a commit that referenced this pull requestAug 4, 2018
This PR was merged into the 3.4 branch.Discussion----------[Process] document command-as-arraysFixed#9897Commits-------b638c88 [Process] document command-as-arrays

$process = new Process(array('/path/command', '--flag', 'arg 1', 'etc.'));

If you need use stream redirections, conditional execution, or any other
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

need to use

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

thanks, fixed in2c5579b

apfelbox reacted with thumbs up emoji
xabbuh added a commit that referenced this pull requestAug 7, 2018
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull requestAug 8, 2018
* 3.4:  Simplified the "Release Process" page  [Workflow] Fix typo documentation  Fix mismatched list items  [symfony#9988] fix minor typos  [symfony#10099] update XML and PHP config examples  [symfony#9969] fix a minor typo  [symfony#10022] fix a minor typo  preUpdate Event Listener On Uploaded Imagery  [symfony#10124] fix XML attribute name  [symfony#10062] fix the code block  [PHPUnitBridge] Explain how to show stack traces  Fix docs on trusted hosts  opcode optimizations
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull requestAug 8, 2018
* 4.1:  Simplified the "Release Process" page  [Workflow] Fix typo documentation  Fix mismatched list items  typos in sample code  [symfony#9988] fix minor typos  [symfony#10099] update XML and PHP config examples  [symfony#9969] fix a minor typo  [symfony#10022] fix a minor typo  preUpdate Event Listener On Uploaded Imagery  [symfony#9757] fix rst syntax  [symfony#10124] fix XML attribute name  [symfony#10062] fix the code block  [PHPUnitBridge] Explain how to show stack traces  Fix docs on trusted hosts  opcode optimizations
@nicolas-grekasnicolas-grekas deleted the process-up branchNovember 10, 2018 16:43
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@xabbuhxabbuhxabbuh left review comments

@OskarStarkOskarStarkOskarStark approved these changes

+3 more reviewers

@ToflarToflarToflar left review comments

@apfelboxapfelboxapfelbox left review comments

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

8 participants

@nicolas-grekas@xabbuh@javiereguiluz@Toflar@OskarStark@apfelbox@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp