1 | <?php |
||
20 | class PluginState |
||
21 | { |
||
22 | /** |
||
23 | * @var Composer $composer |
||
24 | */ |
||
25 | protected $composer; |
||
26 | |||
27 | /** |
||
28 | * @var array $includes |
||
29 | */ |
||
30 | protected $includes = array(); |
||
31 | |||
32 | /** |
||
33 | * @var array $requires |
||
34 | */ |
||
35 | protected $requires = array(); |
||
36 | |||
37 | /** |
||
38 | * @var array $duplicateLinks |
||
39 | */ |
||
40 | protected $duplicateLinks = array(); |
||
41 | |||
42 | /** |
||
43 | * @var bool $devMode |
||
44 | */ |
||
45 | protected $devMode = false; |
||
46 | |||
47 | /** |
||
48 | * @var bool $recurse |
||
49 | */ |
||
50 | protected $recurse = true; |
||
51 | |||
52 | /** |
||
53 | * @var bool $replace |
||
54 | */ |
||
55 | protected $replace = false; |
||
56 | |||
57 | /** |
||
58 | * Whether to merge the -dev sections. |
||
59 | * @var bool $mergeDev |
||
60 | */ |
||
61 | protected $mergeDev = true; |
||
62 | |||
63 | /** |
||
64 | * Whether to merge the extra section. |
||
65 | * |
||
66 | * By default, the extra section is not merged and there will be many |
||
67 | * cases where the merge of the extra section is performed too late |
||
68 | * to be of use to other plugins. When enabled, merging uses one of |
||
69 | * two strategies - either 'first wins' or 'last wins'. When enabled, |
||
70 | * 'first wins' is the default behaviour. If Replace mode is activated |
||
71 | * then 'last wins' is used. |
||
72 | * |
||
73 | * @var bool $mergeExtra |
||
74 | */ |
||
75 | protected $mergeExtra = false; |
||
76 | |||
77 | /** |
||
78 | * Whether to prepend repositories to repository manager. |
||
79 | * |
||
80 | * @var bool $prependRepositories |
||
81 | */ |
||
82 | protected $prependRepositories = false; |
||
83 | |||
84 | /** |
||
85 | * @var bool $firstInstall |
||
86 | */ |
||
87 | protected $firstInstall = false; |
||
88 | |||
89 | /** |
||
90 | * @var bool $locked |
||
91 | */ |
||
92 | protected $locked = false; |
||
93 | |||
94 | /** |
||
95 | * @var bool $dumpAutoloader |
||
96 | */ |
||
97 | protected $dumpAutoloader = false; |
||
98 | |||
99 | /** |
||
100 | 135 | * @var bool $optimizeAutoloader |
|
101 | */ |
||
102 | 135 | protected $optimizeAutoloader = false; |
|
103 | 135 | ||
104 | /** |
||
105 | * @param Composer $composer |
||
106 | */ |
||
107 | public function __construct(Composer $composer) |
||
111 | 100 | ||
112 | /** |
||
113 | 100 | * Load plugin settings |
|
114 | 100 | */ |
|
115 | 100 | public function loadSettings() |
|
141 | |||
142 | /** |
||
143 | * Get list of filenames and/or glob patterns to include |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | public function getIncludes() |
||
151 | |||
152 | /** |
||
153 | * Get list of filenames and/or glob patterns to require |
||
154 | * |
||
155 | * @return array |
||
156 | */ |
||
157 | public function getRequires() |
||
161 | 10 | ||
162 | /** |
||
163 | * Set the first install flag |
||
164 | * |
||
165 | * @param bool $flag |
||
166 | */ |
||
167 | public function setFirstInstall($flag) |
||
171 | |||
172 | /** |
||
173 | * Is this the first time that the plugin has been installed? |
||
174 | * |
||
175 | * @return bool |
||
176 | */ |
||
177 | public function isFirstInstall() |
||
181 | 15 | ||
182 | /** |
||
183 | * Set the locked flag |
||
184 | * |
||
185 | * @param bool $flag |
||
186 | */ |
||
187 | public function setLocked($flag) |
||
191 | |||
192 | /** |
||
193 | * Was a lockfile present when the plugin was installed? |
||
194 | * |
||
195 | * @return bool |
||
196 | */ |
||
197 | public function isLocked() |
||
201 | |||
202 | /** |
||
203 | * Should an update be forced? |
||
204 | * |
||
205 | * @return true If packages are not locked |
||
206 | */ |
||
207 | public function forceUpdate() |
||
211 | 100 | ||
212 | /** |
||
213 | * Set the devMode flag |
||
214 | * |
||
215 | * @param bool $flag |
||
216 | */ |
||
217 | public function setDevMode($flag) |
||
221 | |||
222 | /** |
||
223 | * Should devMode settings be processed? |
||
224 | * |
||
225 | * @return bool |
||
226 | */ |
||
227 | public function isDevMode() |
||
231 | 100 | ||
232 | /** |
||
233 | * Set the dumpAutoloader flag |
||
234 | * |
||
235 | * @param bool $flag |
||
236 | */ |
||
237 | public function setDumpAutoloader($flag) |
||
241 | |||
242 | /** |
||
243 | * Is the autoloader file supposed to be written out? |
||
244 | * |
||
245 | * @return bool |
||
246 | */ |
||
247 | public function shouldDumpAutoloader() |
||
251 | 100 | ||
252 | /** |
||
253 | * Set the optimizeAutoloader flag |
||
254 | * |
||
255 | * @param bool $flag |
||
256 | */ |
||
257 | public function setOptimizeAutoloader($flag) |
||
261 | |||
262 | /** |
||
263 | * Should the autoloader be optimized? |
||
264 | * |
||
265 | * @return bool |
||
266 | */ |
||
267 | public function shouldOptimizeAutoloader() |
||
271 | 65 | ||
272 | 65 | /** |
|
273 | 65 | * Add duplicate packages |
|
274 | 65 | * |
|
275 | 65 | * @param string $type Package type |
|
276 | 65 | * @param array $packages |
|
277 | */ |
||
278 | public function addDuplicateLinks($type, array $packages) |
||
286 | 95 | ||
287 | 95 | /** |
|
288 | * Get duplicate packages |
||
289 | * |
||
290 | * @param string $type Package type |
||
291 | * @return array |
||
292 | */ |
||
293 | public function getDuplicateLinks($type) |
||
298 | |||
299 | /** |
||
300 | * Should includes be recursively processed? |
||
301 | * |
||
302 | * @return bool |
||
303 | */ |
||
304 | public function recurseIncludes() |
||
308 | |||
309 | /** |
||
310 | * Should duplicate links be replaced in a 'last definition wins' order? |
||
311 | * |
||
312 | * @return bool |
||
313 | */ |
||
314 | public function replaceDuplicateLinks() |
||
318 | |||
319 | /** |
||
320 | * Should the extra section be merged? |
||
321 | * |
||
322 | 95 | * By default, the extra section is not merged and there will be many |
|
323 | * cases where the merge of the extra section is performed too late |
||
324 | 95 | * to be of use to other plugins. When enabled, merging uses one of |
|
325 | * two strategies - either 'first wins' or 'last wins'. When enabled, |
||
326 | * 'first wins' is the default behaviour. If Replace mode is activated |
||
327 | * then 'last wins' is used. |
||
328 | * |
||
329 | * @return bool |
||
330 | */ |
||
331 | public function shouldMergeExtra() |
||
335 | |||
336 | /** |
||
337 | * Should the merger prepend repositories to repository manager (instead of adding them to end of the list). |
||
338 | * |
||
339 | * @return bool |
||
340 | */ |
||
341 | public function shouldPrependRepositories() |
||
345 | } |
||
346 | // vim:sw=4:ts=4:sts=4:et: |
||
347 |