1 | <?php |
||
17 | class UpdateManager |
||
18 | { |
||
19 | |||
20 | const NEW_VERSION_CHECK_INTERVAL = '1 day'; |
||
21 | |||
22 | /** |
||
23 | * Updater. |
||
24 | * |
||
25 | * @var Updater |
||
26 | */ |
||
27 | protected $updater; |
||
28 | |||
29 | /** |
||
30 | * Config editor. |
||
31 | * |
||
32 | * @var ConfigEditor |
||
33 | */ |
||
34 | protected $configEditor; |
||
35 | |||
36 | /** |
||
37 | * Process factory. |
||
38 | * |
||
39 | * @var IProcessFactory |
||
40 | */ |
||
41 | protected $processFactory; |
||
42 | |||
43 | /** |
||
44 | * File, containing new version. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $newVersionFilename; |
||
49 | |||
50 | /** |
||
51 | * UpdateManager constructor. |
||
52 | * |
||
53 | * @param Updater $updater Updater. |
||
54 | * @param ConfigEditor $config_editor Config editor. |
||
55 | * @param IProcessFactory $process_factory Process factory. |
||
56 | * @param string $working_directory Working directory. |
||
57 | */ |
||
58 | public function __construct( |
||
69 | |||
70 | /** |
||
71 | * Sets update channel. |
||
72 | * |
||
73 | * @param string $update_channel Update channel. |
||
74 | * |
||
75 | * @return void |
||
76 | * @throws \InvalidArgumentException When unknown update channel is given. |
||
77 | */ |
||
78 | public function setUpdateChannel($update_channel) |
||
95 | |||
96 | /** |
||
97 | * Returns new version. |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | public function getNewVersion() |
||
121 | |||
122 | /** |
||
123 | * Sets new version. |
||
124 | * |
||
125 | * @param string $version Version. |
||
126 | * |
||
127 | * @return void |
||
128 | */ |
||
129 | public function setNewVersion($version) |
||
133 | |||
134 | /** |
||
135 | * Returns update channel. |
||
136 | * |
||
137 | * @return string |
||
138 | */ |
||
139 | public function getUpdateChannel() |
||
143 | |||
144 | /** |
||
145 | * Returns updater object. |
||
146 | * |
||
147 | * @return Updater |
||
148 | */ |
||
149 | public function getUpdater() |
||
153 | |||
154 | } |
||
155 |