properly warn about missing memcached class

git-svn-id: http://www.observium.org/svn/observer/trunk@3061 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-04-19 23:38:14 +00:00
parent c32894ae99
commit 7b1e103489

View File

@@ -1134,11 +1134,19 @@ if (!$observium_link)
}
$observium_db = mysql_select_db($config['db_name'], $observium_link);
if($config['memcached']['enable'])
if ($config['memcached']['enable'])
{
$memcache = new Memcached();
$memcache->addServer($config['memcached']['host'], $config['memcached']['port']);
if ($debug) { print_r($memcache->getStats()); }
if (class_exists("Memcached"))
{
$memcache = new Memcached();
$memcache->addServer($config['memcached']['host'], $config['memcached']['port']);
if ($debug) { print_r($memcache->getStats()); }
}
else
{
echo("WARNING: You have enabled memcached but have not installed the PHP bindings. Disabling memcached support.\n");
$config['memcached']['enable'] = 0;
}
}
# Set some times needed by loads of scripts (it's dynamic, so we do it here!)