Script: Updates to parameters order - refs BT#19984

pull/4343/head
Yannick Warnier 3 years ago
parent e0b11f7070
commit 00967de3fa
  1. 11
      tests/scripts/delete_old_messages.php

@ -18,16 +18,16 @@ if (PHP_SAPI !== 'cli') {
die('This script can only be executed from the command line');
}
if (!empty($argv[1]) && $argv[1] == '-s') {
$simulate = true;
echo "Simulation mode is enabled".PHP_EOL;
}
if (!empty($argv[1]) && $argv[1] == '--from') {
$from = $argv[2];
}
if (!empty($argv[3]) && $argv[3] == '--until') {
$until = $argv[4];
}
if (!empty($argv[5]) && $argv[5] == '-s') {
$simulate = true;
echo "Simulation mode is enabled".PHP_EOL;
}
if (empty($from) or empty($until)) {
echo PHP_EOL."Usage: sudo php ".basename(__FILE__)." [options]".PHP_EOL;
echo "Where [options] can be ".PHP_EOL;
@ -37,10 +37,7 @@ if (empty($from) or empty($until)) {
die('Please make sure --from and --until are defined.');
}
echo "About to delete messages from $from to $until".PHP_EOL;
echo deleteMessages($from, $until, $simulate);
/**

Loading…
Cancel
Save