public function writeSshFile($sshCommand)
    {
        $tempDir = sys_get_temp_dir();
        $tempFile = tempnam($tempDir, 'cli-git-ssh');
        if (!$tempFile) {
            throw new \RuntimeException('Failed to create temporary file in: ' . $tempDir);
        }
        if (!file_put_contents($tempFile, trim($sshCommand) . "\n")) {
            throw new \RuntimeException('Failed to write temporary file: ' . $tempFile);
        }
        if (!chmod($tempFile, 0750)) {
            throw new \RuntimeException('Failed to make temporary SSH command file executable: ' . $tempFile);
        }

        $this->sshCommandFile = $tempFile;

        return $tempFile;
    }
public function writeSshFile($sshCommand)
    {
        $tempDir = sys_get_temp_dir();
        $tempFile = tempnam($tempDir, 'cli-git-ssh');
        if (!$tempFile) {
            throw new \RuntimeException('Failed to create temporary file in: ' . $tempDir);
        }
        if (!file_put_contents($tempFile, trim($sshCommand) . "\n")) {
            throw new \RuntimeException('Failed to write temporary file: ' . $tempFile);
        }
        if (!chmod($tempFile, 0750)) {
            throw new \RuntimeException('Failed to make temporary SSH command file executable: ' . $tempFile);
        }

        $this->sshCommandFile = $tempFile;

        return $tempFile;
    }
public function writeSshFile ( $ sshCommand ) { $ tempDir = sys_get_temp_dir ( ) ; $ tempFile = tempnam ( $ tempDir , 'cli-git-ssh' ) ; if ( ! $ tempFile ) { throw new \ RuntimeException ( 'Failed to create temporary file in: ' . $ tempDir ) ; } if ( ! file_put_contents ( $ tempFile , trim ( $ sshCommand ) . "\n" ) ) { throw new \ RuntimeException ( 'Failed to write temporary file: ' . $ tempFile ) ; } if ( ! chmod ( $ tempFile , 0750 ) ) { throw new \ RuntimeException ( 'Failed to make temporary SSH command file executable: ' . $ tempFile ) ; } $ this -> sshCommandFile = $ tempFile ; return $ tempFile ; }
Write an SSH command to a temporary file to be used with GIT_SSH.

@param string $sshCommand

@return string
Write an SSH command to a temporary file to be used with GIT_SSH .