X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fconfigtest.php;h=967ac11a05969ecd322c338da7370e744d5ebca7;hb=d1c87b1266294a58aac6e65d95c9ab34d1553de8;hp=431904bc072f64324f0f8d2875ec338dcca6ceb4;hpb=dc528046c09b177b3f7bdc55c3540c91383d7730;p=squirrelmail.git diff --git a/src/configtest.php b/src/configtest.php index 431904bc..967ac11a 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -275,7 +275,14 @@ if(count($diff)) { do_err('Required PHP extensions missing: '.implode(', ',$diff) ); } -echo $IND . "PHP extensions OK.
\n"; +echo $IND . "PHP extensions OK. Dynamic loading is "; + +if (!(bool)ini_get('enable_dl') || (bool)ini_get('safe_mode')) { + echo "disabled.
\n"; +} else { + echo "enabled.
\n"; +} + /* dangerous php settings */ /** @@ -866,22 +873,28 @@ if($addrbook_dsn || $prefs_dsn || $addrbook_global_dsn) { foreach($dsns as $type => $dsn) { $aDsn = explode(':', $dsn); $dbtype = array_shift($aDsn); + if(isset($db_functions[$dbtype]) && function_exists($db_functions[$dbtype])) { echo "$IND$dbtype database support present.
\n"; + } elseif(!(bool)ini_get('enable_dl') || (bool)ini_get('safe_mode')) { + do_err($dbtype.' database support not present!'); + } else { + // Non-fatal error + do_err($dbtype.' database support not present or not configured! + Trying to dynamically load '.$dbtype.' extension. + Please note that it is advisable to not rely on dynamic loading of extensions.', FALSE); + } - // now, test this interface: - $dbh = DB::connect($dsn, true); - if (DB::isError($dbh)) { - do_err('Database error: '. htmlspecialchars(DB::errorMessage($dbh)) . - ' in ' .$type .' DSN.'); - } - $dbh->disconnect(); - echo "$IND$type database connect successful.
\n"; + // now, test this interface: - } else { - do_err($dbtype.' database support not present!'); + $dbh = DB::connect($dsn, true); + if (DB::isError($dbh)) { + do_err('Database error: '. htmlspecialchars(DB::errorMessage($dbh)) . + ' in ' .$type .' DSN.'); } + $dbh->disconnect(); + echo "$IND$type database connect successful.
\n"; } } else { $db_error='Required PHP PEAR DB support is not available.'