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