From 3afe5d1c3420a012163ab6794ff63f68acf37c5e Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 5 Nov 2006 21:44:20 +0100 Subject: PHP version check in the installer darcs-hash:20061105204420-7ad00-2b80d8ceb37b48ccdaa10545ea6fb9bddb58529b.gz --- inc/infoutils.php | 4 ++-- inc/lang/de/lang.php | 1 + inc/lang/en/lang.php | 1 + install.php | 12 +++++++++--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/inc/infoutils.php b/inc/infoutils.php index cdfe49dfd..780a46891 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -81,8 +81,8 @@ function check(){ msg('DokuWiki version: '.getVersion(),1); - if(version_compare(phpversion(),'4.3.0','<')){ - msg('Your PHP version is too old ('.phpversion().' vs. 4.3.+ recommended)',-1); + if(version_compare(phpversion(),'4.3.3','<')){ + msg('Your PHP version is too old ('.phpversion().' vs. 4.3.3+ recommended)',-1); }elseif(version_compare(phpversion(),'4.3.10','<')){ msg('Consider upgrading PHP to 4.3.10 or higher for security reasons (your version: '.phpversion().')',0); }else{ diff --git a/inc/lang/de/lang.php b/inc/lang/de/lang.php index 61fa8f5b8..58ca0c8dc 100644 --- a/inc/lang/de/lang.php +++ b/inc/lang/de/lang.php @@ -211,6 +211,7 @@ $lang['i_modified'] = 'Aus Sicherheitsgründen arbeitet dieses Script nur mit Sie sollten entweder alle Dateien noch einmal frisch installieren oder die Dokuwiki-Installationsanleitung konsultieren.'; $lang['i_funcna'] = 'Die PHP Funktion %s ist nicht verfügbar. Unter Umständen wurde sie von Ihrem Hoster deaktiviert?'; +$lang['i_phpver'] = 'Ihre PHP version %s ist niedriger als die benötigte Version %s. Bitte aktualisieren Sie Ihre PHP Installation.'; $lang['i_permfail'] = '%s ist nicht durch DokuWiki beschreibbar. Sie müssen die Berechtigungen dieses Ordners ändern!'; $lang['i_confexists'] = '%s existiert bereits'; $lang['i_writeerr'] = '%s kontte nicht erzeugt werden. Sie sollten die Verzeichnis/Datei-Rechte überprüfen und die Datei manuell anlegen.'; diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index 924c4c8d3..2a28b720a 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -206,6 +206,7 @@ $lang['i_modified'] = 'For security reasons this script will only work with a You should either re-extract the files from the downloaded package or consult the complete Dokuwiki installation instructions'; $lang['i_funcna'] = 'PHP function %s is not available. Maybe your hosting provider disabled it for some reason?'; +$lang['i_phpver'] = 'Your PHP version %s is lower than the needed %s. You need to upgrade your PHP install.'; $lang['i_permfail'] = '%s is not writable by DokuWiki. You need to fix the permission settings of this directory!'; $lang['i_confexists'] = '%s already exists'; $lang['i_writeerr'] = 'Unable to create %s. You will need to check directory/file permissions and create the file manually.'; diff --git a/install.php b/install.php index 33594e491..c9809c937 100644 --- a/install.php +++ b/install.php @@ -310,7 +310,7 @@ EOT; $output .= "* @ALL 8\n"; } - $output .= "* @admin 255\n"; + $output .= "* @admin 255\n"; $ok = $ok && fileWrite(DOKU_LOCAL.'acl.auth.php', $output); } return $ok; @@ -409,13 +409,20 @@ function check_permissions(){ } /** - * Check the availability of functions used in DokuWiki + * Check the availability of functions used in DokuWiki and the PHP version * * @author Andreas Gohr */ function check_functions(){ global $error; global $lang; + $ok = true; + + if(version_compare(phpversion(),'4.3.3','<')){ + $error[] = sprintf($lang['i_phpver'],phpversion(),'4.3.3'); + $ok = false; + } + $funcs = explode(' ','addslashes basename call_user_func chmod copy fgets '. 'file file_exists fseek flush filesize ftell fopen '. 'glob header ignore_user_abort ini_get mail mkdir '. @@ -427,7 +434,6 @@ function check_functions(){ $funcs[] = 'utf8_decode'; } - $ok = true; foreach($funcs as $func){ if(!function_exists($func)){ $error[] = sprintf($lang['i_funcna'],$func); -- cgit v1.2.3