PHP version check in the installer

darcs-hash:20061105204420-7ad00-2b80d8ceb37b48ccdaa10545ea6fb9bddb58529b.gz
This commit is contained in:
Andreas Gohr 2006-11-05 21:44:20 +01:00
parent 6b06b65228
commit 3afe5d1c34
4 changed files with 13 additions and 5 deletions

View File

@ -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{

View File

@ -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
<a href="http://wiki.splitbrain.org/wiki:install">Dokuwiki-Installationsanleitung</a> konsultieren.';
$lang['i_funcna'] = 'Die PHP Funktion <code>%s</code> ist nicht verfügbar. Unter Umständen wurde sie von Ihrem Hoster deaktiviert?';
$lang['i_phpver'] = 'Ihre PHP version <code>%s</code> ist niedriger als die benötigte Version <code>%s</code>. Bitte aktualisieren Sie Ihre PHP Installation.';
$lang['i_permfail'] = '<code>%s</code> ist nicht durch DokuWiki beschreibbar. Sie müssen die Berechtigungen dieses Ordners ändern!';
$lang['i_confexists'] = '<code>%s</code> existiert bereits';
$lang['i_writeerr'] = '<code>%s</code> kontte nicht erzeugt werden. Sie sollten die Verzeichnis/Datei-Rechte überprüfen und die Datei manuell anlegen.';

View File

@ -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
<a href="http://wiki.splitbrain.org/wiki:install">Dokuwiki installation instructions</a>';
$lang['i_funcna'] = 'PHP function <code>%s</code> is not available. Maybe your hosting provider disabled it for some reason?';
$lang['i_phpver'] = 'Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.';
$lang['i_permfail'] = '<code>%s</code> is not writable by DokuWiki. You need to fix the permission settings of this directory!';
$lang['i_confexists'] = '<code>%s</code> already exists';
$lang['i_writeerr'] = 'Unable to create <code>%s</code>. You will need to check directory/file permissions and create the file manually.';

View File

@ -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 <andi@splitbrain.org>
*/
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);