- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscrubber.php
More file actions
37 lines (31 loc) · 935 Bytes
/
scrubber.php
File metadata and controls
37 lines (31 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/php
<?php
use Scrubber\Scrubber;
require(__DIR__ . 'vendor/autoload.php');
if (PHP_SAPI !== 'cli') {
echo "Not running under the command line";
exit(1);
}
$scrubber = new Scrubber();
$options = getopt(null, array("table:","help","status"));
echo "Output is located in " . $scrubber->getLogFile() . PHP_EOL;
if (0 === count($options)) {
$scrubber->scrub();
}
elseif (array_key_exists('status', $options)){
$scrubber->scrubberStatus();
}
elseif (array_key_exists('table', $options)){
$scrubber->setScrubOverride(true);
$scrubber->scrubTableManually($options['table']);
}
else {
echo 'Usage:' . PHP_EOL;
echo " php scrubber.php" . PHP_EOL;
echo "Optional Parameters:" . PHP_EOL;
echo " --status" . PHP_EOL;
echo " --table Table Name which are listed below" . PHP_EOL;
echo print_r($scrubber->getTables(), 1);
}
echo PHP_EOL . 'Done!' . PHP_EOL . PHP_EOL;
exit(0);