summaryrefslogtreecommitdiffstats
path: root/install.php
diff options
context:
space:
mode:
Diffstat (limited to 'install.php')
-rwxr-xr-xinstall.php18
1 files changed, 8 insertions, 10 deletions
diff --git a/install.php b/install.php
index 1dc1837..5dc20bc 100755
--- a/install.php
+++ b/install.php
@@ -3,7 +3,8 @@
require_once __DIR__ . '/app/app.php';
// This is an helper function returning an html table row to avoid code duplication
-function installStatus($str, $msg, $result) {
+function installStatus($str, $msg, $result)
+{
$class = ($result) ? 'ok' : 'fail';
return '<tr><td>' . $str . '</td><td class="' . $class . '">' . $msg . '</td></tr>';
}
@@ -12,7 +13,6 @@ function installStatus($str, $msg, $result) {
if (is_installed()) {
$status = 'installed';
} elseif (isset($_POST['url'])) {
-
// Do no try to use the file of an invalid locale
if (strstr($_POST['locale'], '..') !== false
|| !file_exists(__DIR__ . "/app/l10n/${_REQUEST['locale']}.lang")) {
@@ -39,13 +39,12 @@ if (is_installed()) {
$status = 'installed';
}
} else {
-
// We start by malking sure we have PHP5 as a base requirement
- if(version_compare(PHP_VERSION, '7.2.0') >= 0) {
- $strInstall = installStatus('Server is running at least PHP 7.2', 'OK',true);
+ if (version_compare(PHP_VERSION, '7.2.0') >= 0) {
+ $strInstall = installStatus('Server is running at least PHP 7.2', 'OK', true);
$strRecommendation = '';
} else {
- $strInstall = installStatus('Server is running at least PHP 7.2', 'FAIL',false);
+ $strInstall = installStatus('Server is running at least PHP 7.2', 'FAIL', false);
$strRecommendation = '<li>Check your server documentation to activate at least PHP 7.2</li>';
}
@@ -79,18 +78,17 @@ if (is_installed()) {
// We now test that all required files and directories are writable.
foreach ($tests as $v) {
- if(touch(__DIR__ . $v)) {
+ if (touch(__DIR__ . $v)) {
$strInstall .= installStatus("<code>$v</code> is writable", 'OK', true);
unlink(__DIR__.$v);
} else {
- $strInstall .= installStatus("<code>$v</code> is writable", 'FAIL',false);
+ $strInstall .= installStatus("<code>$v</code> is writable", 'FAIL', false);
$strRecommendation .= "<li>Make <code>$v</code> writable with CHMOD</li>";
}
}
// We can now decide if we install moonmoon or not
$status = ($strRecommendation != '') ? 'error' : 'install';
-
}
-require_once views_path('install.tpl.php'); \ No newline at end of file
+require_once views_path('install.tpl.php');