list of loaded extensions (updates), check that mysql extension is loaded, fix warnings in button code

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@586 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-07-18 11:36:50 +00:00
parent cfaf7ff501
commit b186d0c2b6
3 changed files with 15 additions and 1 deletions

View File

@ -307,6 +307,9 @@ function getgetparam($name,$default='') {
function connect() {
global $mysqlhost, $mysqllogin, $mysqlpass, $mysqldb, $dbencoding, $force_charset_in_connection;
if(!extension_loaded("mysql")) {
die('Mysql extension is not loaded');
}
$link = @mysql_connect($mysqlhost,$mysqllogin ,$mysqlpass )
or die('Could not connect: ' . mysql_error());
mysql_select_db($mysqldb,$link) or die('Could not select database');

View File

@ -23,7 +23,7 @@ $imageLocales = array();
$allLocales = get_available_locales();
foreach($allLocales as $curr) {
$imagesDir = "../locales/$curr/button";
if($handle = opendir($imagesDir)) {
if($handle = @opendir($imagesDir)) {
while (false !== ($file = readdir($handle))) {
if (preg_match("/^(\w+)_on.gif$/", $file, $matches)
&& is_file("$imagesDir/".$matches[1]."_off.gif")) {

View File

@ -18,6 +18,8 @@ require_once('../libs/settings.php');
$operator = check_login();
$default_extensions = array('mysql', 'gd');
$errors = array();
$page = array(
'localizations' => get_available_locales(),
@ -25,6 +27,15 @@ $page = array(
'version' => $version,
);
foreach($default_extensions as $ext) {
if(!extension_loaded($ext)) {
$page['phpVersion'] .= " $ext/absent";
} else {
$ver = phpversion($ext);
$page['phpVersion'] .= $ver ? " $ext/$ver" : " $ext";
}
}
prepare_menu($operator);
setup_settings_tabs(3);
start_html_output();