Skip to content

Instantly share code, notes, and snippets.

@lxfontes
Created December 20, 2011 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lxfontes/1503192 to your computer and use it in GitHub Desktop.
Save lxfontes/1503192 to your computer and use it in GitHub Desktop.
git-php blob
public static function blob($proj, $path) {
$gitBinary = System::get('git_binary');
$cmd = sprintf("GIT_DIR=%s%s %s show HEAD:%s 2>&1", self::$repos[$proj],
System::get('repo_suffix'),
$gitBinary,
escapeshellarg($path));
$content = shell_exec($cmd);
return array(
'content' => $content,
'ext' => 'something'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment