Merge branch 'project-type-fix'

This commit is contained in:
Dmitry Khomutov 2018-03-08 16:03:54 +07:00
commit a8583ff2a7
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
17 changed files with 63 additions and 63 deletions

View file

@ -427,20 +427,20 @@ class ProjectController extends PHPCensor\Controller
$form->addField(new Form\Element\Hidden('pubkey'));
$options = [
'choose' => Lang::get('select_repository_type'),
'github' => 'GitHub',
'bitbucket' => 'Bitbucket (Git)',
'bitbuckethg' => 'Bitbucket (Hg)',
'gitlab' => 'GitLab',
'gogs' => 'Gogs',
'remote' => 'Git',
'local' => Lang::get('local'),
'hg' => 'Mercurial (Hg)',
'svn' => 'SVN',
'choose' => Lang::get('select_repository_type'),
'github' => 'GitHub',
'bitbucket' => 'Bitbucket (Git)',
'bitbucket-hg' => 'Bitbucket (Hg)',
'gitlab' => 'GitLab',
'gogs' => 'Gogs',
'git' => 'Git',
'local' => Lang::get('local'),
'hg' => 'Hg (Mercurial)',
'svn' => 'Svn (Subversion)',
];
$field = Form\Element\Select::create('type', Lang::get('where_hosted'), true);
$field->setPattern('^(github|bitbucket|bitbuckethg|gitlab|gogs|remote|local|hg|svn)');
$field->setPattern('^(github|bitbucket|bitbucket-hg|gitlab|gogs|git|local|hg|svn)');
$field->setOptions($options);
$field->setClass('form-control')->setContainerClass('form-group');
$form->addField($field);
@ -541,11 +541,11 @@ class ProjectController extends PHPCensor\Controller
$validators = [
'hg' => [
'regex' => '/^(ssh|https?):\/\//',
'message' => Lang::get('error_mercurial')
'message' => Lang::get('error_hg')
],
'remote' => [
'git' => [
'regex' => '/^(git|https?):\/\//',
'message' => Lang::get('error_remote')
'message' => Lang::get('error_git')
],
'gitlab' => [
'regex' => '`^(.*)@(.*):(.*)/(.*)\.git`',
@ -559,7 +559,7 @@ class ProjectController extends PHPCensor\Controller
'regex' => '/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-\.]+$/',
'message' => Lang::get('error_bitbucket')
],
'bitbuckethg' => [
'bitbucket-hg' => [
'regex' => '/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-\.]+$/',
'message' => Lang::get('error_bitbucket')
],

View file

@ -82,7 +82,7 @@ class WebhookController extends Controller
*/
public function bitbucket($projectId)
{
$project = $this->fetchProject($projectId, ['bitbucket', 'bitbuckethg', 'remote']);
$project = $this->fetchProject($projectId, ['bitbucket', 'bitbucket-hg', 'hg', 'git']);
// Support both old services and new webhooks
if ($payload = $this->getParam('payload')) {
@ -272,7 +272,7 @@ class WebhookController extends Controller
*/
public function git($projectId)
{
$project = $this->fetchProject($projectId, ['local', 'remote']);
$project = $this->fetchProject($projectId, ['local', 'git']);
$branch = $this->getParam('branch', $project->getBranch());
$commit = $this->getParam('commit');
$commitMessage = $this->getParam('message');
@ -294,7 +294,7 @@ class WebhookController extends Controller
*/
public function github($projectId)
{
$project = $this->fetchProject($projectId, ['github', 'remote']);
$project = $this->fetchProject($projectId, ['github', 'git']);
switch ($_SERVER['CONTENT_TYPE']) {
case 'application/json':
@ -475,7 +475,7 @@ class WebhookController extends Controller
*/
public function gitlab($projectId)
{
$project = $this->fetchProject($projectId, ['gitlab', 'remote']);
$project = $this->fetchProject($projectId, ['gitlab', 'git']);
$payloadString = file_get_contents("php://input");
$payload = json_decode($payloadString, true);
@ -568,7 +568,7 @@ class WebhookController extends Controller
*/
public function gogs($projectId)
{
$project = $this->fetchProject($projectId, ['gogs', 'remote']);
$project = $this->fetchProject($projectId, ['gogs', 'git']);
switch ($_SERVER['CONTENT_TYPE']) {
case 'application/json':
$payload = json_decode(file_get_contents('php://input'), true);

View file

@ -90,7 +90,7 @@ i din foretrukne hosting-platform.',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Ekstern URL',
'git' => 'Git',
'local' => 'Lokalt filsystem',
'hg' => 'Mercurial',
@ -109,8 +109,8 @@ i din foretrukne hosting-platform.',
'archived_menu' => 'Archived',
'save_project' => 'Gem Projekt',
'error_mercurial' => 'Mercurial repository-URL skal starte med http:// eller https://',
'error_remote' => 'Repository-URL skal starte med git://, http:// eller https://',
'error_hg' => 'Mercurial repository-URL skal starte med http:// eller https://',
'error_git' => 'Repository-URL skal starte med git://, http:// eller https://',
'error_gitlab' => 'GitLab repository-navn skal være i formatet "user@domæne.tld:ejernavn/repositorynavn.git"',
'error_github' => 'Repository-navn skal være i formatet "ejernavn/repositorynavn"',
'error_bitbucket' => 'Repository-navn skal være i formatet "ejernavn/repositorynavn"',

View file

@ -91,7 +91,7 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Externe URL',
'git' => 'Git',
'local' => 'Lokaler Pfad',
'hg' => 'Mercurial',
'svn' => 'Subversion',
@ -111,8 +111,8 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab
'archived_menu' => 'Archiviert',
'save_project' => 'Projekt speichern',
'error_mercurial' => 'Mercurial Repository-URL muss mit http://, oder https:// beginnen',
'error_remote' => 'Repository-URL muss mit git://, http://, oder https:// beginnen',
'error_hg' => 'Mercurial Repository-URL muss mit http://, oder https:// beginnen',
'error_git' => 'Repository-URL muss mit git://, http://, oder https:// beginnen',
'error_gitlab' => 'GitLab Repositoryname muss im Format "user@domain.tld:owner/repo.git" sein',
'error_github' => 'Repositoryname muss im Format "besitzer/repo" sein',
'error_bitbucket' => 'Repositoryname muss im Format "besitzer/repo" sein',

View file

@ -91,7 +91,7 @@ PHP Censor',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Απομακρυσμένη διεύθυνση URL',
'git' => 'Git',
'local' => 'Τοπική Διαδρομή',
'hg' => 'Ευμετάβλητο',
@ -110,8 +110,8 @@ PHP Censor',
'archived_menu' => 'Archived',
'save_project' => 'Αποθήκευση έργου',
'error_mercurial' => 'Ο σύνδεσμος URL του ευμετάβλητου αποθετηρίου πρέπει να ξεκινάει με http:// ή https://',
'error_remote' => 'Ο σύνδεσμος URL του αποθετηρίου πρέπει να ξεκινάει με git://, http:// ή https://',
'error_hg' => 'Ο σύνδεσμος URL του ευμετάβλητου αποθετηρίου πρέπει να ξεκινάει με http:// ή https://',
'error_git' => 'Ο σύνδεσμος URL του αποθετηρίου πρέπει να ξεκινάει με git://, http:// ή https://',
'error_gitlab' => 'Το όνομα του αποθετηρίου GitLab πρέπει να είναι της μορφής "user@domain.tld:owner/repo.git"',
'error_github' => 'Το όνομα του αποθετηρίου θα πρέπει να είναι της μορφής "owner/repo" ιδιοκτήτης/αποθετήριο',
'error_bitbucket' => 'Το όνομα του αποθετηρίου θα πρέπει να είναι της μορφής "owner/repo" ιδιοκτήτης/αποθετήριο',

View file

@ -103,7 +103,7 @@ PHP Censor',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Remote URL',
'git' => 'Git',
'local' => 'Local Path',
'hg' => 'Mercurial',
'svn' => 'Subversion',
@ -125,8 +125,8 @@ PHP Censor',
'save_project' => 'Save Project',
'environments_label' => 'Environments (yaml)',
'error_mercurial' => 'Mercurial repository URL must be start with http:// or https://',
'error_remote' => 'Repository URL must be start with git://, http:// or https://',
'error_hg' => 'Mercurial repository URL must be start with http:// or https://',
'error_git' => 'Repository URL must be start with git://, http:// or https://',
'error_gitlab' => 'GitLab Repository name must be in the format "user@domain.tld:owner/repo.git"',
'error_github' => 'Repository name must be in the format "owner/repo"',
'error_bitbucket' => 'Repository name must be in the format "owner/repo"',

View file

@ -90,7 +90,7 @@ PHP Censor',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'URL Remota',
'git' => 'Git',
'local' => 'Path local',
'hg' => 'Mercurial',
'svn' => 'Subversion',
@ -110,8 +110,8 @@ PHP Censor',
'archived_menu' => 'Archivado',
'save_project' => 'Guardar Proyecto',
'error_mercurial' => 'La URL del repositorio de Mercurial debe comenzar con http:// or https://',
'error_remote' => 'La URL del repositorio debe comenzar con git://, http:// or https://',
'error_hg' => 'La URL del repositorio de Mercurial debe comenzar con http:// or https://',
'error_git' => 'La URL del repositorio debe comenzar con git://, http:// or https://',
'error_gitlab' => 'El nombre del repositorio de GitLab debe tener el formato "user@domain.tld:owner/repo.git"',
'error_github' => 'El nombre del repositorio debe tener el formato "owner/repo"',
'error_bitbucket' => 'El nombre del repo debe tener el formato "owner/repo"',

View file

@ -97,7 +97,7 @@ PHP Censor',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'URL distante',
'git' => 'Git',
'local' => 'Chemin local',
'hg' => 'Mercurial',
'svn' => 'Subversion',
@ -117,8 +117,8 @@ PHP Censor',
'archived_menu' => 'Archivé',
'save_project' => 'Enregistrer le projet',
'error_mercurial' => 'Les URLs de dépôt Mercurial doivent commencer par http:// ou https://',
'error_remote' => 'Les URLs de dépôt doivent commencer par git://, http:// ou https://',
'error_hg' => 'Les URLs de dépôt Mercurial doivent commencer par http:// ou https://',
'error_git' => 'Les URLs de dépôt doivent commencer par git://, http:// ou https://',
'error_gitlab' => 'Le nom du dépôt GitLab doit avoir le format "user@domain.tld:owner/repo.git"',
'error_github' => 'Le nom du dépôt doit être dans le format "proprietaire/dépôt"',
'error_bitbucket' => 'Le nom du dépôt doit être dans le format "proprietaire/dépôt"',

View file

@ -89,7 +89,7 @@ PHP Censor',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'URL Remoto',
'git' => 'Git',
'local' => 'Percorso Locale',
'hg' => 'Mercurial',
@ -108,12 +108,11 @@ PHP Censor',
'archived_menu' => 'Archived',
'save_project' => 'Salva il Progetto',
'error_mercurial' => 'L\'URL del repository Mercurial URL deve iniziare con http:// o https://',
'error_remote' => 'L\'URL del repository deve iniziare con git://, http:// o https://',
'error_hg' => 'L\'URL del repository Mercurial URL deve iniziare con http:// o https://',
'error_git' => 'L\'URL del repository deve iniziare con git://, http:// o https://',
'error_gitlab' => 'Il nome del repository di GitLab deve essere nel seguente formato "utente@dominio.tld:proprietario/repository.git"',
'error_github' => 'Il nome del repository deve essere nel formato "proprietario/repository"',
'error_bitbucket' => 'Il nome del repository deve essere nel formato "proprietario/repository"',
'error_path' => 'The path you specified does not exist.',
'error_path' => 'Il percorso che hai indicato non esiste.',
// View Project:

View file

@ -91,7 +91,7 @@ van je gekozen source code hosting platform',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Externe URL',
'git' => 'Git',
'local' => 'Lokaal pad',
'hg' => 'Mercurial',
@ -110,8 +110,8 @@ van je gekozen source code hosting platform',
'archived_menu' => 'Archived',
'save_project' => 'Project opslaan',
'error_mercurial' => 'Mercurial repository URL dient te starten met http:// of https://',
'error_remote' => 'Repository URL dient te starten met git://, http:// of https://',
'error_hg' => 'Mercurial repository URL dient te starten met http:// of https://',
'error_git' => 'Repository URL dient te starten met git://, http:// of https://',
'error_gitlab' => 'GitLab repository naam dient in het formaat "gebruiker@domain.tld/eigenaar/repo.git" te zijn',
'error_github' => 'Repository naam dient in het formaat "eigenaar/repo" te zijn',
'error_bitbucket' => 'Repository naam dient in het formaat "eigenaar/repo" te zijn',

View file

@ -91,7 +91,7 @@ od wybranego kodu źródłowego platformy hostingowej.',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Zdalny URL ',
'git' => 'Git',
'local' => 'Lokalna Ścieżka ',
'hg' => 'Mercurial',
'svn' => 'Subversion',
@ -111,8 +111,8 @@ od wybranego kodu źródłowego platformy hostingowej.',
'archived_menu' => 'W archiwum',
'save_project' => 'Zachowaj Projekt',
'error_mercurial' => 'URL repozytorium Mercurialnego powinno zaczynać się od http:// and https://',
'error_remote' => 'URL repozytorium powinno zaczynać się od git://, http:// lub https://',
'error_hg' => 'URL repozytorium Mercurialnego powinno zaczynać się od http:// and https://',
'error_git' => 'URL repozytorium powinno zaczynać się od git://, http:// lub https://',
'error_gitlab' => 'Nazwa Repozytorium GitLab powinna być w następującym formacie: "user@domain.tld:owner/repo.git"',
'error_github' => 'Nazwa repozytorium powinna być w formacie: "użytkownik/repo"',
'error_bitbucket' => 'Nazwa repozytorium powinna być w formacie: " użytkownik/repo\'',

View file

@ -88,7 +88,7 @@ PHP Censor',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Remote URL',
'git' => 'Git',
'local' => 'Local Path',
'hg' => 'Mercurial',
'svn' => 'Subversion',
@ -108,8 +108,8 @@ PHP Censor',
'archived_menu' => 'Arquivado',
'save_project' => 'Salvar Projeto',
'error_mercurial' => 'Mercurial repository URL must be start with http:// or https://',
'error_remote' => 'Repository URL must be start with git://, http:// or https://',
'error_hg' => 'Mercurial repository URL must be start with http:// or https://',
'error_git' => 'Repository URL must be start with git://, http:// or https://',
'error_gitlab' => 'GitLab Repository name must be in the format "user@domain.tld:owner/repo.git"',
'error_github' => 'Repository name must be in the format "owner/repo"',
'error_bitbucket' => 'Repository name must be in the format "owner/repo"',

View file

@ -99,7 +99,7 @@ PHP Censor',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Внешний URL',
'git' => 'Git',
'local' => 'Локальный путь',
'hg' => 'Mercurial',
'svn' => 'Subversion',
@ -121,8 +121,8 @@ PHP Censor',
'save_project' => 'Сохранить проект',
'environments_label' => 'Окружения (yaml)',
'error_mercurial' => 'URL репозитория Mercurial должен начинаться с http:// или https://',
'error_remote' => 'URL репозитория должен начинаться с git://, http:// или https://',
'error_hg' => 'URL репозитория Mercurial должен начинаться с http:// или https://',
'error_git' => 'URL репозитория должен начинаться с git://, http:// или https://',
'error_gitlab' => 'Имя репозитория в GitLab должно иметь формат: "user@domain.tld:owner/repo.git"',
'error_github' => 'Имя репозитория должно иметь формат: "owner/repo"',
'error_bitbucket' => 'Имя репозитория должно иметь формат: "owner/repo"',

View file

@ -90,7 +90,7 @@ PHP Censor',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Віддалений URL',
'git' => 'Git',
'local' => 'Локальний шлях',
'hg' => 'Mercurial',
@ -109,8 +109,8 @@ PHP Censor',
'archived_menu' => 'Архів',
'save_project' => 'Зберегти проект',
'error_mercurial' => 'URL репозиторію Mercurial повинен починатись із http:// або https://',
'error_remote' => 'URL репозиторію повинен починатись із git://, http:// або https://',
'error_hg' => 'URL репозиторію Mercurial повинен починатись із http:// або https://',
'error_git' => 'URL репозиторію повинен починатись із git://, http:// або https://',
'error_gitlab' => 'Ім’я репозиторія GitLab повинно бути у форматі "user@domain.tld:owner/repo.git"',
'error_github' => 'Ім’я репозиторія повинно відповідати формату "owner/repo"',
'error_bitbucket' => 'Ім’я репозиторія повинно відповідати формату "owner/repo"',

View file

@ -88,7 +88,7 @@ PHP Censor',
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'remote' => 'Remote URL',
'git' => 'Git',
'local' => 'Local Path',
'hg' => 'Mercurial',
'svn' => 'Subversion',
@ -108,8 +108,8 @@ PHP Censor',
'archived_menu' => '归档',
'save_project' => '保存项目',
'error_mercurial' => 'Mercurial 仓库 URL 必须以 http:// or https:// 开始',
'error_remote' => '仓库 URL 必须以 git://, http:// or https:// 开始',
'error_hg' => 'Mercurial 仓库 URL 必须以 http:// or https:// 开始',
'error_git' => '仓库 URL 必须以 git://, http:// or https:// 开始',
'error_gitlab' => 'GitLab 仓库名称必须符合 "user@domain.tld:owner/repo.git" 格式',
'error_github' => '仓库名称必须符合 "owner/repo" 格式',
'error_bitbucket' => '仓库名称必须符合 "owner/repo" 格式',

View file

@ -694,12 +694,13 @@ class Project extends Model
break;
case 'bitbucket':
case 'bitbuckethg':
case 'bitbucket-hg':
$icon = 'bitbucket';
break;
case 'remote':
case 'git':
case 'gitlab':
case 'gogs':
default:
$icon = 'code-fork';
break;

View file

@ -185,7 +185,7 @@ use PHPCensor\Helper\Lang;
break;
case 'bitbucket':
case 'bitbuckethg':
case 'bitbucket-hg':
$url = APP_URL . 'webhook/bitbucket/' . $project->getId();
Lang::out('webhooks_help_bitbucket', $project->getReference());
break;