Merge pull request #13354 from owncloud/hhvm-redis

HHVM: Prevent E_WARNING messages by Redis test in console output.
This commit is contained in:
Morris Jobke 2015-01-15 00:23:12 +01:00
commit 925a680a24

View file

@ -16,7 +16,17 @@ class Redis extends Cache {
if (!\OC\Memcache\Redis::isAvailable()) {
self::markTestSkipped('The redis extension is not available.');
}
set_error_handler(
function($errno, $errstr) {
restore_error_handler();
self::markTestSkipped($errstr);
},
E_WARNING
);
$instance = new \OC\Memcache\Redis(self::getUniqueID());
restore_error_handler();
if ($instance->set(self::getUniqueID(), self::getUniqueID()) === false) {
self::markTestSkipped('redis server seems to be down.');
}