stwalkerster /
waca
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /****************************************************************************** |
||
| 3 | * Wikipedia Account Creation Assistance tool * |
||
| 4 | * * |
||
| 5 | * All code in this file is released into the public domain by the ACC * |
||
| 6 | * Development Team. Please see team.json for a list of contributors. * |
||
| 7 | ******************************************************************************/ |
||
| 8 | |||
| 9 | if (isset($_SERVER['REQUEST_METHOD'])) { |
||
| 10 | die(); |
||
| 11 | } //Web clients die. |
||
| 12 | |||
| 13 | // Get all the classes. |
||
| 14 | require_once 'config.inc.php'; |
||
| 15 | |||
| 16 | //ini_set('display_errors', '1'); |
||
|
0 ignored issues
–
show
|
|||
| 17 | |||
| 18 | echo "Initialising backup script\n"; |
||
| 19 | |||
| 20 | $arg = $argv['1']; |
||
| 21 | if ($arg == "--monthly") { |
||
| 22 | echo "running monthly backups.\n"; |
||
| 23 | $dateModifier = date("FY"); |
||
| 24 | $cmdLine = "$BUtar $BUmonthdir/mBackup-$dateModifier.tar $BUdir/*.sql.gz; rm $BUdir/*.sql.gz"; |
||
| 25 | echo "running command $cmdLine\n"; |
||
| 26 | shell_exec($cmdLine); |
||
| 27 | die("done."); |
||
| 28 | } |
||
| 29 | |||
| 30 | echo "running nightly backups\n"; |
||
| 31 | $dateModifier = date("y-m-d"); |
||
| 32 | $cmdLine = "$BUdumper > $BUdir/$BUbasefile$dateModifier.sql; $BUgzip $BUdir/$BUbasefile$dateModifier.sql"; |
||
| 33 | echo "running command $cmdLine\n"; |
||
| 34 | shell_exec($cmdLine); |
||
| 35 | echo "done."; |
||
| 36 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.