So the thing is i am tired to log into shell, to wget the latest wordpress zip, unzip it and then login via SFTP and move some folders… to much hassle.
So after 20 minutes of work and trying to figure why the mv command is not moving my folders and just the files i did it :’)
The script just get’s the latest version of WordPress and unzip it in the folder that you put the script:
$local = substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], '/'));
exec("wget wordpress.org/latest.zip");
exec("unzip latest.zip");
exec("mv $local/wordpress/*.* $local/");
exec("mv $local/wordpress/wp-includes $local/");
exec("mv $local/wordpress/wp-admin $local/");
exec("mv $local/wordpress/wp-content $local/");
exec("rm -rf wordpress"); /*useles folder :') */
exec("rm w.php"); /* security shit */
$link = substr($_SERVER["REQUEST_URI"], 0, strrpos($_SERVER["REQUEST_URI"], '/'));
echo "done. <a href="$link">Go to the blog</a>. kthxbye"; /* commodity shit */
If you wan’t this to work you need to have access to the exec command and don’t have Romanian hosting



Trackbacks