1 | <?php |
||
14 | class Manager |
||
15 | { |
||
16 | /** |
||
17 | * The update manifest. |
||
18 | * |
||
19 | * @var Manifest |
||
20 | */ |
||
21 | private $manifest; |
||
22 | |||
23 | /** |
||
24 | * The running file (the Phar that will be updated). |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private $runningFile; |
||
29 | |||
30 | /** |
||
31 | * Sets the update manifest. |
||
32 | * |
||
33 | * @param Manifest $manifest The manifest. |
||
34 | */ |
||
35 | public function __construct(Manifest $manifest) |
||
39 | |||
40 | /** |
||
41 | * Returns the manifest. |
||
42 | * |
||
43 | * @return Manifest The manifest. |
||
44 | */ |
||
45 | public function getManifest() |
||
49 | |||
50 | /** |
||
51 | * Returns the running file (the Phar that will be updated). |
||
52 | * |
||
53 | * @return string The file. |
||
54 | */ |
||
55 | public function getRunningFile() |
||
63 | |||
64 | /** |
||
65 | * Sets the running file (the Phar that will be updated). |
||
66 | * |
||
67 | * @param string $file The file name or path. |
||
68 | * |
||
69 | * @throws Exception\Exception |
||
70 | * @throws InvalidArgumentException If the file path is invalid. |
||
71 | */ |
||
72 | public function setRunningFile($file) |
||
83 | |||
84 | /** |
||
85 | * Updates the running Phar if any is available. |
||
86 | * |
||
87 | * @param string|Version $version The current version. |
||
88 | * @param boolean $major Lock to current major version? |
||
89 | * @param boolean $pre Allow pre-releases? |
||
90 | * |
||
91 | * @return boolean TRUE if an update was performed, FALSE if none available. |
||
92 | */ |
||
93 | public function update($version, $major = false, $pre = false) |
||
112 | } |
||
113 |