Add function to fetch git version
[gitphp.git] / include / gitutil.git_exec_nix.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/*
 *  gitutil.git_exec_nix.php
 *  gitphp: A PHP git repository browser
 *  Component: Git utility - execute git command on *nix
 *
 *  Copyright (C) 2008 Christopher Han <xiphux@gmail.com>
 */
 
 function git_exec_nix($project, $command)
 {
        global $gitphp_conf;
        $cmd = $gitphp_conf['gitbin'];
        if (isset($project) && (strlen($project) > 0))
                $cmd .= " --git-dir=" . $project;
        $cmd .= " " . $command;
        return shell_exec($cmd);
 }
 
?>
 
comments