Переглянути джерело

Be a bit more verbose in the error message about PEAR not being included:
give a pointer as to what might be the problem (also in configtest).
Small cosmetic fixes in configtest.

Thijs Kinkhorst 21 роки тому
батько
коміт
7c3465c148
3 змінених файлів з 17 додано та 7 видалено
  1. 2 0
      functions/abook_database.php
  2. 2 0
      functions/db_prefs.php
  3. 13 7
      src/configtest.php

+ 2 - 0
functions/abook_database.php

@@ -37,8 +37,10 @@ if (!include_once('DB.php')) {
     // same error also in db_prefs.php
     require_once(SM_PATH . 'functions/display_messages.php');
     $error  = _("Could not include PEAR database functions required for the database backend.") . "<br />\n";
+    $error .= _("Is PEAR installed, and is the include path set correctly to find <tt>DB.php</tt>?") . "<br />\n";
     $error .= _("Please contact your system administrator and report this error.");
     error_box($error, $color);
+    exit;
 }
 
 /**

+ 2 - 0
functions/db_prefs.php

@@ -41,8 +41,10 @@ if (!include_once('DB.php')) {
     // same error also in abook_database.php
     require_once(SM_PATH . 'functions/display_messages.php');
     $error  = _("Could not include PEAR database functions required for the database backend.") . "<br />\n";
+    $error .= _("Is PEAR installed, and is the include path set correctly to find <tt>DB.php</tt>?") . "<br />\n";
     $error .= _("Please contact your system administrator and report this error.");
     error_box($error, $color);
+    exit;
 }
 
 global $prefs_are_cached, $prefs_cache;

+ 13 - 7
src/configtest.php

@@ -70,9 +70,11 @@ if(!in_array('strings.php', $included)) {
 
 /* checking PHP specs */
 
-echo '<p>SquirrelMail version: '.$version.'<br />'.
-     'Config file version: '.$config_version . '<br />'.
-     'Config file last modified: '.date ('d F Y H:i:s', filemtime(SM_PATH . 'config/config.php')).'</p>';
+echo "<p><table>\n<tr><td>SquirrelMail version:</td><td><b>" . $version . "</b></td></tr>\n" .
+     '<tr><td>Config file version:</td><td><b>' . $config_version . "</b></td></tr>\n" .
+     '<tr><td>Config file last modified:</td><td><b>' . 
+         date ('d F Y H:i:s', filemtime(SM_PATH . 'config/config.php')) .
+         "</b></td></tr>\n</table>\n</p>\n\n";
 
 echo "Checking PHP configuration...<br />\n";
 
@@ -80,7 +82,7 @@ if(!check_php_version(4,1,0)) {
     do_err('Insufficient PHP version: '. PHP_VERSION . '! Minimum required: 4.1.0');
 }
 
-echo $IND . 'PHP version '.PHP_VERSION.' OK.<br />';
+echo $IND . 'PHP version ' . PHP_VERSION . " OK.<br />\n";
 
 $php_exts = array('session','pcre');
 $diff = array_diff($php_exts, get_loaded_extensions());
@@ -88,7 +90,7 @@ if(count($diff)) {
     do_err('Required PHP extensions missing: '.implode(', ',$diff) );
 }
 
-echo $IND . 'PHP extensions OK.<br />';
+echo $IND . "PHP extensions OK.<br />\n";
 
 
 /* checking paths */
@@ -236,7 +238,7 @@ fclose($stream);
 echo $IND . 'IMAP server OK (<tt><small>'.
     htmlspecialchars(trim($imapline))."</small></tt>)<br />\n";
 
-echo "Checking internationalization (i18n) settings:<br />\n";
+echo "Checking internationalization (i18n) settings...<br />\n";
 echo "$IND gettext - ";
 if (function_exists('gettext')) {
     echo "Gettext functions are available. You must have appropriate system locales compiled.<br />\n";
@@ -325,7 +327,9 @@ if($addrbook_dsn || $prefs_dsn || $addrbook_global_dsn) {
 		}
             }
 	} else {
-	    do_err('Required PHP Pear DB support is not available.');;
+	    do_err('Required PHP PEAR DB support is not available. Is PEAR installed and is the
+	    	include path set correctly to find <tt>DB.php</tt>? The include path is now:
+		"<tt>' . ini_get('include_path') . '</tt>".');
 	}
 } else {
     echo $IND."not using database functionality.<br />\n";
@@ -338,3 +342,5 @@ if($addrbook_dsn || $prefs_dsn || $addrbook_global_dsn) {
 
 </body>
 </html>
+<?php
+// vim: et ts=4