Skip to content

Instantly share code, notes, and snippets.

@spencerdeinum
Created October 31, 2012 23:12
Show Gist options
  • Save spencerdeinum/3990548 to your computer and use it in GitHub Desktop.
Save spencerdeinum/3990548 to your computer and use it in GitHub Desktop.
Detect composer installation in artisan startup
if( ! file_exists( __DIR__.'/vendor/autoload.php' ) )
{
echo "First usage detected, installing composer from getcomposer.org\n";
passthru("php -r \"eval('?>'.file_get_contents('https://getcomposer.org/installer'));\"");
echo passthru("php composer.phar install");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment