* added check for loaded database modules

* added MDB2 to lib check
release-0.6
till 17 years ago
parent 60dd08732a
commit 6b9e4a21aa

@ -61,17 +61,26 @@ define('CHECK_NOK', '<span class="fail">NOT OK</span>');
error_reporting(E_ALL ^E_NOTICE);
$include_path = dirname(__FILE__) . '/program/lib/';
$include_path = dirname(__FILE__) . '/program/lib';
$include_path .= PATH_SEPARATOR;
$include_path .= dirname(__FILE__) . '/program/';
$include_path .= dirname(__FILE__) . '/program';
$include_path .= PATH_SEPARATOR;
$include_path .= get_include_path();
@ini_set('display_errors', 1);
set_include_path($include_path);
$create_files = array('config/db.inc.php', 'config/main.inc.php');
$required_libs = array('PEAR' => 'PEAR.php', 'DB' => 'DB.php', 'Net_SMTP' => 'Net/SMTP.php', 'Mail_mime' => 'Mail/mime.php', 'iilConnection' => 'lib/imap.inc');
$create_files = array('config/db.inc.php', 'config/main.inc.php');
$required_libs = array('PEAR' => 'PEAR.php', 'DB' => 'DB.php',
'Net_SMTP' => 'Net/SMTP.php', 'Mail_mime' => 'Mail/mime.php',
'MDB2' => 'MDB2.php', 'iilConnection' => 'lib/imap.inc');
$supported_drivers = array('MDB2#mysql' => 'MDB2/Driver/mysql.php',
'MDB2#pgsql' => 'MDB2/Driver/pgsql.php', 'MDB2#sqlite' => 'MDB2/Driver/sqlite.php');
$supported_dbs = array('MySQL' => 'mysql', 'MySQLi' => 'mysqli',
'PostgreSQL' => 'pgsql', 'SQLite (v2)' => 'sqlite');
$path = dirname(__FILE__) . '/';
$check = basename(__FILE__);
@ -105,16 +114,37 @@ if ($rctest_config['from'] == '_yourfrom_') {
echo '<i>We do not check if this is a <b>valid</b> email address. Since this serves as from &amp; to, make sure it is correct!</i>';
}
echo '<h3>Checking available databases</h3>';
echo '<p>Checks if the extension is loaded.</p>';
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
foreach ($supported_dbs AS $database => $ext) {
echo "$database: ";
if (extension_loaded($ext)) {
echo CHECK_OK;
} else {
$_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
echo CHECK_NOK;
if (@dl($_ext)) {
echo ' (<i>Could</i> be loaded. Please add in php.ini, if you plan on using it.)';
} else {
echo ' (<b>Not</b> installed.)';
}
}
echo '<br />';
}
echo '<h3>Check for required 3rd party libs</h3>';
echo '<p>This also checks if the include path is set correctly.</p>';
foreach ($required_libs as $classname => $file) {
@include_once $file;
require_once $file;
echo "$classname: ";
if (class_exists($classname))
if (class_exists($classname)) {
echo CHECK_OK;
else
} else {
echo CHECK_NOK . "; Failed to load $file";
}
echo "<br />";
}
@ -360,4 +390,4 @@ if ($rcmail_config['default_host'] == '') {
}
?>
</body>
</html>
</html>

Loading…
Cancel
Save