exists() && in_array($lid, $session->getTargetIDs())) { $share = Share::fromShareID($memcache, $lid); if ($share->exists()) { switch ($share->getType()) { case SHARE_TYPE_ALONE: $share->end(); break; case SHARE_TYPE_GROUP: $share->removeHost($session)->clean(); break; } } $session->removeTarget($share)->save(); } } else { // Tell the entire session to terminate. if ($session->exists()) $session->end(); } echo "OK\n";