@@ -38,6 +38,9 @@ |
||
38 | 38 | Git::PERM_WPLUS => ' RW+' |
39 | 39 | ); |
40 | 40 | |
41 | + /** |
|
42 | + * @param string $etc_templates_path |
|
43 | + */ |
|
41 | 44 | public function __construct(Git_Mirror_MirrorDataMapper $data_mapper, $etc_templates_path) { |
42 | 45 | $this->data_mapper = $data_mapper; |
43 | 46 | $template_dirs = array(); |
@@ -43,6 +43,9 @@ discard block |
||
43 | 43 | /** @var ProjectManager */ |
44 | 44 | private $project_manager; |
45 | 45 | |
46 | + /** |
|
47 | + * @param string $gitolite_administration_path |
|
48 | + */ |
|
46 | 49 | public function __construct( |
47 | 50 | Git_Gitolite_ConfigPermissionsSerializer $permissions_serializer, |
48 | 51 | Git_Gitolite_ProjectSerializer $project_serializer, |
@@ -78,6 +81,10 @@ discard block |
||
78 | 81 | return $git_modifications; |
79 | 82 | } |
80 | 83 | |
84 | + /** |
|
85 | + * @param string $old_name |
|
86 | + * @param string $new_name |
|
87 | + */ |
|
81 | 88 | public function renameProject($old_name, $new_name) { |
82 | 89 | $git_modifications = new Git_Gitolite_GitModifications(); |
83 | 90 | $project = $this->project_manager->getProjectByUnixName($new_name); |
@@ -210,11 +217,18 @@ discard block |
||
210 | 217 | return 'conf/'.$hostname; |
211 | 218 | } |
212 | 219 | |
220 | + /** |
|
221 | + * @param string $config_file |
|
222 | + * @param string $config_datas |
|
223 | + */ |
|
213 | 224 | private function writeGitConfig($config_file, $config_datas, Git_Gitolite_GitModifications $git_modifications) { |
214 | 225 | file_put_contents($config_file, $config_datas); |
215 | 226 | $git_modifications->add($config_file); |
216 | 227 | } |
217 | 228 | |
229 | + /** |
|
230 | + * @param string $content |
|
231 | + */ |
|
218 | 232 | private function writeGitoliteConfigurationOnDisk($content, Git_Gitolite_GitModifications $git_modifications) { |
219 | 233 | file_put_contents($this->getGitoliteConfFilePath(), $content); |
220 | 234 | $git_modifications->add(self::GITOLITE_CONF_FILE); |
@@ -250,12 +264,18 @@ discard block |
||
250 | 264 | $git_modifications->add($file_path); |
251 | 265 | } |
252 | 266 | |
267 | + /** |
|
268 | + * @param string $file_path |
|
269 | + */ |
|
253 | 270 | private function proceedRenameInMirrorIncluderConf($hostname, $file_path, $old_name, $new_name) { |
254 | 271 | $orig = file_get_contents($file_path); |
255 | 272 | $dest = str_replace('include "' . $hostname . '/'. $old_name .'.conf"', 'include "'. $hostname .'/'. $new_name .'.conf"', $orig); |
256 | 273 | file_put_contents($file_path, $dest); |
257 | 274 | } |
258 | 275 | |
276 | + /** |
|
277 | + * @param string $file_path |
|
278 | + */ |
|
259 | 279 | private function proceedRenameInIncluderConf($file_path, $old_name, $new_name) { |
260 | 280 | $orig = file_get_contents($file_path); |
261 | 281 | $dest = str_replace('include "projects/'. $old_name .'.conf"', 'include "projects/'. $new_name .'.conf"', $orig); |
@@ -289,6 +309,9 @@ discard block |
||
289 | 309 | $git_modifications->add($original_file); |
290 | 310 | } |
291 | 311 | |
312 | + /** |
|
313 | + * @param string $project_file_path |
|
314 | + */ |
|
292 | 315 | private function proceedToRenameInSpecifiedProjectFile($project_file_path, $old_name, $new_name) { |
293 | 316 | $orig = file_get_contents($project_file_path); |
294 | 317 | |
@@ -317,6 +340,10 @@ discard block |
||
317 | 340 | |
318 | 341 | } |
319 | 342 | |
343 | + /** |
|
344 | + * @param string $old_file |
|
345 | + * @param string $new_file |
|
346 | + */ |
|
320 | 347 | private function proceedToFileMove($old_file, $new_file, Git_Gitolite_GitModifications $git_modifications) { |
321 | 348 | if (is_file($old_file)) { |
322 | 349 | $git_modifications->move($old_file, $new_file); |
@@ -334,6 +361,9 @@ discard block |
||
334 | 361 | $this->proceedToFileMove($old_file, $new_file, $git_modifications); |
335 | 362 | } |
336 | 363 | |
364 | + /** |
|
365 | + * @param string $hostname |
|
366 | + */ |
|
337 | 367 | private function writeGitoliteIncludesInHostnameFile($hostname, Git_Gitolite_GitModifications $git_modifications, array $project_list) { |
338 | 368 | $hostname_config_file = $this->getFullConfigFilePathFromHostname($hostname); |
339 | 369 | |
@@ -370,6 +400,9 @@ discard block |
||
370 | 400 | return $this->readProjectListFromPath($dir_path); |
371 | 401 | } |
372 | 402 | |
403 | + /** |
|
404 | + * @param string $dir_path |
|
405 | + */ |
|
373 | 406 | private function readProjectListFromPath($dir_path) { |
374 | 407 | $project_names = array(); |
375 | 408 |
@@ -37,6 +37,10 @@ |
||
37 | 37 | /** @var BackendService */ |
38 | 38 | private $backend_service; |
39 | 39 | |
40 | + /** |
|
41 | + * @param string $gitolite_var_path |
|
42 | + * @param string $remote_admin_repository |
|
43 | + */ |
|
40 | 44 | public function __construct( |
41 | 45 | SystemEventProcessManager $process_manager, |
42 | 46 | SystemEventProcess $process, |
@@ -42,6 +42,9 @@ |
||
42 | 42 | $this->reference_manager = $reference_manager; |
43 | 43 | } |
44 | 44 | |
45 | + /** |
|
46 | + * @param string $commit_sha1 |
|
47 | + */ |
|
45 | 48 | public function execute(Git_Hook_PushDetails $push_details, $commit_sha1) { |
46 | 49 | $rev_id = $push_details->getRepository()->getFullName().'/'.$commit_sha1; |
47 | 50 | $text = $this->git_exec->catFile($commit_sha1); |
@@ -47,6 +47,9 @@ |
||
47 | 47 | private $user; |
48 | 48 | private $refname; |
49 | 49 | |
50 | + /** |
|
51 | + * @param string $rev_type |
|
52 | + */ |
|
50 | 53 | public function __construct(GitRepository $repository, PFUser $user, $refname, $type, $rev_type, array $revision_list) { |
51 | 54 | $this->repository = $repository; |
52 | 55 | $this->user = $user; |
@@ -20,6 +20,9 @@ discard block |
||
20 | 20 | require_once 'common/dao/include/DataAccessObject.class.php'; |
21 | 21 | class Git_RemoteServer_Dao extends DataAccessObject { |
22 | 22 | |
23 | + /** |
|
24 | + * @param integer $id |
|
25 | + */ |
|
23 | 26 | public function searchById($id) { |
24 | 27 | $id = $this->da->escapeInt($id); |
25 | 28 | $sql = "SELECT * |
@@ -36,6 +39,7 @@ discard block |
||
36 | 39 | /** |
37 | 40 | * This sql request returns for a given project all the servers |
38 | 41 | * where its git repositories are migrated |
42 | + * @param integer $project_id |
|
39 | 43 | */ |
40 | 44 | public function searchAllByProjectId($project_id) { |
41 | 45 | $project_id = $this->da->escapeInt($project_id); |
@@ -46,6 +50,9 @@ discard block |
||
46 | 50 | return $this->retrieve($sql); |
47 | 51 | } |
48 | 52 | |
53 | + /** |
|
54 | + * @param integer $user_id |
|
55 | + */ |
|
49 | 56 | public function searchAllRemoteServersForUserId($user_id) { |
50 | 57 | $sql = "SELECT DISTINCT pgrs.* |
51 | 58 | FROM plugin_git_remote_servers pgrs |
@@ -68,6 +75,10 @@ discard block |
||
68 | 75 | return $this->retrieve($sql); |
69 | 76 | } |
70 | 77 | |
78 | + /** |
|
79 | + * @param integer $project_id |
|
80 | + * @param integer $ugroup_id |
|
81 | + */ |
|
71 | 82 | public function searchAllByUGroupId($project_id, $ugroup_id) { |
72 | 83 | $project_id = $this->da->escapeInt($project_id); |
73 | 84 | $ugroup_id = $this->da->escapeInt($ugroup_id); |
@@ -79,6 +90,12 @@ discard block |
||
79 | 90 | return $this->retrieve($sql); |
80 | 91 | } |
81 | 92 | |
93 | + /** |
|
94 | + * @param string $replication_key |
|
95 | + * @param boolean $use_ssl |
|
96 | + * @param string $gerrit_version |
|
97 | + * @param string $http_password |
|
98 | + */ |
|
82 | 99 | public function save( |
83 | 100 | $id, |
84 | 101 | $host, |
@@ -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, |