Created
April 14, 2013 09:24
-
-
Save wolffe/5382070 to your computer and use it in GitHub Desktop.
Tiny WordPress (tinywp.php) is a quick PHP script which auto-installs WordPress on any host. Just upload it via FTP and run it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$n = basename($_SERVER['SCRIPT_NAME']); | |
unlink($n); | |
copy('http://wordpress.org/latest.zip', 'wordpress.zip'); | |
$b = new ZipArchive; | |
$b->open('wordpress.zip'); | |
for($i = 0; $i < $b->numFiles; $i++) { | |
$f = $b->getNameIndex($i); | |
$b->renameName($f, str_replace('wordpress/', '', $f)); | |
} | |
$b->close(); | |
$b = new ZipArchive; | |
$b->open('wordpress.zip'); | |
$b->extractTo('./'); | |
$b->close(); | |
unlink('wordpress.zip'); | |
header('Location: http://' . $_SERVER['HTTP_HOST'] . str_replace($n, 'wp-admin/setup-config.php', $_SERVER['REQUEST_URI'])); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment