@@ -68,6 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | + * @param GitRepository $repository |
|
71 | 72 | * @return bool |
72 | 73 | */ |
73 | 74 | public function updateRepoConf($repository) { |
@@ -136,6 +137,9 @@ discard block |
||
136 | 137 | } |
137 | 138 | } |
138 | 139 | |
140 | + /** |
|
141 | + * @param string $key |
|
142 | + */ |
|
139 | 143 | private function getConfigurationParameter($key) { |
140 | 144 | $value = $this->getGitPlugin()->getConfigurationParameter($key); |
141 | 145 | if ($value !== false && $value !== null) { |
@@ -283,7 +287,7 @@ discard block |
||
283 | 287 | * @param Project $project The project to rename |
284 | 288 | * @param string $newName The new name of the project |
285 | 289 | * |
286 | - * @return true if success, false otherwise |
|
290 | + * @return boolean if success, false otherwise |
|
287 | 291 | */ |
288 | 292 | public function renameProject(Project $project, $newName) { |
289 | 293 | if (is_dir($this->driver->getRepositoriesPath() .'/'. $project->getUnixName())) { |
@@ -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) { |
@@ -136,6 +136,9 @@ discard block |
||
136 | 136 | $this->history_dao = $history_dao; |
137 | 137 | } |
138 | 138 | |
139 | + /** |
|
140 | + * @return string |
|
141 | + */ |
|
139 | 142 | protected function getText($key, $params = array()) { |
140 | 143 | return $GLOBALS['Language']->getText('plugin_git', $key, $params); |
141 | 144 | } |
@@ -144,6 +147,10 @@ discard block |
||
144 | 147 | return call_user_func_array(array($this,$action), $params); |
145 | 148 | } |
146 | 149 | |
150 | + /** |
|
151 | + * @param integer $projectId |
|
152 | + * @param integer $repositoryId |
|
153 | + */ |
|
147 | 154 | public function deleteRepository( $projectId, $repositoryId ) { |
148 | 155 | $controller = $this->getController(); |
149 | 156 | $projectId = intval($projectId); |
@@ -232,7 +239,6 @@ discard block |
||
232 | 239 | * |
233 | 240 | * @param Project $project |
234 | 241 | * @param PFUser $user |
235 | - * @param Project[] $parent_projects |
|
236 | 242 | */ |
237 | 243 | public function generateGerritRepositoryAndTemplateList(Project $project, PFUser $user) { |
238 | 244 | $repos = $this->factory->getAllGerritRepositoriesFromProject($project, $user); |
@@ -731,7 +737,6 @@ discard block |
||
731 | 737 | /** |
732 | 738 | * Internal method called by SystemEvent_PROJECT_IS_PRIVATE |
733 | 739 | * @param <type> $projectId |
734 | - * @param <type> $isPublic |
|
735 | 740 | * @return <type> |
736 | 741 | */ |
737 | 742 | public static function changeProjectRepositoriesAccess($projectId, $isPrivate, GitDao $dao, GitRepositoryFactory $factory) { |
@@ -792,12 +797,12 @@ discard block |
||
792 | 797 | /** |
793 | 798 | * Fork a bunch of repositories in a project for a given user |
794 | 799 | * |
795 | - * @param int $groupId The project id |
|
796 | - * @param array $repos_ids The array of id of repositories to fork |
|
800 | + * @param array $repos The array of id of repositories to fork |
|
797 | 801 | * @param string $namespace The namespace where the new repositories will live |
798 | 802 | * @param PFUser $user The owner of those new repositories |
799 | 803 | * @param Layout $response The response object |
800 | 804 | * @param array $forkPermissions Permissions to be applied for the new repository |
805 | + * @param string $redirect_url |
|
801 | 806 | */ |
802 | 807 | public function fork(array $repos, Project $to_project, $namespace, $scope, PFUser $user, Layout $response, $redirect_url, array $forkPermissions) { |
803 | 808 | try { |
@@ -838,7 +843,6 @@ discard block |
||
838 | 843 | * |
839 | 844 | * @param GitRepository $repository |
840 | 845 | * @param int $remote_server_id the id of the server to which we want to migrate |
841 | - * @param Boolean $migrate_access_right if the acess right will be migrated or not |
|
842 | 846 | * @param int $gerrit_template_id the id of template if any chosen |
843 | 847 | */ |
844 | 848 | public function migrateToGerrit(GitRepository $repository, $remote_server_id, $gerrit_template_id) { |
@@ -863,6 +867,9 @@ discard block |
||
863 | 867 | $this->getController()->redirect($this->url_manager->getRepositoryBaseUrl($repository)); |
864 | 868 | } |
865 | 869 | |
870 | + /** |
|
871 | + * @param string $error_key |
|
872 | + */ |
|
866 | 873 | private function addError($error_key) { |
867 | 874 | $this->getController()->addError($this->getText($error_key)); |
868 | 875 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | /** |
116 | 116 | * |
117 | - * @param GitRepository $respository |
|
117 | + * @param GitRepository $repository |
|
118 | 118 | * @return bool |
119 | 119 | */ |
120 | 120 | public function isCreated(GitRepository $repository) { |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * @param Statistics_Formatter $formatter instance of statistics formatter class |
321 | 321 | * @param String $type backend type |
322 | 322 | * @param Array $typeIndex backend type index |
323 | - * @param Array $typeArray backend type array |
|
323 | + * @param string[] $typeArray backend type array |
|
324 | 324 | * @param Boolean $keepedAlive keep only reposirtories that still active |
325 | 325 | * |
326 | 326 | * @return Void |
@@ -69,6 +69,9 @@ discard block |
||
69 | 69 | $this->tableName = $tableName; |
70 | 70 | } |
71 | 71 | |
72 | + /** |
|
73 | + * @param string $id |
|
74 | + */ |
|
72 | 75 | public function exists($id) { |
73 | 76 | if ( empty($id) ) { |
74 | 77 | return false; |
@@ -213,6 +216,9 @@ discard block |
||
213 | 216 | return false; |
214 | 217 | } |
215 | 218 | |
219 | + /** |
|
220 | + * @param string $newName |
|
221 | + */ |
|
216 | 222 | public function renameProject(Project $project, $newName) { |
217 | 223 | $oldPath = $this->da->quoteSmart($project->getUnixName().'/'); |
218 | 224 | $newPath = $this->da->quoteSmart($newName.'/'); |
@@ -284,6 +290,7 @@ discard block |
||
284 | 290 | /** |
285 | 291 | * Return the list of users that owns repositories in the project $projectId |
286 | 292 | * |
293 | + * @param integer $projectId |
|
287 | 294 | * @return DataAccessResult |
288 | 295 | */ |
289 | 296 | public function getProjectRepositoriesOwners($projectId) { |
@@ -298,6 +305,9 @@ discard block |
||
298 | 305 | return $this->retrieve($sql); |
299 | 306 | } |
300 | 307 | |
308 | + /** |
|
309 | + * @param integer $projectId |
|
310 | + */ |
|
301 | 311 | public function getAllGitoliteRespositories($projectId) { |
302 | 312 | $projectId = $this->da->escapeInt($projectId); |
303 | 313 | $type_gitolite = $this->da->quoteSmart(self::BACKEND_GITOLITE); |
@@ -359,6 +369,9 @@ discard block |
||
359 | 369 | return $this->retrieve($query); |
360 | 370 | } |
361 | 371 | |
372 | + /** |
|
373 | + * @param GitRepository $repository |
|
374 | + */ |
|
362 | 375 | public function hasChild($repository) { |
363 | 376 | $repoId = $this->da->escapeInt( $repository->getId() ); |
364 | 377 | if ( empty($repoId) ) { |
@@ -382,9 +395,12 @@ discard block |
||
382 | 395 | * This function log a Git Push in the database |
383 | 396 | * |
384 | 397 | * @param Integer $repoId Id of the git repository |
385 | - * @param Integer $UserId Id of the user that performed the push |
|
398 | + * @param Integer $userId Id of the user that performed the push |
|
386 | 399 | * @param Integer $pushTimestamp Date of the push |
387 | 400 | * @param Integer $commitsNumber Number of commits |
401 | + * @param string $refname |
|
402 | + * @param string $operation_type |
|
403 | + * @param string $refname_type |
|
388 | 404 | * |
389 | 405 | * @return Boolean |
390 | 406 | */ |
@@ -416,6 +432,9 @@ discard block |
||
416 | 432 | return $this->update($query); |
417 | 433 | } |
418 | 434 | |
435 | + /** |
|
436 | + * @param GitRepository $repository |
|
437 | + */ |
|
419 | 438 | public function getProjectRepositoryById($repository) { |
420 | 439 | $id = (int)$repository->getId(); |
421 | 440 | if ( empty($id) ) { |
@@ -449,6 +468,9 @@ discard block |
||
449 | 468 | return $this->retrieve($query); |
450 | 469 | } |
451 | 470 | |
471 | + /** |
|
472 | + * @param integer $id |
|
473 | + */ |
|
452 | 474 | public function searchDeletedRepositoryById($id) { |
453 | 475 | $id = $this->da->escapeInt($id); |
454 | 476 | $query = 'SELECT * '. |
@@ -540,6 +562,10 @@ discard block |
||
540 | 562 | return $this->retrieve($query); |
541 | 563 | } |
542 | 564 | |
565 | + /** |
|
566 | + * @param integer $project_id |
|
567 | + * @param string $path |
|
568 | + */ |
|
543 | 569 | public function isRepositoryExisting($project_id, $path) { |
544 | 570 | $project_id = $this->da->escapeInt($project_id); |
545 | 571 | $path = $this->da->quoteSmart($path); |
@@ -602,6 +628,10 @@ discard block |
||
602 | 628 | return count($this->retrieve($sql)) > 0; |
603 | 629 | } |
604 | 630 | |
631 | + /** |
|
632 | + * @param integer $project_id |
|
633 | + * @param integer[] $ugroup_ids |
|
634 | + */ |
|
605 | 635 | public function searchGerritRepositoriesWithPermissionsForUGroupAndProject($project_id, $ugroup_ids) { |
606 | 636 | $project_id = $this->da->escapeInt($project_id); |
607 | 637 | $ugroup_ids = $this->da->escapeIntImplode($ugroup_ids); |
@@ -621,6 +651,9 @@ discard block |
||
621 | 651 | |
622 | 652 | } |
623 | 653 | |
654 | + /** |
|
655 | + * @param integer $project_id |
|
656 | + */ |
|
624 | 657 | public function searchAllGerritRepositoriesOfProject($project_id) { |
625 | 658 | $project_id = $this->da->escapeInt($project_id); |
626 | 659 | $sql = "SELECT * |
@@ -690,7 +723,7 @@ discard block |
||
690 | 723 | * |
691 | 724 | * @param Int $repository_id |
692 | 725 | * |
693 | - * @return GitDaoException | true |
|
726 | + * @return boolean | true |
|
694 | 727 | */ |
695 | 728 | public function activate($repository_id) { |
696 | 729 | $id = $this->da->escapeInt($repository_id); |
@@ -701,6 +734,9 @@ discard block |
||
701 | 734 | return $this->update($query); |
702 | 735 | } |
703 | 736 | |
737 | + /** |
|
738 | + * @param integer $project_id |
|
739 | + */ |
|
704 | 740 | public function getPaginatedOpenRepositories($project_id, $limit, $offset) { |
705 | 741 | $project_id = $this->da->escapeInt($project_id); |
706 | 742 | $limit = $this->da->escapeInt($limit); |