Skip to content

Instantly share code, notes, and snippets.

@fprochazka
Created September 29, 2015 10:10
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 fprochazka/c8ebfe1269e0f0649a70 to your computer and use it in GitHub Desktop.
Save fprochazka/c8ebfe1269e0f0649a70 to your computer and use it in GitHub Desktop.
Project manager tools
<?php
function composer_update($projectDir)
{
echo "Processing ", basename($projectDir), "\n";
passthru(sprintf('composer update --working-dir %s', escapeshellarg($projectDir)));
}
$dir = getcwd();
if (file_exists($dir . '/composer.json')) {
composer_update($dir);
} else {
foreach (glob($dir . '/*') as $subDir) {
if (!is_dir($subDir) || !file_exists($subDir . '/composer.json')) {
continue;
}
composer_update($subDir);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment