From dfd6bcbb3f3f55c3554c90d12cb5d03f0c3fcc87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Lochm=C3=BCller?= Date: Mon, 23 Sep 2024 20:08:43 +0200 Subject: [PATCH] Preparation the next migration. Drop Manifest Generator --- Classes/Cache/Rule/AbstractRule.php | 1 + Classes/Command/FlushCacheCommand.php | 3 +- Classes/Configuration.php | 5 -- .../Domain/Repository/AbstractRepository.php | 2 + Classes/Generator/AbstractGenerator.php | 3 + Classes/Generator/ManifestGenerator.php | 35 ---------- Classes/Middleware/CookieCheckMiddleware.php | 9 +-- Classes/Middleware/FallbackMiddleware.php | 8 +-- Classes/Middleware/FrontendUserMiddleware.php | 3 - Classes/Middleware/GenerateMiddleware.php | 7 +- Classes/Middleware/ManifestMiddleware.php | 67 ------------------- Classes/Middleware/PrepareMiddleware.php | 3 - Classes/Service/ClientService.php | 3 - Classes/Service/DateTimeService.php | 3 - Classes/Service/EnvironmentService.php | 3 - Classes/Service/GeneratorService.php | 3 - .../Service/HtaccessConfigurationService.php | 3 - Classes/Service/HttpPushService.php | 3 - Classes/Service/ObjectFactoryService.php | 2 +- Classes/Service/RemoveService.php | 3 - Classes/StaticFileCacheObject.php | 1 + ext_conf_template.txt | 3 - 22 files changed, 23 insertions(+), 150 deletions(-) delete mode 100644 Classes/Generator/ManifestGenerator.php delete mode 100644 Classes/Middleware/ManifestMiddleware.php diff --git a/Classes/Cache/Rule/AbstractRule.php b/Classes/Cache/Rule/AbstractRule.php index 56e6802e15c..6cf4870f7cd 100644 --- a/Classes/Cache/Rule/AbstractRule.php +++ b/Classes/Cache/Rule/AbstractRule.php @@ -9,6 +9,7 @@ /** * Abstract Rule. + * @todo migrate to Listener */ abstract class AbstractRule extends StaticFileCacheObject { diff --git a/Classes/Command/FlushCacheCommand.php b/Classes/Command/FlushCacheCommand.php index e3a7ec920e4..9c8be2d2b86 100644 --- a/Classes/Command/FlushCacheCommand.php +++ b/Classes/Command/FlushCacheCommand.php @@ -17,8 +17,7 @@ class FlushCacheCommand extends AbstractCommand protected function configure(): void { parent::configure(); - $this->addOption('force-boost-mode-flush', null, InputOption::VALUE_NONE, 'Force a boost mode flush') - ; + $this->addOption('force-boost-mode-flush', null, InputOption::VALUE_NONE, 'Force a boost mode flush'); } protected function execute(InputInterface $input, OutputInterface $output): int diff --git a/Classes/Configuration.php b/Classes/Configuration.php index 38ce4f3aa28..798692b0135 100644 --- a/Classes/Configuration.php +++ b/Classes/Configuration.php @@ -24,7 +24,6 @@ use SFC\Staticfilecache\Generator\ConfigGenerator; use SFC\Staticfilecache\Generator\GzipGenerator; use SFC\Staticfilecache\Generator\HtaccessGenerator; -use SFC\Staticfilecache\Generator\ManifestGenerator; use SFC\Staticfilecache\Generator\PhpGenerator; use SFC\Staticfilecache\Generator\PlainGenerator; use SFC\Staticfilecache\Hook\DatamapHook; @@ -143,10 +142,6 @@ protected function registerGenerators(): self 'htaccess' => HtaccessGenerator::class, ]; - - if ($this->configurationService->get('enableGeneratorManifest')) { - $generator['manifest'] = ManifestGenerator::class; - } if ($this->configurationService->get('enableGeneratorPhp')) { $generator['php'] = PhpGenerator::class; unset($generator['htaccess']); diff --git a/Classes/Domain/Repository/AbstractRepository.php b/Classes/Domain/Repository/AbstractRepository.php index b710c104c52..9c7e01926dc 100644 --- a/Classes/Domain/Repository/AbstractRepository.php +++ b/Classes/Domain/Repository/AbstractRepository.php @@ -12,6 +12,8 @@ /** * AbstractRepository. + * + * @todo move methods to iterator? */ abstract class AbstractRepository extends StaticFileCacheObject { diff --git a/Classes/Generator/AbstractGenerator.php b/Classes/Generator/AbstractGenerator.php index 310a44669fe..d9a83b71987 100644 --- a/Classes/Generator/AbstractGenerator.php +++ b/Classes/Generator/AbstractGenerator.php @@ -10,6 +10,9 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\View\StandaloneView; +/** + * @todo move to Generate Event + */ abstract class AbstractGenerator extends StaticFileCacheObject { abstract public function generate(string $entryIdentifier, string $fileName, ResponseInterface $response, int $lifetime): void; diff --git a/Classes/Generator/ManifestGenerator.php b/Classes/Generator/ManifestGenerator.php deleted file mode 100644 index 9dfd538c680..00000000000 --- a/Classes/Generator/ManifestGenerator.php +++ /dev/null @@ -1,35 +0,0 @@ -getBody(); - // $content = $manifestService->generateManifestContent($entryIdentifier, $html); - // if ('' !== $content) { - // GeneralUtility::writeFile($fileName.'.sfc', $content); - // } - } - - - public function remove(string $entryIdentifier, string $fileName): void - { - // $this->removeFile($fileName.'.sfc'); - } -} diff --git a/Classes/Middleware/CookieCheckMiddleware.php b/Classes/Middleware/CookieCheckMiddleware.php index 18f45b16551..96cd2b5ec21 100644 --- a/Classes/Middleware/CookieCheckMiddleware.php +++ b/Classes/Middleware/CookieCheckMiddleware.php @@ -12,12 +12,13 @@ use SFC\Staticfilecache\Service\CookieService; use TYPO3\CMS\Core\Context\Context; -/** - * CookieCheckMiddleware. - */ class CookieCheckMiddleware implements MiddlewareInterface { - public function __construct(protected Context $context, protected CookieService $cookieService, protected EventDispatcherInterface $eventDispatcher) {} + public function __construct( + protected Context $context, + protected CookieService $cookieService, + protected EventDispatcherInterface $eventDispatcher + ) {} /** * Check for the sfc cookie and remove it when there is no valid user session. diff --git a/Classes/Middleware/FallbackMiddleware.php b/Classes/Middleware/FallbackMiddleware.php index b09d7fcedbf..f0427d57b90 100644 --- a/Classes/Middleware/FallbackMiddleware.php +++ b/Classes/Middleware/FallbackMiddleware.php @@ -18,12 +18,12 @@ use TYPO3\CMS\Core\Http\HtmlResponse; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * FallbackMiddleware. - */ class FallbackMiddleware implements MiddlewareInterface { - public function __construct(protected EventDispatcherInterface $eventDispatcher, protected ConfigurationService $configurationService) {} + public function __construct( + protected EventDispatcherInterface $eventDispatcher, + protected ConfigurationService $configurationService + ) {} public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { diff --git a/Classes/Middleware/FrontendUserMiddleware.php b/Classes/Middleware/FrontendUserMiddleware.php index 0f4e7307164..f15476bdf7b 100644 --- a/Classes/Middleware/FrontendUserMiddleware.php +++ b/Classes/Middleware/FrontendUserMiddleware.php @@ -12,9 +12,6 @@ use TYPO3\CMS\Core\Http\HtmlResponse; use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication; -/** - * Init frontend user. - */ class FrontendUserMiddleware implements MiddlewareInterface { public function __construct(private CookieService $cookieService) {} diff --git a/Classes/Middleware/GenerateMiddleware.php b/Classes/Middleware/GenerateMiddleware.php index a2ab3dadd99..76699d86e00 100644 --- a/Classes/Middleware/GenerateMiddleware.php +++ b/Classes/Middleware/GenerateMiddleware.php @@ -25,8 +25,10 @@ class GenerateMiddleware implements MiddlewareInterface { protected ?UriFrontend $cache = null; - - public function __construct(protected EventDispatcherInterface $eventDispatcher, protected CookieService $cookieService) {} + public function __construct( + protected EventDispatcherInterface $eventDispatcher, + protected CookieService $cookieService + ) {} /** * Process an incoming server request. @@ -89,6 +91,7 @@ protected function calculateLifetime(TypoScriptFrontendController $tsfe): int // Check ModifyCacheLifetimeForPageEvent & AfterCachedPageIsPersistedEvent // @phpstan-ignore-next-line + // @todo check this Line!!! $timeOutTime = $tsfe->get_cache_timeout(); // If page has a endtime before the current timeOutTime, use it instead: diff --git a/Classes/Middleware/ManifestMiddleware.php b/Classes/Middleware/ManifestMiddleware.php deleted file mode 100644 index d4a4f9ed020..00000000000 --- a/Classes/Middleware/ManifestMiddleware.php +++ /dev/null @@ -1,67 +0,0 @@ -getFilepath(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')); - - // var_dump($fileName); - } catch (\Exception $exception) { - // $this->lo - // $exception->getMessage() - } - } - - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - return $handler->handle($request); - } -} diff --git a/Classes/Middleware/PrepareMiddleware.php b/Classes/Middleware/PrepareMiddleware.php index 7f578bad43f..904ae6b3662 100644 --- a/Classes/Middleware/PrepareMiddleware.php +++ b/Classes/Middleware/PrepareMiddleware.php @@ -19,9 +19,6 @@ use SFC\Staticfilecache\Service\TypoScriptFrontendService; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * PrepareMiddleware. - */ class PrepareMiddleware implements MiddlewareInterface { public function __construct(protected EventDispatcherInterface $eventDispatcher) {} diff --git a/Classes/Service/ClientService.php b/Classes/Service/ClientService.php index ee6f1bcec61..9c545f6c7c6 100644 --- a/Classes/Service/ClientService.php +++ b/Classes/Service/ClientService.php @@ -13,9 +13,6 @@ use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * ClientService. - */ class ClientService extends AbstractService { protected const DEFAULT_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0'; diff --git a/Classes/Service/DateTimeService.php b/Classes/Service/DateTimeService.php index 5efbc044624..2267cb310fd 100644 --- a/Classes/Service/DateTimeService.php +++ b/Classes/Service/DateTimeService.php @@ -7,9 +7,6 @@ use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * DateTimeService. - */ class DateTimeService extends AbstractService { /** diff --git a/Classes/Service/EnvironmentService.php b/Classes/Service/EnvironmentService.php index 4703a864c40..edb4efcb20a 100644 --- a/Classes/Service/EnvironmentService.php +++ b/Classes/Service/EnvironmentService.php @@ -9,9 +9,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\VersionNumberUtility; -/** - * EnvironmentService. - */ class EnvironmentService { /** diff --git a/Classes/Service/GeneratorService.php b/Classes/Service/GeneratorService.php index bcb7927ca98..442aba2288a 100644 --- a/Classes/Service/GeneratorService.php +++ b/Classes/Service/GeneratorService.php @@ -8,9 +8,6 @@ use SFC\Staticfilecache\Generator\AbstractGenerator; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * GeneratorService. - */ class GeneratorService extends AbstractService { /** diff --git a/Classes/Service/HtaccessConfigurationService.php b/Classes/Service/HtaccessConfigurationService.php index 42464e97b6f..32c214d85b3 100644 --- a/Classes/Service/HtaccessConfigurationService.php +++ b/Classes/Service/HtaccessConfigurationService.php @@ -7,9 +7,6 @@ use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * HtaccessConfigurationService. - */ class HtaccessConfigurationService extends AbstractService { /** diff --git a/Classes/Service/HttpPushService.php b/Classes/Service/HttpPushService.php index bfdbfc3fb35..c6147d549f1 100644 --- a/Classes/Service/HttpPushService.php +++ b/Classes/Service/HttpPushService.php @@ -7,9 +7,6 @@ use SFC\Staticfilecache\Service\HttpPush\AbstractHttpPush; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * HttpPushService. - */ class HttpPushService extends AbstractService { /** diff --git a/Classes/Service/ObjectFactoryService.php b/Classes/Service/ObjectFactoryService.php index e10bcf22f16..1ab0d2843ca 100644 --- a/Classes/Service/ObjectFactoryService.php +++ b/Classes/Service/ObjectFactoryService.php @@ -7,7 +7,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; /** - * ObjectFactoryService. + * @todo drop this for events */ class ObjectFactoryService extends AbstractService { diff --git a/Classes/Service/RemoveService.php b/Classes/Service/RemoveService.php index c2d0d9f6d20..ae194d818bc 100644 --- a/Classes/Service/RemoveService.php +++ b/Classes/Service/RemoveService.php @@ -6,9 +6,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * RemoveService. - */ class RemoveService extends AbstractService { /** diff --git a/Classes/StaticFileCacheObject.php b/Classes/StaticFileCacheObject.php index a3fa957b97b..c6b597011e8 100644 --- a/Classes/StaticFileCacheObject.php +++ b/Classes/StaticFileCacheObject.php @@ -13,5 +13,6 @@ */ abstract class StaticFileCacheObject implements SingletonInterface, LoggerAwareInterface { + // @todo remove this "all object stuff" use LoggerAwareTrait; } diff --git a/ext_conf_template.txt b/ext_conf_template.txt index 7ea51010b6b..0d1b305657a 100644 --- a/ext_conf_template.txt +++ b/ext_conf_template.txt @@ -49,9 +49,6 @@ phpTemplateName = EXT:staticfilecache/Resources/Private/Templates/Php.html # cat=basic; type=string; label=Override cache directory: If this config var is empty the default is "typo3temp/assets/tx_staticfilecache/". If you change this value you HAVE TO adapt your rewrite configuration. overrideCacheDirectory = -# cat=Generator; type=boolean; label=Enable Cache Manifest generator (BETA!!!): Create manifest files -enableGeneratorManifest = 0 - # cat=Generator; type=boolean; label=Enable PHP generator: When checked, the php file including headers output will write to the cache. This will also disable the .htaccess file generation. enableGeneratorPhp = 0