Skip to content

Instantly share code, notes, and snippets.

@sorich87
Created February 6, 2011 12:35
Show Gist options
  • Save sorich87/813342 to your computer and use it in GitHub Desktop.
Save sorich87/813342 to your computer and use it in GitHub Desktop.
WordPress Download and Extraction
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