1 | <?php |
||
7 | class Manifest |
||
8 | { |
||
9 | use Traits\HttpClient; |
||
10 | |||
11 | /** |
||
12 | * @var Repository |
||
13 | */ |
||
14 | protected $repository; |
||
15 | |||
16 | /** |
||
17 | * @var Repository |
||
18 | */ |
||
19 | protected $targetRepository; |
||
20 | |||
21 | /** |
||
22 | * @param Repository $repository |
||
23 | */ |
||
24 | public function __construct(Repository $repository, Repository $targetRepository = null) |
||
29 | |||
30 | /** |
||
31 | * @param string $packageName |
||
32 | * @param string $targetPackageName |
||
33 | * |
||
34 | * @return Manifest |
||
35 | */ |
||
36 | public static function factory($packageName, $targetPackageName = null) |
||
43 | |||
44 | /** |
||
45 | * @return Repository |
||
46 | */ |
||
47 | public function getRepository() |
||
51 | |||
52 | /** |
||
53 | * @param TargetInterface $target |
||
54 | * |
||
55 | * @return array |
||
56 | * |
||
57 | * @see http://moquet.net/blog/distributing-php-cli/ |
||
58 | */ |
||
59 | public function build(TargetInterface $target) |
||
81 | |||
82 | /** |
||
83 | * Returns the manifest as JSON. |
||
84 | * |
||
85 | * @param TargetInterface $target |
||
86 | */ |
||
87 | public function publish(TargetInterface $target) |
||
92 | |||
93 | /** |
||
94 | * @param array $data |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | public function jsonEncode(array $data) |
||
103 | } |
||
104 |