summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-11-05 21:44:20 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-11-05 21:44:20 +0100
commit3afe5d1c3420a012163ab6794ff63f68acf37c5e (patch)
treea1256531cd9ccd8c419a0b33100418010a84e141
parent6b06b65228c9fbd6e8e45658458b14a0e8c2cdfc (diff)
downloadrpg-3afe5d1c3420a012163ab6794ff63f68acf37c5e.tar.gz
rpg-3afe5d1c3420a012163ab6794ff63f68acf37c5e.tar.bz2
PHP version check in the installer
darcs-hash:20061105204420-7ad00-2b80d8ceb37b48ccdaa10545ea6fb9bddb58529b.gz
-rw-r--r--inc/infoutils.php4
-rw-r--r--inc/lang/de/lang.php1
-rw-r--r--inc/lang/en/lang.php1
-rw-r--r--install.php12
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
<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.';
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
<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.';
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 <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);