Skip to content

Instantly share code, notes, and snippets.

@jaredchu
Created June 2, 2017 04:55
Show Gist options
  • Save jaredchu/7c56468e5d9d0ec40328ba874873f6be to your computer and use it in GitHub Desktop.
Save jaredchu/7c56468e5d9d0ec40328ba874873f6be to your computer and use it in GitHub Desktop.
Packagist fake download number
// Usage
// php script.php vendor/package [download-number]
if (!isset($argv[1])) {
die("Missing package name\n");
}
if (!isset($argv[2])) {
die("Missing download times\n");
}
$currentDir = __DIR__;
$packageName = $argv[1];
$downloadTimes = $argv[2];
exec("rm -rf $currentDir/.vendor");
while ($downloadTimes-- > 0) {
exec("composer remove $packageName");
exec("composer require $packageName");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment