From 2566ae9fd4ae5fd3dbbfcfba0b6fda8747c36801 Mon Sep 17 00:00:00 2001 From: Thomas Nilsen Date: Thu, 8 Nov 2018 14:04:44 +0100 Subject: [PATCH 1/3] Add prerequisite checks to install script. - Pryx/server-status#31 --- install.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/install.php b/install.php index 426db4e..ccd06d8 100644 --- a/install.php +++ b/install.php @@ -2,6 +2,7 @@ require_once("template.php"); define("WEB_URL", "."); //Website name define("NAME", _('Status page')); //Website name +define("MINIMUM_PHP_VERSION", "5.4.0"); require_once("classes/locale-negotiator.php"); $negotiator = new LocaleNegotiator("en_GB"); @@ -138,6 +139,47 @@ if(isset($_POST['server']) && empty($message)) } Template::render_header(_("Install")); ?> +

+ + MINIMUM_PHP_VERSION + if (strnatcmp(phpversion(), MINIMUM_PHP_VERSION) >= 0) { $preq_phpver = $preq_ok; } + + // Check if we have mysqlnd installed + if ( function_exists('mysqli_get_client_stats') ) { $preq_mysqlnd = $preq_ok; } + + // Check if we have access to write to location + if ( is_writable(__DIR__) ) { $preq_writedir = $preq_ok; } + +?> +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+

Date: Thu, 8 Nov 2018 14:15:20 +0100 Subject: [PATCH 2/3] Add option to use existing URL for privacy policy. Pryx/server-status#41 - Also moved the gitbug icon to the left of the footer as it looked like it was part of the imprint/policy link. - Fixed Imprint & Privacy policy text so that it will be translated. --- config.php.template | 1 + install.php | 9 +++++++++ template.php | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/config.php.template b/config.php.template index cb94726..0e571ab 100644 --- a/config.php.template +++ b/config.php.template @@ -12,6 +12,7 @@ define("ADDRESS", "##address##"); define("POLICY_MAIL", "##policy_mail##"); //contact email in policy define("POLICY_PHONE", "##policy_phone##"); define("WHO_WE_ARE","##who_we_are##"); +define("POLICY_URL","##policy_url##"); define("INSTALL_OVERRIDE", false); define("DEFAULT_LANGUAGE", "en_GB"); diff --git a/install.php b/install.php index ccd06d8..1caa85b 100644 --- a/install.php +++ b/install.php @@ -3,6 +3,7 @@ require_once("template.php"); define("WEB_URL", "."); //Website name define("NAME", _('Status page')); //Website name define("MINIMUM_PHP_VERSION", "5.4.0"); +define("POLICY_URL", "policy.php"); //Default policy URL require_once("classes/locale-negotiator.php"); $negotiator = new LocaleNegotiator("en_GB"); @@ -127,6 +128,8 @@ if(isset($_POST['server']) && empty($message)) $config = str_replace("##policy_mail##", $_POST['policy_mail'], $config); $config = str_replace("##policy_phone##", $_POST['policy_phone'],$config); $config = str_replace("##who_we_are##", $_POST['who_we_are'], $config); + $policy_url_conf = ( ! empty($_POST['policy_url']) ) ? $_POST['policy_url'] : POLICY_URL; + $config = str_replace("##policy_url##", $policy_url_conf, $config); file_put_contents("config.php", $config); @@ -239,6 +242,12 @@ if (!empty($message))
+
+
+ + " class="form-control"> +
+

diff --git a/template.php b/template.php index b5177d9..782f19e 100644 --- a/template.php +++ b/template.php @@ -138,7 +138,7 @@ class Template{
-
Copyright © Vojtěch Sajdl
+
 Copyright © Vojtěch Sajdl
@@ -157,7 +157,7 @@ class Template{
- +
From 361c961d148e57aa0e59bcdbca3440899b5986b1 Mon Sep 17 00:00:00 2001 From: Thomas Nilsen Date: Wed, 21 Nov 2018 11:38:57 +0100 Subject: [PATCH 3/3] Added comment to mysqlnd checks for future reference --- install.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install.php b/install.php index 1caa85b..2c1b407 100644 --- a/install.php +++ b/install.php @@ -158,7 +158,10 @@ Template::render_header(_("Install")); // Check if PHP version if > MINIMUM_PHP_VERSION if (strnatcmp(phpversion(), MINIMUM_PHP_VERSION) >= 0) { $preq_phpver = $preq_ok; } - // Check if we have mysqlnd installed + // Test for mysqlnd precense. The mysqlnd driver provides some extra functions that is not available + // if the plain mysql package is installed, and mysqli_get_client_stats is one of them. This is documented + // on the PHP site at http://www.php.net/manual/en/mysqlnd.stats.php + // This test is also discussed at https://stackoverflow.com/questions/1475701/how-to-know-if-mysqlnd-is-the-active-driver if ( function_exists('mysqli_get_client_stats') ) { $preq_mysqlnd = $preq_ok; } // Check if we have access to write to location