Created
February 6, 2011 12:35
-
-
Save sorich87/813342 to your computer and use it in GitHub Desktop.
WordPress Download and Extraction
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
function file_it($url) { | |
$c = curl_init(); | |
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($c, CURLOPT_URL, $url); | |
$contents = curl_exec($c); | |
curl_close($c); | |
$file = basename($url); | |
if ($contents) file_put_contents($file, $contents); | |
exec("tar -xzf $file"); | |
echo "$file ok<br />"; | |
} | |
file_it('http://wordpress.org/latest.tar.gz'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment