Example #1
0
 /**
  * Fork a bunch of repositories in a project for a given user
  * 
  * @param int    $groupId   The project id
  * @param array  $repos_ids The array of id of repositories to fork
  * @param string $namespace The namespace where the new repositories will live
  * @param User   $user      The owner of those new repositories
  * @param Layout $response  The response object
  */
 public function fork(array $repos, Project $to_project, $namespace, $scope, User $user, Layout $response, $redirect_url)
 {
     try {
         if ($this->manager->forkRepositories($repos, $to_project, $user, $namespace, $scope)) {
             $GLOBALS['Response']->addFeedback('info', $this->getText('successfully_forked'));
             $response->redirect($redirect_url);
         }
     } catch (Exception $e) {
         $GLOBALS['Response']->addFeedback('error', $e->getMessage());
     }
 }
Example #2
0
 /**
  * Fork a bunch of repositories in a project for a given user
  *
  * @param int    $groupId         The project id
  * @param array  $repos_ids       The array of id of repositories to fork
  * @param string $namespace       The namespace where the new repositories will live
  * @param PFUser   $user            The owner of those new repositories
  * @param Layout $response        The response object
  * @param array  $forkPermissions Permissions to be applied for the new repository
  */
 public function fork(array $repos, Project $to_project, $namespace, $scope, PFUser $user, Layout $response, $redirect_url, array $forkPermissions)
 {
     try {
         if ($this->manager->forkRepositories($repos, $to_project, $user, $namespace, $scope, $forkPermissions)) {
             $this->history_dao->groupAddHistory("git_fork_repositories", $to_project->getID(), $to_project->getID());
             $GLOBALS['Response']->addFeedback('info', $this->getText('successfully_forked'));
             $response->redirect($redirect_url);
         }
     } catch (Exception $e) {
         $GLOBALS['Response']->addFeedback('error', $e->getMessage());
     }
 }