@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @param int $id |
44 | - * @return \Git_RemoteServer_GerritReplicationSSHKey |
|
44 | + * @return Git_RemoteServer_Gerrit_ReplicationSSHKey |
|
45 | 45 | */ |
46 | 46 | public function setGerritHostId($id) { |
47 | 47 | $this->host_id = $id; |
@@ -20,6 +20,9 @@ |
||
20 | 20 | |
21 | 21 | class Git_RemoteServer_GerritServerPresenter { |
22 | 22 | |
23 | + /** |
|
24 | + * @param boolean $is_used |
|
25 | + */ |
|
23 | 26 | public function __construct(Git_RemoteServer_GerritServer $server, $is_used) { |
24 | 27 | $this->id = $server->getId(); |
25 | 28 | $this->host = $server->getHost(); |
@@ -112,6 +112,9 @@ discard block |
||
112 | 112 | ); |
113 | 113 | } |
114 | 114 | |
115 | + /** |
|
116 | + * @param integer $remote_server_id |
|
117 | + */ |
|
115 | 118 | public function queueMigrateToGerrit(GitRepository $repository, $remote_server_id, $gerrit_template_id) { |
116 | 119 | $this->system_event_manager->createEvent( |
117 | 120 | SystemEvent_GIT_GERRIT_MIGRATION::NAME, |
@@ -161,6 +164,9 @@ discard block |
||
161 | 164 | ); |
162 | 165 | } |
163 | 166 | |
167 | + /** |
|
168 | + * @param string $repository_path |
|
169 | + */ |
|
164 | 170 | public function queueGrokMirrorManifestRepoDelete($repository_path) { |
165 | 171 | $this->system_event_manager->createEvent( |
166 | 172 | SystemEvent_GIT_GROKMIRROR_MANIFEST_REPODELETE::NAME, |
@@ -50,6 +50,9 @@ discard block |
||
50 | 50 | $this->synchroniseSSHKeysWithGerrit($original_keys, $new_keys, $user); |
51 | 51 | } |
52 | 52 | |
53 | + /** |
|
54 | + * @param PFUser $user |
|
55 | + */ |
|
53 | 56 | private function synchroniseSSHKeysWithGerrit($original_keys, $new_keys, $user) { |
54 | 57 | $this->getGerritUserAccountManager() |
55 | 58 | ->synchroniseSSHKeys( |
@@ -61,7 +64,6 @@ discard block |
||
61 | 64 | |
62 | 65 | /** |
63 | 66 | * |
64 | - * @param Git_RemoteServer_GerritServerFactory $factory |
|
65 | 67 | * @return void |
66 | 68 | * @throws Git_UserSynchronisationException |
67 | 69 | */ |
@@ -69,6 +71,9 @@ discard block |
||
69 | 71 | $this->pushSSHKeysToGerrit($user); |
70 | 72 | } |
71 | 73 | |
74 | + /** |
|
75 | + * @param PFUser $user |
|
76 | + */ |
|
72 | 77 | private function pushSSHKeysToGerrit($user) { |
73 | 78 | $this->getGerritUserAccountManager()->pushSSHKeys($user); |
74 | 79 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * Verify if the repository as already some content within |
27 | 27 | * |
28 | 28 | * @see plugins/git/include/Git_Backend_Interface::isInitialized() |
29 | - * @param GitRepository $repository |
|
29 | + * @param GitRepository $respository |
|
30 | 30 | * @return Boolean |
31 | 31 | */ |
32 | 32 | public function isInitialized(GitRepository $respository); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * Verify if the repository has been created |
36 | 36 | * |
37 | 37 | * @see plugins/git/include/Git_Backend_Interface::isCreated() |
38 | - * @param GitRepository $repository |
|
38 | + * @param GitRepository $respository |
|
39 | 39 | * @return Boolean |
40 | 40 | */ |
41 | 41 | public function isCreated(GitRepository $respository); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param Project $project The project to rename |
106 | 106 | * @param string $newName The new name of the project |
107 | 107 | * |
108 | - * @return true if success, false otherwise |
|
108 | + * @return boolean if success, false otherwise |
|
109 | 109 | */ |
110 | 110 | public function renameProject(Project $project, $newName); |
111 | 111 | |
@@ -120,6 +120,7 @@ discard block |
||
120 | 120 | * Perform logical deletion repository in DB |
121 | 121 | * |
122 | 122 | * @param GitRepository $repository |
123 | + * @return void |
|
123 | 124 | */ |
124 | 125 | public function markAsDeleted(GitRepository $repository); |
125 | 126 | |
@@ -127,6 +128,7 @@ discard block |
||
127 | 128 | * Physically delete a repository already marked for deletion |
128 | 129 | * |
129 | 130 | * @param GitRepository $repository |
131 | + * @return void |
|
130 | 132 | */ |
131 | 133 | public function delete(GitRepository $repository); |
132 | 134 | |
@@ -134,6 +136,7 @@ discard block |
||
134 | 136 | * Purge archived repository |
135 | 137 | * |
136 | 138 | * @param GitRepository $repository |
139 | + * @return void |
|
137 | 140 | */ |
138 | 141 | public function deleteArchivedRepository(GitRepository $repository); |
139 | 142 | |
@@ -141,6 +144,7 @@ discard block |
||
141 | 144 | * Move the archived gitolite repositories to the archiving area before purge |
142 | 145 | * |
143 | 146 | * @param GitRepository $repository |
147 | + * @return boolean |
|
144 | 148 | */ |
145 | 149 | public function archiveBeforePurge(GitRepository $repository); |
146 | 150 | } |
@@ -32,6 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | /** |
34 | 34 | * @param String $work_tree The git repository path where we should operate |
35 | + * @param string $git_dir |
|
35 | 36 | */ |
36 | 37 | public function __construct($work_tree, $git_dir = null) { |
37 | 38 | $this->work_tree = $work_tree; |
@@ -53,6 +54,9 @@ discard block |
||
53 | 54 | $this->gitCmd('init'); |
54 | 55 | } |
55 | 56 | |
57 | + /** |
|
58 | + * @param string $email |
|
59 | + */ |
|
56 | 60 | public function setLocalCommiter($name, $email) { |
57 | 61 | $this->gitCmd('config --add user.name '.escapeshellarg($name)); |
58 | 62 | $this->gitCmd('config --add user.email '.escapeshellarg($email)); |
@@ -62,14 +66,24 @@ discard block |
||
62 | 66 | $this->gitCmd('remote add origin '.escapeshellarg($remote)); |
63 | 67 | } |
64 | 68 | |
69 | + /** |
|
70 | + * @param string $remote |
|
71 | + * @param string $branch |
|
72 | + */ |
|
65 | 73 | public function pullBranch($remote, $branch) { |
66 | 74 | $this->gitCmd('pull --quiet '.$remote.' '.$branch); |
67 | 75 | } |
68 | 76 | |
77 | + /** |
|
78 | + * @param string $branch |
|
79 | + */ |
|
69 | 80 | public function checkoutBranch($branch) { |
70 | 81 | $this->gitCmd('checkout --quiet '.$branch); |
71 | 82 | } |
72 | 83 | |
84 | + /** |
|
85 | + * @param string $file |
|
86 | + */ |
|
73 | 87 | public function configFile($file, $config) { |
74 | 88 | $this->gitCmd('config -f '. escapeshellarg($file) .' '. $config); |
75 | 89 | } |
@@ -162,6 +176,9 @@ discard block |
||
162 | 176 | return $output; |
163 | 177 | } |
164 | 178 | |
179 | + /** |
|
180 | + * @param string $refname |
|
181 | + */ |
|
165 | 182 | private function getOtherBranches($refname) { |
166 | 183 | $branches = $this->getAllBranches(); |
167 | 184 | foreach($branches as $key => $branch) { |
@@ -28,6 +28,9 @@ discard block |
||
28 | 28 | private $admin_path; |
29 | 29 | private $git_exec; |
30 | 30 | |
31 | + /** |
|
32 | + * @param string $admin_path |
|
33 | + */ |
|
31 | 34 | public function __construct($admin_path, Git_Exec $git_exec) { |
32 | 35 | $this->admin_path = $admin_path; |
33 | 36 | $this->git_exec = $git_exec; |
@@ -129,6 +132,9 @@ discard block |
||
129 | 132 | $this->removeUserExistingKeysFromAGivenKeyId($user_name, $ssh_key_id); |
130 | 133 | } |
131 | 134 | |
135 | + /** |
|
136 | + * @param string $filePath |
|
137 | + */ |
|
132 | 138 | private function writeKeyIfChanged($filePath, $key) { |
133 | 139 | $changed = true; |
134 | 140 | if (is_file($filePath)) { |
@@ -145,7 +151,6 @@ discard block |
||
145 | 151 | /** |
146 | 152 | * Remove all pub SSH keys previously associated to a user |
147 | 153 | * |
148 | - * @param IHaveAnSSHKey $user |
|
149 | 154 | * @param int $last_key_id |
150 | 155 | */ |
151 | 156 | private function removeUserExistingKeysFromAGivenKeyId($user_name, $last_key_id) { |
@@ -159,6 +164,9 @@ discard block |
||
159 | 164 | } |
160 | 165 | } |
161 | 166 | |
167 | + /** |
|
168 | + * @param string $userbase |
|
169 | + */ |
|
162 | 170 | private function getKeyNumber($userbase, $file) { |
163 | 171 | $matches = array(); |
164 | 172 | if (preg_match('%^'.$this->getKeyDirPath().'/'.$userbase.'([0-9]+).pub$%', $file, $matches)) { |
@@ -61,6 +61,9 @@ |
||
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | + /** |
|
65 | + * @param string $file_name |
|
66 | + */ |
|
64 | 67 | private function isReservedName($file_name) { |
65 | 68 | if ($this->isAdminKey($file_name) || $this->isGerritKey($file_name)) { |
66 | 69 | return true; |
@@ -95,8 +95,6 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * Constructor |
97 | 97 | * |
98 | - * @param string $adminPath The path to admin folder of gitolite. |
|
99 | - * Default is $sys_data_dir . "/gitolite/admin" |
|
100 | 98 | */ |
101 | 99 | public function __construct( |
102 | 100 | Logger $logger, |
@@ -188,6 +186,9 @@ discard block |
||
188 | 186 | return realpath($this->adminPath .'/../repositories'); |
189 | 187 | } |
190 | 188 | |
189 | + /** |
|
190 | + * @param string $adminPath |
|
191 | + */ |
|
191 | 192 | public function setAdminPath($adminPath) { |
192 | 193 | $this->oldCwd = getcwd(); |
193 | 194 | $this->adminPath = $adminPath; |
@@ -264,6 +265,9 @@ discard block |
||
264 | 265 | return $res; |
265 | 266 | } |
266 | 267 | |
268 | + /** |
|
269 | + * @param string $message |
|
270 | + */ |
|
267 | 271 | public function commit($message) { |
268 | 272 | return $this->gitExec->commit($message); |
269 | 273 | } |
@@ -278,7 +282,7 @@ discard block |
||
278 | 282 | * @param String $oldName The old name of the project |
279 | 283 | * @param String $newName The new name of the project |
280 | 284 | * |
281 | - * @return true if success, false otherwise |
|
285 | + * @return boolean if success, false otherwise |
|
282 | 286 | */ |
283 | 287 | public function renameProject($oldName, $newName) { |
284 | 288 | $ok = true; |
@@ -302,6 +306,9 @@ discard block |
||
302 | 306 | return $ok; |
303 | 307 | } |
304 | 308 | |
309 | + /** |
|
310 | + * @param string $path |
|
311 | + */ |
|
305 | 312 | public function delete($path) { |
306 | 313 | if ( empty($path) || !is_writable($path) ) { |
307 | 314 | throw new GitDriverErrorException('Empty path or permission denied '.$path); |
@@ -316,6 +323,11 @@ discard block |
||
316 | 323 | return true; |
317 | 324 | } |
318 | 325 | |
326 | + /** |
|
327 | + * @param string $repo |
|
328 | + * @param string $old_ns |
|
329 | + * @param string $new_ns |
|
330 | + */ |
|
319 | 331 | public function fork($repo, $old_ns, $new_ns) { |
320 | 332 | $source = unixPathJoin(array($this->getRepositoriesPath(), $old_ns, $repo)) .'.git'; |
321 | 333 | $target = unixPathJoin(array($this->getRepositoriesPath(), $new_ns, $repo)) .'.git'; |
@@ -337,6 +349,9 @@ discard block |
||
337 | 349 | return false; |
338 | 350 | } |
339 | 351 | |
352 | + /** |
|
353 | + * @param string $cmd |
|
354 | + */ |
|
340 | 355 | protected function executeShellCommand($cmd) { |
341 | 356 | $cmd = $cmd.' 2>&1'; |
342 | 357 | exec($cmd, $output, $retVal); |
@@ -364,9 +379,8 @@ discard block |
||
364 | 379 | /** |
365 | 380 | * Backup gitolite repository |
366 | 381 | * |
367 | - * @param String $path The repository path |
|
368 | 382 | * @param String $backup_directory The repository backup directory path |
369 | - * @param String $repositoryName |
|
383 | + * @param String $repository |
|
370 | 384 | * |
371 | 385 | */ |
372 | 386 | public function backup(GitRepository $repository, $backup_directory) { |
@@ -418,6 +432,7 @@ discard block |
||
418 | 432 | * @param GitRepository $repository |
419 | 433 | * @param String git_root_path |
420 | 434 | * @param String $backup_directory |
435 | + * @param string $git_root_path |
|
421 | 436 | * |
422 | 437 | * @return boolean |
423 | 438 | * |
@@ -454,7 +469,6 @@ discard block |
||
454 | 469 | * Extract repository |
455 | 470 | * |
456 | 471 | * @param String $backup_path |
457 | - * @param String $restore_path |
|
458 | 472 | * |
459 | 473 | */ |
460 | 474 | private function extractRepository($backup_path) { |