src/Rocketeer/Services/Connections/Shell/Modules/Binaries.php
public function which($binary, $fallback = null, $prompt = true)
    {
        $locations = [
            $this->paths->getPath($binary),
            $this->localStorage->get($this->getBinaryStoragePath($binary)),
            $binary,
        ];

        // Add fallback if provided
        if ($fallback) {
            $locations[] = $fallback;
        }

        // Add command prompt if possible
        if ($this->hasCommand() && $prompt) {
            $prompt = 'Binary "'.$binary.'" could not be found, please enter the path to it';
            $locations[] = [$this->command, 'ask', $prompt];
        }

        return $this->whichFrom($binary, $locations);
    }
public function which($binary, $fallback = null, $prompt = true)
    {
        $locations = [
            $this->paths->getPath($binary),
            $this->localStorage->get($this->getBinaryStoragePath($binary)),
            $binary,
        ];

        // Add fallback if provided
        if ($fallback) {
            $locations[] = $fallback;
        }

        // Add command prompt if possible
        if ($this->hasCommand() && $prompt) {
            $prompt = 'Binary "'.$binary.'" could not be found, please enter the path to it';
            $locations[] = [$this->command, 'ask', $prompt];
        }

        return $this->whichFrom($binary, $locations);
    }
public function which ( $ binary , $ fallback = null , $ prompt = true ) { $ locations = [ $ this -> paths -> getPath ( $ binary ) , $ this -> localStorage -> get ( $ this -> getBinaryStoragePath ( $ binary ) ) , $ binary , ] ; // Add fallback if provided if ( $ fallback ) { $ locations [ ] = $ fallback ; } // Add command prompt if possible if ( $ this -> hasCommand ( ) && $ prompt ) { $ prompt = 'Binary "' . $ binary . '" could not be found, please enter the path to it' ; $ locations [ ] = [ $ this -> command , 'ask' , $ prompt ] ; } return $ this -> whichFrom ( $ binary , $ locations ) ; }
Get the path to a binary.

@param string      $binary   The name of the binary
@param string|null $fallback A fallback location
@param bool        $prompt

@return string
Get the path to a binary .