github.php 756 B

123456789101112131415161718192021222324252627
  1. <?php namespace Laravel\CLI\Tasks\Bundle\Providers;
  2. class Github implements Provider {
  3. /**
  4. * Install the given bundle into the application.
  5. *
  6. * @param string $bundle
  7. * @return void
  8. */
  9. public function install($bundle)
  10. {
  11. $repository = "git@github.com:{$bundle['location']}.git";
  12. // We need to just extract the basename of the bundle path when
  13. // adding the submodule. Of course, we can't add a submodule to
  14. // a location outside of the Git repository, so we don't need
  15. // the full bundle path. We'll just take the basename in case
  16. // the bundle directory has been renamed.
  17. $path = basename(path('bundle')).'/';
  18. passthru('git submodule add '.$repository.' '.$path.$bundle['name']);
  19. passthru('git submodule update');
  20. }
  21. }