private function isMissingOrDifferent($local, $remote)
{
if (is_null($remote) || isset($remote['error']) && $remote['error'] == 'not_found') {
return true;
}
foreach ($local as $key => $val) {
if (!isset($remote[$key]) || $remote[$key] != $val) {
return true;
}
unset($remote[$key]);
}
// If any items remain (excluding _id and _rev) the remote is different.
if (count($remote) > 2) {
return true;
}
return false;
}