From b186d0c2b681a09ae492c93ea6df249020281235 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Sat, 18 Jul 2009 11:36:50 +0000 Subject: [PATCH] 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 --- src/messenger/webim/libs/common.php | 3 +++ src/messenger/webim/operator/getcode.php | 2 +- src/messenger/webim/operator/updates.php | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index 438ddfc9..ef96a855 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -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'); diff --git a/src/messenger/webim/operator/getcode.php b/src/messenger/webim/operator/getcode.php index a9afc630..c5639457 100644 --- a/src/messenger/webim/operator/getcode.php +++ b/src/messenger/webim/operator/getcode.php @@ -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")) { diff --git a/src/messenger/webim/operator/updates.php b/src/messenger/webim/operator/updates.php index 5100557f..66838c72 100644 --- a/src/messenger/webim/operator/updates.php +++ b/src/messenger/webim/operator/updates.php @@ -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();