public function findBinary($binary, $quiet = false)
    {
        $composerBin = $this->getComposerBinDir(realpath($this->buildPath));

        if (is_string($binary)) {
            $binary = array($binary);
        }

        foreach ($binary as $bin) {
            $this->logger->log(Lang::get('looking_for_binary', $bin), LogLevel::DEBUG);

            if (is_dir($composerBin) && is_file($composerBin.'/'.$bin)) {
                $this->logger->log(Lang::get('found_in_path', $composerBin, $bin), LogLevel::DEBUG);
                return $composerBin . '/' . $bin;
            }

            if (is_file($this->rootDir . $bin)) {
                $this->logger->log(Lang::get('found_in_path', 'root', $bin), LogLevel::DEBUG);
                return $this->rootDir . $bin;
            }

            if (is_file($this->rootDir . 'vendor/bin/' . $bin)) {
                $this->logger->log(Lang::get('found_in_path', 'vendor/bin', $bin), LogLevel::DEBUG);
                return $this->rootDir . 'vendor/bin/' . $bin;
            }

            $findCmdResult = $this->findGlobalBinary($bin);
            if (is_file($findCmdResult)) {
                $this->logger->log(Lang::get('found_in_path', '', $bin), LogLevel::DEBUG);
                return $findCmdResult;
            }
        }

        if ($quiet) {
            return;
        }
        throw new Exception(Lang::get('could_not_find', implode('/', $binary)));
    }
public function findBinary($binary, $quiet = false)
    {
        $composerBin = $this->getComposerBinDir(realpath($this->buildPath));

        if (is_string($binary)) {
            $binary = array($binary);
        }

        foreach ($binary as $bin) {
            $this->logger->log(Lang::get('looking_for_binary', $bin), LogLevel::DEBUG);

            if (is_dir($composerBin) && is_file($composerBin.'/'.$bin)) {
                $this->logger->log(Lang::get('found_in_path', $composerBin, $bin), LogLevel::DEBUG);
                return $composerBin . '/' . $bin;
            }

            if (is_file($this->rootDir . $bin)) {
                $this->logger->log(Lang::get('found_in_path', 'root', $bin), LogLevel::DEBUG);
                return $this->rootDir . $bin;
            }

            if (is_file($this->rootDir . 'vendor/bin/' . $bin)) {
                $this->logger->log(Lang::get('found_in_path', 'vendor/bin', $bin), LogLevel::DEBUG);
                return $this->rootDir . 'vendor/bin/' . $bin;
            }

            $findCmdResult = $this->findGlobalBinary($bin);
            if (is_file($findCmdResult)) {
                $this->logger->log(Lang::get('found_in_path', '', $bin), LogLevel::DEBUG);
                return $findCmdResult;
            }
        }

        if ($quiet) {
            return;
        }
        throw new Exception(Lang::get('could_not_find', implode('/', $binary)));
    }
public function findBinary ( $ binary , $ quiet = false ) { $ composerBin = $ this -> getComposerBinDir ( realpath ( $ this -> buildPath ) ) ; if ( is_string ( $ binary ) ) { $ binary = array ( $ binary ) ; } foreach ( $ binary as $ bin ) { $ this -> logger -> log ( Lang :: get ( 'looking_for_binary' , $ bin ) , LogLevel :: DEBUG ) ; if ( is_dir ( $ composerBin ) && is_file ( $ composerBin . '/' . $ bin ) ) { $ this -> logger -> log ( Lang :: get ( 'found_in_path' , $ composerBin , $ bin ) , LogLevel :: DEBUG ) ; return $ composerBin . '/' . $ bin ; } if ( is_file ( $ this -> rootDir . $ bin ) ) { $ this -> logger -> log ( Lang :: get ( 'found_in_path' , 'root' , $ bin ) , LogLevel :: DEBUG ) ; return $ this -> rootDir . $ bin ; } if ( is_file ( $ this -> rootDir . 'vendor/bin/' . $ bin ) ) { $ this -> logger -> log ( Lang :: get ( 'found_in_path' , 'vendor/bin' , $ bin ) , LogLevel :: DEBUG ) ; return $ this -> rootDir . 'vendor/bin/' . $ bin ; } $ findCmdResult = $ this -> findGlobalBinary ( $ bin ) ; if ( is_file ( $ findCmdResult ) ) { $ this -> logger -> log ( Lang :: get ( 'found_in_path' , '' , $ bin ) , LogLevel :: DEBUG ) ; return $ findCmdResult ; } } if ( $ quiet ) { return ; } throw new Exception ( Lang :: get ( 'could_not_find' , implode ( '/' , $ binary ) ) ) ; }
Find a binary required by a plugin.
@param string $binary
@param bool $quiet
@return null|string
Find a binary required by a plugin .