From 43b23197ffc3e1d08a1e08b09dbb31f06692d7ff Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 4 Jul 2014 08:28:22 +0200 Subject: [PATCH 1/1] warn about remote fork config in setup and help --- data/templates/help.htm | 15 +++++++++++++++ src/phorkie/SetupCheck.php | 13 +++++++++++++ www/help.php | 1 + 3 files changed, 29 insertions(+) diff --git a/data/templates/help.htm b/data/templates/help.htm index 555a738..a17aa50 100644 --- a/data/templates/help.htm +++ b/data/templates/help.htm @@ -46,4 +46,19 @@ function registerHandler() { + +

Setup check

+

+ You need to activate public clone URLs in your config file. + Otherwise forking onto remote systems will not work. +

+{% if publicGitUrl %} +
+ OK! A public git URL prefix is configured: {{publicGitUrl}} +
+{% else %} +
+ Error! No public git URL prefix configured. +
+{% endif %} {% endblock %} diff --git a/src/phorkie/SetupCheck.php b/src/phorkie/SetupCheck.php index c459e2a..69cffd8 100644 --- a/src/phorkie/SetupCheck.php +++ b/src/phorkie/SetupCheck.php @@ -39,6 +39,7 @@ class SetupCheck $sc->checkGit(); $sc->checkDatabase(); $sc->checkMimeTypeDetection(); + $sc->checkRemoteForking(); return $sc->messages; } @@ -133,6 +134,18 @@ class SetupCheck } } + public function checkRemoteForking() + { + if (!isset($GLOBALS['phorkie']['cfg']['git']['public']) + || $GLOBALS['phorkie']['cfg']['git']['public'] == '' + ) { + $this->fail( + 'No public git URL prefix configured.' + . ' Remote forking will not work' + ); + } + } + public function fail($msg) { $this->messages[] = array('error', $msg); diff --git a/www/help.php b/www/help.php index fe56c22..8ccdd69 100644 --- a/www/help.php +++ b/www/help.php @@ -10,6 +10,7 @@ render( 'help', array( 'htmlhelper' => new HtmlHelper(), + 'publicGitUrl' => @$GLOBALS['phorkie']['cfg']['git']['public'], ) ); ?> -- 2.30.2