1414use Neos \Flow \Annotations as Flow ;
1515use Neos \Flow \Cli \CommandController ;
1616use Neos \Flow \Composer \ComposerUtility ;
17- use Neos \Flow \Core \Booting \Scripts ;
18- use Neos \Flow \Core \Bootstrap ;
1917use Neos \Flow \Package \PackageInterface ;
2018use Neos \Flow \Package \PackageKeyAwareInterface ;
2119use Neos \Flow \Package \PackageManager ;
@@ -32,25 +30,6 @@ class PackageCommandController extends CommandController
3230 */
3331 protected $ packageManager ;
3432
35- /**
36- * @var array
37- */
38- protected $ settings ;
39-
40- /**
41- * @var Bootstrap
42- */
43- protected $ bootstrap ;
44-
45- /**
46- * @param array $settings The Flow settings
47- * @return void
48- */
49- public function injectSettings (array $ settings )
50- {
51- $ this ->settings = $ settings ;
52- }
53-
5433 /**
5534 * @param PackageManager $packageManager
5635 * @return void
@@ -60,15 +39,6 @@ public function injectPackageManager(PackageManager $packageManager)
6039 $ this ->packageManager = $ packageManager ;
6140 }
6241
63- /**
64- * @param Bootstrap $bootstrap
65- * @return void
66- */
67- public function injectBootstrap (Bootstrap $ bootstrap )
68- {
69- $ this ->bootstrap = $ bootstrap ;
70- }
71-
7242 /**
7343 * Create a new package
7444 *
@@ -112,20 +82,14 @@ public function createCommand(string $packageKey, string $packageType = PackageI
11282 public function listCommand (bool $ loadingOrder = false )
11383 {
11484 $ availablePackages = [];
115- $ frozenPackages = [];
11685 $ longestPackageKey = 0 ;
117- $ freezeSupported = $ this ->bootstrap ->getContext ()->isDevelopment ();
11886
11987 foreach ($ this ->packageManager ->getAvailablePackages () as $ packageKey => $ package ) {
12088 if (strlen ($ packageKey ) > $ longestPackageKey ) {
12189 $ longestPackageKey = strlen ($ packageKey );
12290 }
12391
12492 $ availablePackages [$ packageKey ] = $ package ;
125-
126- if ($ this ->packageManager ->isPackageFrozen ($ packageKey )) {
127- $ frozenPackages [$ packageKey ] = $ package ;
128- }
12993 }
13094
13195 if ($ loadingOrder === false ) {
@@ -135,13 +99,7 @@ public function listCommand(bool $loadingOrder = false)
13599 $ this ->outputLine ('PACKAGES: ' );
136100 /** @var PackageInterface|PackageKeyAwareInterface $package */
137101 foreach ($ availablePackages as $ package ) {
138- $ frozenState = ($ freezeSupported && isset ($ frozenPackages [$ package ->getPackageKey ()]) ? '* ' : ' ' );
139- $ this ->outputLine (' ' . str_pad ($ package ->getPackageKey (), $ longestPackageKey + 3 ) . $ frozenState . str_pad ($ package ->getInstalledVersion (), 15 ));
140- }
141-
142- if (count ($ frozenPackages ) > 0 && $ freezeSupported ) {
143- $ this ->outputLine ();
144- $ this ->outputLine (' * frozen package ' );
102+ $ this ->outputLine (' ' . str_pad ($ package ->getPackageKey (), $ longestPackageKey + 3 ) . str_pad ($ package ->getInstalledVersion (), 15 ));
145103 }
146104 }
147105
@@ -165,47 +123,11 @@ public function listCommand(bool $loadingOrder = false)
165123 * @return void
166124 * @see neos.flow:package:unfreeze
167125 * @see neos.flow:package:refreeze
126+ * @deprecated since 8.4
168127 */
169128 public function freezeCommand (string $ packageKey = 'all ' )
170129 {
171- if (!$ this ->bootstrap ->getContext ()->isDevelopment ()) {
172- $ this ->outputLine ('Package freezing is only supported in Development context. ' );
173- $ this ->quit (3 );
174- }
175-
176- $ packagesToFreeze = [];
177-
178- if ($ packageKey === 'all ' ) {
179- foreach (array_keys ($ this ->packageManager ->getAvailablePackages ()) as $ packageKey ) {
180- if (!$ this ->packageManager ->isPackageFrozen ($ packageKey )) {
181- $ packagesToFreeze [] = $ packageKey ;
182- }
183- }
184- if ($ packagesToFreeze === []) {
185- $ this ->outputLine ('Nothing to do, all packages were already frozen. ' );
186- $ this ->quit (0 );
187- }
188- } elseif ($ packageKey === 'blackberry ' ) {
189- $ this ->outputLine ('http://bit.ly/freeze-blackberry ' );
190- $ this ->quit (42 );
191- } else {
192- if (!$ this ->packageManager ->isPackageAvailable ($ packageKey )) {
193- $ this ->outputLine ('Package "%s" is not available. ' , [$ packageKey ]);
194- $ this ->quit (2 );
195- }
196-
197- if ($ this ->packageManager ->isPackageFrozen ($ packageKey )) {
198- $ this ->outputLine ('Package "%s" was already frozen. ' , [$ packageKey ]);
199- $ this ->quit (0 );
200- }
201-
202- $ packagesToFreeze = [$ packageKey ];
203- }
204-
205- foreach ($ packagesToFreeze as $ packageKey ) {
206- $ this ->packageManager ->freezePackage ($ packageKey );
207- $ this ->outputLine ('Froze package "%s". ' , [$ packageKey ]);
208- }
130+ $ this ->outputLine ('Package freezing is no longer supported, this command is deprecated and will be removed with 9.0. ' );
209131 }
210132
211133 /**
@@ -222,47 +144,11 @@ public function freezeCommand(string $packageKey = 'all')
222144 * @return void
223145 * @see neos.flow:package:freeze
224146 * @see neos.flow:cache:flush
147+ * @deprecated since 8.4
225148 */
226149 public function unfreezeCommand (string $ packageKey = 'all ' )
227150 {
228- if (!$ this ->bootstrap ->getContext ()->isDevelopment ()) {
229- $ this ->outputLine ('Package freezing is only supported in Development context. ' );
230- $ this ->quit (3 );
231- }
232-
233- $ packagesToUnfreeze = [];
234-
235- if ($ packageKey === 'all ' ) {
236- foreach (array_keys ($ this ->packageManager ->getAvailablePackages ()) as $ packageKey ) {
237- if ($ this ->packageManager ->isPackageFrozen ($ packageKey )) {
238- $ packagesToUnfreeze [] = $ packageKey ;
239- }
240- }
241- if ($ packagesToUnfreeze === []) {
242- $ this ->outputLine ('Nothing to do, no packages were frozen. ' );
243- $ this ->quit (0 );
244- }
245- } else {
246- if ($ packageKey === null ) {
247- $ this ->outputLine ('You must specify a package to unfreeze. ' );
248- $ this ->quit (1 );
249- }
250-
251- if (!$ this ->packageManager ->isPackageAvailable ($ packageKey )) {
252- $ this ->outputLine ('Package "%s" is not available. ' , [$ packageKey ]);
253- $ this ->quit (2 );
254- }
255- if (!$ this ->packageManager ->isPackageFrozen ($ packageKey )) {
256- $ this ->outputLine ('Package "%s" was not frozen. ' , [$ packageKey ]);
257- $ this ->quit (0 );
258- }
259- $ packagesToUnfreeze = [$ packageKey ];
260- }
261-
262- foreach ($ packagesToUnfreeze as $ packageKey ) {
263- $ this ->packageManager ->unfreezePackage ($ packageKey );
264- $ this ->outputLine ('Unfroze package "%s". ' , [$ packageKey ]);
265- }
151+ $ this ->outputLine ('Package freezing is no longer supported, this command is deprecated and will be removed with 9.0. ' );
266152 }
267153
268154 /**
@@ -280,50 +166,11 @@ public function unfreezeCommand(string $packageKey = 'all')
280166 * @return void
281167 * @see neos.flow:package:freeze
282168 * @see neos.flow:cache:flush
169+ * @deprecated since 8.4
283170 */
284171 public function refreezeCommand (string $ packageKey = 'all ' )
285172 {
286- if (!$ this ->bootstrap ->getContext ()->isDevelopment ()) {
287- $ this ->outputLine ('Package freezing is only supported in Development context. ' );
288- $ this ->quit (3 );
289- }
290-
291- $ packagesToRefreeze = [];
292-
293- if ($ packageKey === 'all ' ) {
294- foreach (array_keys ($ this ->packageManager ->getAvailablePackages ()) as $ packageKey ) {
295- if ($ this ->packageManager ->isPackageFrozen ($ packageKey )) {
296- $ packagesToRefreeze [] = $ packageKey ;
297- }
298- }
299- if ($ packagesToRefreeze === []) {
300- $ this ->outputLine ('Nothing to do, no packages were frozen. ' );
301- $ this ->quit (0 );
302- }
303- } else {
304- if ($ packageKey === null ) {
305- $ this ->outputLine ('You must specify a package to refreeze. ' );
306- $ this ->quit (1 );
307- }
308-
309- if (!$ this ->packageManager ->isPackageAvailable ($ packageKey )) {
310- $ this ->outputLine ('Package "%s" is not available. ' , [$ packageKey ]);
311- $ this ->quit (2 );
312- }
313- if (!$ this ->packageManager ->isPackageFrozen ($ packageKey )) {
314- $ this ->outputLine ('Package "%s" was not frozen. ' , [$ packageKey ]);
315- $ this ->quit (0 );
316- }
317- $ packagesToRefreeze = [$ packageKey ];
318- }
319-
320- foreach ($ packagesToRefreeze as $ packageKey ) {
321- $ this ->packageManager ->refreezePackage ($ packageKey );
322- $ this ->outputLine ('Refroze package "%s". ' , [$ packageKey ]);
323- }
324-
325- Scripts::executeCommand ('neos.flow:cache:flush ' , $ this ->settings , false );
326- $ this ->sendAndExit (0 );
173+ $ this ->outputLine ('Package freezing is no longer supported, this command is deprecated and will be removed with 9.0. ' );
327174 }
328175
329176 /**
0 commit comments