repository.php 668 B

1234567891011121314151617181920212223242526272829
  1. <?php namespace Laravel\CLI\Tasks\Bundle;
  2. class Repository {
  3. /**
  4. * The root of the Laravel bundle API.
  5. *
  6. * @var string
  7. */
  8. protected $api = 'http://bundles.laravel.com/api/';
  9. /**
  10. * Get the decoded JSON information for a bundle.
  11. *
  12. * @param string|int $bundle
  13. * @return array
  14. */
  15. public function get($bundle)
  16. {
  17. // The Bundle API will return a JSON string that we can decode and
  18. // pass back to the consumer. The decoded array will contain info
  19. // regarding the bundle's provider and location, as well as all
  20. // of the bundle's dependencies.
  21. $bundle = @file_get_contents($this->api.$bundle);
  22. return json_decode($bundle, true);
  23. }
  24. }