Created
August 21, 2013 12:53
-
-
Save jcsrb/6294084 to your computer and use it in GitHub Desktop.
a little script that downloads and extracts wordpress
This file contains hidden or 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 | |
// CONFIGURE YOUR INSTALL HERE | |
echo "<pre>"; | |
echo "Step 0: Initalization"; | |
$install_folder = "wordpress"; | |
$wordpress_archive_url = "http://wordpress.org/latest.zip"; | |
echo " - done \r\n"; | |
// Execute | |
//Download File | |
echo "Step 1: Wordpress Download"; | |
$file = "$install_folder.zip"; | |
file_put_contents($file , fopen($wordpress_archive_url, 'r')); | |
echo " - done \r\n"; | |
echo "Step 2: Unarchive Wordpress"; | |
// get the absolute path to $file | |
$path = pathinfo(realpath($file), PATHINFO_DIRNAME); | |
$zip = new ZipArchive; | |
$res = $zip->open($file); | |
if ($res === TRUE) { | |
// extract it to the path we determined above | |
$zip->extractTo($path); | |
$zip->close(); | |
} else { | |
} | |
echo " - done \r\n"; | |
//Delete Archive | |
echo "Step 3: Delete Archive"; | |
unlink($file); | |
echo " - done \r\n"; | |
echo "</pre>"; | |
echo "<a href='/$install_folder'>Configure your new install</a>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment