1 | <?php |
||
21 | class PuliStrategy implements StrategyInterface |
||
22 | { |
||
23 | const ANY = 'any'; |
||
24 | const STABLE = 'stable'; |
||
25 | const UNSTABLE = 'unstable'; |
||
26 | |||
27 | const MANIFEST = 'https://puli.io/download/versions.json'; |
||
28 | const REMOTE_PHAR = 'https://puli.io/download/%s/puli.phar'; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | private static $stabilities = array( |
||
34 | self::STABLE, |
||
35 | self::UNSTABLE, |
||
36 | self::ANY, |
||
37 | ); |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $stability = self::ANY; |
||
43 | |||
44 | /** |
||
45 | * Download the remote Phar file. |
||
46 | * |
||
47 | * @param Updater $updater |
||
48 | */ |
||
49 | 1 | public function download(Updater $updater) |
|
70 | |||
71 | /** |
||
72 | * Retrieve the current version available remotely. |
||
73 | * |
||
74 | * @param Updater $updater |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | 2 | public function getCurrentRemoteVersion(Updater $updater) |
|
103 | |||
104 | /** |
||
105 | * Retrieve the current version of the local phar file. |
||
106 | * |
||
107 | * @param Updater $updater |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | 1 | public function getCurrentLocalVersion(Updater $updater) |
|
115 | |||
116 | /** |
||
117 | * Set target stability. |
||
118 | * |
||
119 | * @param string $stability |
||
120 | */ |
||
121 | 6 | public function setStability($stability) |
|
131 | |||
132 | /** |
||
133 | * Get target stability. |
||
134 | * |
||
135 | * @return string |
||
136 | */ |
||
137 | 5 | public function getStability() |
|
141 | } |
||
142 |