Created
June 9, 2011 16:31
-
-
Save jessevondoom/1017117 to your computer and use it in GitHub Desktop.
Quickly grabs a list of all files from a repo, queues them in an array, then mirrors the repo locally via PHP copy
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
$repo = json_decode(file_get_contents('https://github.com/api/v2/json/blob/all/cashmusic/DIY/master')); | |
$files = array_keys((array)$repo->blobs); | |
foreach ($files as $file) { | |
$path = pathinfo($file); | |
if (!is_dir('./source/'.$path['dirname'])) mkdir('./source/'.$path['dirname'],0777,true); | |
copy('https://raw.github.com/cashmusic/DIY/master/'.$file,'./source/'.$file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment