die('Process interrupted because not being able to delete file (permissions issues?) will generate a consistency loss and be difficult to fix. Please use "sudo" or other similar mechanism to ensure the user launching this script is allowed to delete the mentionned file.');
}
}
if ($result || $simulate) {
$log .= 'Deleted msg id '.str_pad($message['id'], 9, ' ', STR_PAD_LEFT).' in receiver\'s box'.PHP_EOL;
}
if (!$simulate) {
$log .= 'Deleting '.$message['id'].' for sender '.$message['user_sender_id'].PHP_EOL;
die('Process interrupted because not being able to delete file (permissions issues?) will generate a consistency loss and be difficult to fix. Please use "sudo" or other similar mechanism to ensure the user launching this script is allowed to delete the mentionned file.');
}
}
if ($result || $simulate) {
$log .= 'Deleted msg id '.str_pad($message['id'], 9, ' ', STR_PAD_LEFT).' in sender\'s box'.PHP_EOL;
}
}
$log .= 'In total, '.$size.'B were freed together with '.$count.' messages.'.PHP_EOL;
return $log;
}
/**
* Get a list of messages IDs between the given dates (sent or received, equally)
* @param string $from
* @param string $until
* @return array
*/
function getMessagesInDateRange(string $from, string $until): array