Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Finder] fixed regression in the Finder component (it was possible to use it without using exec before, closes #6357) #6882

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

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 5 additions & 1 deletion src/Symfony/Component/Finder/Shell/Shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public function testCommand($command)
{
if (self::TYPE_WINDOWS === $this->type) {
// todo: find a way to test if windows command exists
return true;
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

@fabpot why has this been changed ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@fabpot @vicb I dont think it's important,

  • return true means each tested command is available on windows plateformes,
  • return false means no tested command is available on windows plateformes.

Considering that Windows plateformes support is not implemented and that none of the two solutions would be acceptable, I guess the only important thing is to return a boolean, whatever its value.

That said, false may be safer than true.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for the clarification.

}

if (!function_exists('exec')) {
return false;
}

// todo: find a better way (command could not be available)
Expand Down