From d66ca934d38a4f5f2f276fc3f5e292f22a0b4a40 Mon Sep 17 00:00:00 2001 From: 1Day Date: Tue, 11 Jan 2022 12:45:36 +0100 Subject: [PATCH] ugh --- public/install/functions.php | 40 ++++++++++++++++++++++++++++++++++++ public/install/index.php | 19 +++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 public/install/functions.php create mode 100644 public/install/index.php diff --git a/public/install/functions.php b/public/install/functions.php new file mode 100644 index 00000000..608a0ff6 --- /dev/null +++ b/public/install/functions.php @@ -0,0 +1,40 @@ +=')){ + return "OK"; + } + return "not OK"; +} + +function getMySQLVersion() { + + $output = shell_exec('mysql -V'); + preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version); + + $versionoutput = $version[0] ?? "0"; + + return ($versionoutput > 5 ? "OK":"not OK");; +} + + +function checkExtensions(){ + global $required_extentions; + $not_ok = []; + $extentions = get_loaded_extensions(); + + foreach($required_extentions as $ext){ + if(!in_array($ext,$extentions)){ + array_push($not_ok,$ext); + } + } + return $not_ok; + +} + +?> \ No newline at end of file diff --git a/public/install/index.php b/public/install/index.php new file mode 100644 index 00000000..e27e1d86 --- /dev/null +++ b/public/install/index.php @@ -0,0 +1,19 @@ +"; + +echo "mysql version: ".getMySQLVersion(); + +echo "
"; + +echo "Missing extentions: "; foreach(checkExtensions() as $ext){ echo $ext.", ";}; + +echo "
"; + +print_r(get_loaded_extensions()); + +?> \ No newline at end of file