Skip to content

Instantly share code, notes, and snippets.

@davidrenne
Created November 9, 2011 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidrenne/1351309 to your computer and use it in GitHub Desktop.
Save davidrenne/1351309 to your computer and use it in GitHub Desktop.
Dumb script that will download a repository to your server
<?php
if (array_key_exists('user',$_REQUEST))
{
if (!is_dir($_REQUEST['repo']))
{
system("mkdir {$_REQUEST['repo']} && cd {$_REQUEST['repo']} && git init && git pull git://github.com/{$_REQUEST['user']}/{$_REQUEST['repo']}.git master");
}
else
{
die('directory '.$_REQUEST['repo'].' already exists');
}
}
else
{
echo <<<FORM
<form method="GET">
Git Hub Dev :<input type="text" name="user" value="davidrenne"/>
<br/>Git Hub Repo:<input type="text" name="repo" value="cruddy_mysql"/>
<br/><input type="submit" value="git hub!"/>
</form>
FORM;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment