1 | <?php |
||
13 | class Git |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * Git executable location |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected static $bin = '/usr/bin/git'; |
||
22 | |||
23 | /** |
||
24 | * Sets git executable path |
||
25 | * |
||
26 | * @param string $path executable location |
||
27 | */ |
||
28 | public static function set_bin($path) |
||
32 | |||
33 | /** |
||
34 | * Gets git executable path |
||
35 | */ |
||
36 | public static function get_bin() |
||
40 | |||
41 | /** |
||
42 | * Sets up library for use in a default Windows environment |
||
43 | */ |
||
44 | public static function windows_mode() |
||
48 | |||
49 | /** |
||
50 | * Create a new git repository |
||
51 | * |
||
52 | * Accepts a creation path, and, optionally, a source path |
||
53 | * |
||
54 | * @access public |
||
55 | * @param string repository path |
||
56 | * @param string directory to source |
||
57 | * @return GitRepo |
||
58 | */ |
||
59 | public static function &create($repo_path, $source = null) |
||
63 | |||
64 | /** |
||
65 | * Open an existing git repository |
||
66 | * |
||
67 | * Accepts a repository path |
||
68 | * |
||
69 | * @access public |
||
70 | * @param string repository path |
||
71 | * @return GitRepo |
||
72 | */ |
||
73 | public static function open($repo_path) |
||
77 | |||
78 | /** |
||
79 | * Clones a remote repo into a directory and then returns a GitRepo object |
||
80 | * for the newly created local repo |
||
81 | * |
||
82 | * Accepts a creation path and a remote to clone from |
||
83 | * |
||
84 | * @access public |
||
85 | * @param string repository path |
||
86 | * @param string remote source |
||
87 | * @param string reference path |
||
88 | * @return GitRepo |
||
89 | **/ |
||
90 | public static function &clone_remote($repo_path, $remote, $reference = null) |
||
95 | |||
96 | /** |
||
97 | * Checks if a variable is an instance of GitRepo |
||
98 | * |
||
99 | * Accepts a variable |
||
100 | * |
||
101 | * @access public |
||
102 | * @param mixed variable |
||
103 | * @return bool |
||
104 | */ |
||
105 | public static function is_repo($var) |
||
109 | |||
110 | } |
||
111 |