Skip to content

Commit 416181b

Browse files
committed
Merge remote-tracking branch 'origin/8.4' into 9.0
2 parents 5d95989 + c3204e5 commit 416181b

File tree

14 files changed

+310
-745
lines changed

14 files changed

+310
-745
lines changed

Neos.Flow/Classes/Aop/Builder/ProxyClassBuilder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,8 @@ public function buildProxyClass(string $targetClassName, array $aspectContainers
441441
* @param ClassNameIndex $targetClassNameCandidates target class names for advices
442442
* @param ClassNameIndex $treatedSubClasses Already treated (sub) classes to avoid duplication
443443
* @return ClassNameIndex The new collection of already treated classes
444-
* @throws ClassLoadingForReflectionFailedException
445-
* @throws \ReflectionException
446-
* @throws InvalidClassException
447444
* @throws CannotBuildObjectException
445+
* @throws \ReflectionException
448446
*/
449447
protected function proxySubClassesOfClassToEnsureAdvices(string $className, ClassNameIndex $targetClassNameCandidates, ClassNameIndex $treatedSubClasses): ClassNameIndex
450448
{

Neos.Flow/Classes/Cache/CacheManager.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,10 @@ protected function flushClassCachesByChangedFiles(array $changedFiles): void
375375
$flushDoctrineProxyCache = false;
376376
$flushPolicyCache = false;
377377
if (count($modifiedClassNamesWithUnderscores) > 0) {
378-
$reflectionStatusCache = $this->getCache('Flow_Reflection_Status');
378+
$reflectionDataRuntimeCache = $this->getCache('Flow_Reflection_RuntimeData');
379379
foreach (array_keys($modifiedClassNamesWithUnderscores) as $classNameWithUnderscores) {
380-
$reflectionStatusCache->remove($classNameWithUnderscores);
380+
$this->logger->debug('File change detected, removing reflection for ' . $classNameWithUnderscores);
381+
$reflectionDataRuntimeCache->remove($classNameWithUnderscores);
381382
if ($flushDoctrineProxyCache === false && preg_match('/_Domain_Model_(.+)/', $classNameWithUnderscores) === 1) {
382383
$flushDoctrineProxyCache = true;
383384
}

Neos.Flow/Classes/Command/CacheCommandController.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ public function injectEnvironment(Environment $environment)
134134
* from running, the removal of any temporary data can be forced by specifying
135135
* the option <b>--force</b>.
136136
*
137-
* This command does not remove the precompiled data provided by frozen
138-
* packages unless the <b>--force</b> option is used.
139-
*
140137
* @param boolean $force Force flushing of any temporary data
141138
* @return void
142139
* @see neos.flow:cache:warmup
@@ -156,23 +153,6 @@ public function flushCommand(bool $force = false)
156153
$this->lockManager->unlockSite();
157154
}
158155

159-
$frozenPackages = [];
160-
foreach (array_keys($this->packageManager->getAvailablePackages()) as $packageKey) {
161-
if ($this->packageManager->isPackageFrozen($packageKey)) {
162-
$frozenPackages[] = $packageKey;
163-
}
164-
}
165-
if ($frozenPackages !== []) {
166-
$this->outputFormatted(PHP_EOL . 'Please note that the following package' . (count($frozenPackages) === 1 ? ' is' : 's are') . ' currently frozen: ' . PHP_EOL);
167-
$this->outputFormatted(implode(PHP_EOL, $frozenPackages) . PHP_EOL, [], 2);
168-
169-
$message = 'As code and configuration changes in these packages are not detected, the application may respond ';
170-
$message .= 'unexpectedly if modifications were done anyway or the remaining code relies on these changes.' . PHP_EOL . PHP_EOL;
171-
$message .= 'You may call <b>package:refreeze all</b> in order to refresh frozen packages or use the <b>--force</b> ';
172-
$message .= 'option of this <b>cache:flush</b> command to flush caches if Flow becomes unresponsive.' . PHP_EOL;
173-
$this->outputFormatted($message, [$frozenPackages]);
174-
}
175-
176156
$this->sendAndExit(0);
177157
}
178158

Neos.Flow/Classes/Command/PackageCommandController.php

Lines changed: 7 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
use Neos\Flow\Annotations as Flow;
1515
use Neos\Flow\Cli\CommandController;
1616
use Neos\Flow\Composer\ComposerUtility;
17-
use Neos\Flow\Core\Booting\Scripts;
18-
use Neos\Flow\Core\Bootstrap;
1917
use Neos\Flow\Package\PackageInterface;
2018
use Neos\Flow\Package\PackageKeyAwareInterface;
2119
use 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
/**

Neos.Flow/Classes/Core/Booting/Scripts.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public static function initializeSystemLogger(Bootstrap $bootstrap): void
247247
$throwableStorage = self::initializeExceptionStorage($bootstrap, $settings);
248248
$bootstrap->setEarlyInstance(ThrowableStorageInterface::class, $throwableStorage);
249249

250-
/** @var PsrLoggerFactoryInterface $psrLoggerFactoryName */
250+
/** @var class-string $psrLoggerFactoryName */
251251
$psrLoggerFactoryName = $settings['log']['psr3']['loggerFactory'];
252252
$psrLogConfigurations = $settings['log']['psr3'][$psrLoggerFactoryName] ?? [];
253253
$psrLogFactory = $psrLoggerFactoryName::create($psrLogConfigurations);
@@ -578,10 +578,6 @@ public static function initializeSystemFileMonitor(Bootstrap $bootstrap)
578578

579579
/** @var FlowPackageInterface $package */
580580
foreach ($packageManager->getFlowPackages() as $packageKey => $package) {
581-
if ($packageManager->isPackageFrozen($packageKey)) {
582-
continue;
583-
}
584-
585581
self::monitorDirectoryIfItExists($fileMonitors['Flow_ConfigurationFiles'], $package->getConfigurationPath(), '\.y(a)?ml$');
586582
self::monitorDirectoryIfItExists($fileMonitors['Flow_TranslationFiles'], $package->getResourcesPath() . 'Private/Translations/', '\.xlf');
587583

Neos.Flow/Classes/Package.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Neos\Flow\ObjectManagement\Proxy;
2222
use Neos\Flow\Package\Package as BasePackage;
2323
use Neos\Flow\Package\PackageManager;
24+
use Neos\Flow\Reflection\ReflectionService;
2425
use Neos\Flow\ResourceManagement\ResourceManager;
2526
use Neos\Flow\ResourceManagement\ResourceRepository;
2627
use Neos\Flow\Security\Authentication\AuthenticationProviderManager;
@@ -105,10 +106,6 @@ public function boot(Core\Bootstrap $bootstrap)
105106
/** @var PackageManager $packageManager */
106107
$packageManager = $bootstrap->getEarlyInstance(Package\PackageManager::class);
107108
foreach ($packageManager->getFlowPackages() as $packageKey => $package) {
108-
if ($packageManager->isPackageFrozen($packageKey)) {
109-
continue;
110-
}
111-
112109
$publicResourcesPath = $package->getResourcesPath() . 'Public/';
113110
if (is_dir($publicResourcesPath)) {
114111
$publicResourcesFileMonitor->monitorDirectory($publicResourcesPath);
@@ -139,6 +136,7 @@ public function boot(Core\Bootstrap $bootstrap)
139136
$dispatcher->connect(Core\Bootstrap::class, 'bootstrapShuttingDown', ObjectManagement\ObjectManagerInterface::class, 'shutdown');
140137
$dispatcher->connect(Core\Bootstrap::class, 'bootstrapShuttingDown', Configuration\ConfigurationManager::class, 'shutdown');
141138

139+
/** @see ReflectionService::saveToCache() */
142140
$dispatcher->connect(Core\Bootstrap::class, 'bootstrapShuttingDown', Reflection\ReflectionService::class, 'saveToCache');
143141

144142
$dispatcher->connect(Command\CoreCommandController::class, 'finishedCompilationRun', Security\Authorization\Privilege\Method\MethodPrivilegePointcutFilter::class, 'savePolicyCache');

0 commit comments

Comments
 (0)