1 | <?php |
||
29 | class SubmoduleCommand extends BaseCommand |
||
30 | { |
||
31 | const SUBMODULE_COMMAND = 'submodule'; |
||
32 | const SUBMODULE_ADD_COMMAND = 'add'; |
||
33 | const SUBMODULE_INIT_COMMAND = 'init'; |
||
34 | const SUBMODULE_UPDATE_COMMAND = 'update'; |
||
35 | const SUBMODULE_OPTION_FORCE = '--force'; |
||
36 | const SUBMODULE_OPTION_INIT = '--init'; |
||
37 | const SUBMODULE_OPTION_RECURSIVE = '--recursive'; |
||
38 | |||
39 | /** |
||
40 | * constructor |
||
41 | * |
||
42 | * @param \GitElephant\Repository $repo The repository object this command |
||
43 | * will interact with |
||
44 | */ |
||
45 | 1 | public function __construct(Repository $repo = null) |
|
49 | |||
50 | /** |
||
51 | * add a submodule |
||
52 | * |
||
53 | * @param string $gitUrl git url of the submodule |
||
54 | * @param string $path path to register the submodule to |
||
55 | * |
||
56 | * @throws \RuntimeException |
||
57 | * @return string |
||
58 | */ |
||
59 | 1 | public function add($gitUrl, $path = null) |
|
70 | |||
71 | /** |
||
72 | * initialize a repository's submodules |
||
73 | * |
||
74 | * @param string $path init only submodules at the specified path |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function init($path = null) |
||
88 | |||
89 | /** |
||
90 | * Lists submodules |
||
91 | * |
||
92 | * @throws \RuntimeException |
||
93 | * @return string the command |
||
94 | */ |
||
95 | public function listSubmodules() |
||
102 | |||
103 | /** |
||
104 | * Lists submodules |
||
105 | * |
||
106 | * @deprecated This method uses an unconventional name but is being left in |
||
107 | * place to remain compatible with existing code relying on it. |
||
108 | * New code should be written to use listSubmodules(). |
||
109 | * |
||
110 | * @throws \RuntimeException |
||
111 | * @return string the command |
||
112 | */ |
||
113 | public function lists() |
||
117 | |||
118 | /** |
||
119 | * update a repository's submodules |
||
120 | * |
||
121 | * @param bool $recursive update recursively |
||
122 | * @param bool $init init before update |
||
123 | * @param bool $force force the checkout as part of update |
||
124 | * @param string $path update only a specific submodule path |
||
125 | * |
||
126 | * @return string |
||
127 | */ |
||
128 | public function update($recursive = false, $init = false, $force = false, $path = null) |
||
147 | } |
||
148 |