protected function addProject(Form $form) { $values = $form->getValues(); $matches = array(); if ($values['type'] == "gitlab" && preg_match('`^(.*)@(.*):(.*)/(.*)\\.git`', $values['reference'], $matches)) { $info = array(); $info['user'] = $matches[1]; $info['domain'] = $matches[2]; $values['access_information'] = serialize($info); $values['reference'] = $matches[3] . "/" . $matches[4]; } $values['ssh_private_key'] = $values['key']; $values['ssh_public_key'] = $values['pubkey']; $project = new Project(); $project->setValues($values); $project = $this->projectStore->save($project); header('Location: ' . PHPCI_URL . 'project/view/' . $project->getId()); die; }