only remove pid file during tests if exists

This commit is contained in:
Chris Boulton 2012-04-19 22:39:55 +10:00
parent 998b46887a
commit e54c7ca99a

View File

@ -59,11 +59,13 @@ function killRedis($pid)
}
$pidFile = TEST_MISC . '/' . $matches[1];
$pid = trim(file_get_contents($pidFile));
posix_kill((int) $pid, 9);
if (file_exists($pidFile)) {
$pid = trim(file_get_contents($pidFile));
posix_kill((int) $pid, 9);
if(is_file($pidFile)) {
unlink($pidFile);
if(is_file($pidFile)) {
unlink($pidFile);
}
}
// Remove the redis database