private function guessComposerCommand()
    {
        $candidateNames = array('composer', 'composer.phar');

        $executableFinder = new ExecutableFinder();
        foreach ($candidateNames as $candidateName) {
            if ($composerPath = $executableFinder->find($candidateName, null, array(getcwd()))) {
                return array(realpath($composerPath));
            }
        }

        foreach ($candidateNames as $candidateName) {
            $composerPath = sprintf('%s/%s', getcwd(), $candidateName);
            if (file_exists($composerPath)) {
                $phpFinder = new PhpExecutableFinder();

                return array_merge(
                    array(
                        $phpFinder->find(false),
                        $composerPath,
                    ),
                    $phpFinder->findArguments()
                );
            }
        }

        return;
    }
private function guessComposerCommand()
    {
        $candidateNames = array('composer', 'composer.phar');

        $executableFinder = new ExecutableFinder();
        foreach ($candidateNames as $candidateName) {
            if ($composerPath = $executableFinder->find($candidateName, null, array(getcwd()))) {
                return array(realpath($composerPath));
            }
        }

        foreach ($candidateNames as $candidateName) {
            $composerPath = sprintf('%s/%s', getcwd(), $candidateName);
            if (file_exists($composerPath)) {
                $phpFinder = new PhpExecutableFinder();

                return array_merge(
                    array(
                        $phpFinder->find(false),
                        $composerPath,
                    ),
                    $phpFinder->findArguments()
                );
            }
        }

        return;
    }
private function guessComposerCommand ( ) { $ candidateNames = array ( 'composer' , 'composer.phar' ) ; $ executableFinder = new ExecutableFinder ( ) ; foreach ( $ candidateNames as $ candidateName ) { if ( $ composerPath = $ executableFinder -> find ( $ candidateName , null , array ( getcwd ( ) ) ) ) { return array ( realpath ( $ composerPath ) ) ; } } foreach ( $ candidateNames as $ candidateName ) { $ composerPath = sprintf ( '%s/%s' , getcwd ( ) , $ candidateName ) ; if ( file_exists ( $ composerPath ) ) { $ phpFinder = new PhpExecutableFinder ( ) ; return array_merge ( array ( $ phpFinder -> find ( false ) , $ composerPath , ) , $ phpFinder -> findArguments ( ) ) ; } } return ; }
Guess and build the command to call composer.

Search:
- a executable composer (or composer.phar)
- a file composer (or composer.phar) prefixed by php
Guess and build the command to call composer .