From 1d387af9369881b8825e55cff4b5727ebd41bfb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Lochm=C3=BCller?= Date: Wed, 13 Nov 2024 21:27:45 +0100 Subject: [PATCH] Add documentation and many code cleanups --- Classes/Cache/IdentifierBuilder.php | 2 ++ Classes/Cache/Listener/EnableListener.php | 2 -- .../Cache/Listener/NoBackendUserListener.php | 1 - .../Listener/NoUserOrGroupSetListener.php | 1 - .../Listener/NoWorkspacePreviewListener.php | 1 - .../Cache/Listener/SiteCacheableListener.php | 1 - .../Cache/Listener/ValidDoktypeListener.php | 1 - .../Listener/ValidPageInformationListener.php | 1 - Classes/Cache/RemoteFileBackend.php | 8 ++--- Classes/Cache/StaticDatabaseBackend.php | 3 -- Classes/Cache/StaticFileBackend.php | 1 - Classes/Command/BoostQueueCommand.php | 1 - Classes/Command/FlushCacheCommand.php | 2 -- Classes/Controller/BackendController.php | 3 -- Classes/Domain/Repository/CacheRepository.php | 3 -- .../GeneratorConfigManipulationEvent.php | 2 -- .../GeneratorContentManipulationEvent.php | 2 -- Classes/Generator/AbstractGenerator.php | 3 +- Classes/Generator/BrotliGenerator.php | 3 -- Classes/Generator/ConfigGenerator.php | 2 -- Classes/Generator/GzipGenerator.php | 3 -- Classes/Generator/HtaccessGenerator.php | 3 -- Classes/Generator/PhpGenerator.php | 6 ---- Classes/Middleware/FallbackMiddleware.php | 1 + Classes/Middleware/GenerateMiddleware.php | 2 -- Classes/Service/CacheService.php | 2 -- Classes/Service/CookieService.php | 1 - .../InlineAssets/AbstractInlineAssets.php | 2 -- .../Service/InlineAssets/InlineFavIcon.php | 2 -- Classes/Service/InlineAssets/InlineImages.php | 2 -- .../Service/InlineAssets/InlineScripts.php | 2 -- Classes/Service/InlineAssets/InlineStyles.php | 2 -- Classes/Service/InlineAssetsService.php | 2 -- Classes/Service/QueueService.php | 2 -- Documentation/Extended/Index.rst | 35 +++++++++++++++++++ Documentation/Index.rst | 1 + 36 files changed, 42 insertions(+), 69 deletions(-) create mode 100755 Documentation/Extended/Index.rst diff --git a/Classes/Cache/IdentifierBuilder.php b/Classes/Cache/IdentifierBuilder.php index 2262eaece38..a95da3a4c06 100644 --- a/Classes/Cache/IdentifierBuilder.php +++ b/Classes/Cache/IdentifierBuilder.php @@ -37,6 +37,8 @@ public function getFilepath(string $requestUri): string $parts['path'] = rawurldecode($parts['path']); } + // @todo add Event + $absoluteBasePath = GeneralUtility::makeInstance(CacheService::class)->getAbsoluteBaseDirectory(); $resultPath = GeneralUtility::resolveBackPath($absoluteBasePath . implode('/', $parts)); diff --git a/Classes/Cache/Listener/EnableListener.php b/Classes/Cache/Listener/EnableListener.php index ed7314b30c6..843929a0f2d 100644 --- a/Classes/Cache/Listener/EnableListener.php +++ b/Classes/Cache/Listener/EnableListener.php @@ -4,11 +4,9 @@ namespace SFC\Staticfilecache\Cache\Listener; -use Psr\Http\Message\ServerRequestInterface; use SFC\Staticfilecache\Event\CacheRuleEvent; use SFC\Staticfilecache\Service\ConfigurationService; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; class EnableListener { diff --git a/Classes/Cache/Listener/NoBackendUserListener.php b/Classes/Cache/Listener/NoBackendUserListener.php index 920d3514fa6..ac677c7cb85 100644 --- a/Classes/Cache/Listener/NoBackendUserListener.php +++ b/Classes/Cache/Listener/NoBackendUserListener.php @@ -6,7 +6,6 @@ use SFC\Staticfilecache\Event\CacheRuleEvent; use TYPO3\CMS\Core\Context\Context; -use TYPO3\CMS\Core\Utility\GeneralUtility; /** * No active BE user. diff --git a/Classes/Cache/Listener/NoUserOrGroupSetListener.php b/Classes/Cache/Listener/NoUserOrGroupSetListener.php index 7ca3d3fbc4d..027d7a5fb37 100644 --- a/Classes/Cache/Listener/NoUserOrGroupSetListener.php +++ b/Classes/Cache/Listener/NoUserOrGroupSetListener.php @@ -4,7 +4,6 @@ namespace SFC\Staticfilecache\Cache\Listener; -use Psr\Http\Message\ServerRequestInterface; use SFC\Staticfilecache\Event\CacheRuleEvent; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Context\Exception\AspectNotFoundException; diff --git a/Classes/Cache/Listener/NoWorkspacePreviewListener.php b/Classes/Cache/Listener/NoWorkspacePreviewListener.php index 88e179b6a50..bd1c4ad7a07 100644 --- a/Classes/Cache/Listener/NoWorkspacePreviewListener.php +++ b/Classes/Cache/Listener/NoWorkspacePreviewListener.php @@ -4,7 +4,6 @@ namespace SFC\Staticfilecache\Cache\Listener; -use Psr\Http\Message\ServerRequestInterface; use SFC\Staticfilecache\Event\CacheRuleEvent; use TYPO3\CMS\Core\Context\Context; diff --git a/Classes/Cache/Listener/SiteCacheableListener.php b/Classes/Cache/Listener/SiteCacheableListener.php index 6b421c50142..80c47572574 100644 --- a/Classes/Cache/Listener/SiteCacheableListener.php +++ b/Classes/Cache/Listener/SiteCacheableListener.php @@ -4,7 +4,6 @@ namespace SFC\Staticfilecache\Cache\Listener; -use Psr\Http\Message\ServerRequestInterface; use SFC\Staticfilecache\Event\CacheRuleEvent; use TYPO3\CMS\Core\Site\Entity\Site; diff --git a/Classes/Cache/Listener/ValidDoktypeListener.php b/Classes/Cache/Listener/ValidDoktypeListener.php index 97f0f402002..c8be72ab52b 100644 --- a/Classes/Cache/Listener/ValidDoktypeListener.php +++ b/Classes/Cache/Listener/ValidDoktypeListener.php @@ -4,7 +4,6 @@ namespace SFC\Staticfilecache\Cache\Listener; -use Psr\Http\Message\ServerRequestInterface; use SFC\Staticfilecache\Event\CacheRuleEvent; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; diff --git a/Classes/Cache/Listener/ValidPageInformationListener.php b/Classes/Cache/Listener/ValidPageInformationListener.php index 054e20d2f98..4baca99f635 100644 --- a/Classes/Cache/Listener/ValidPageInformationListener.php +++ b/Classes/Cache/Listener/ValidPageInformationListener.php @@ -4,7 +4,6 @@ namespace SFC\Staticfilecache\Cache\Listener; -use Psr\Http\Message\ServerRequestInterface; use SFC\Staticfilecache\Event\CacheRuleEvent; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; diff --git a/Classes/Cache/RemoteFileBackend.php b/Classes/Cache/RemoteFileBackend.php index ed798bc3b33..3408557e07f 100644 --- a/Classes/Cache/RemoteFileBackend.php +++ b/Classes/Cache/RemoteFileBackend.php @@ -42,17 +42,13 @@ class RemoteFileBackend extends AbstractBackend implements TaggableBackendInterf /** * Is freezed? - * - * @var bool */ - protected $freeze = false; + protected bool $freeze = false; /** * Hash length. - * - * @var int */ - protected $hashLength = 3; + protected int $hashLength = 3; /** * Set hash length. diff --git a/Classes/Cache/StaticDatabaseBackend.php b/Classes/Cache/StaticDatabaseBackend.php index 1064a63bc30..3effd0af4dd 100644 --- a/Classes/Cache/StaticDatabaseBackend.php +++ b/Classes/Cache/StaticDatabaseBackend.php @@ -19,9 +19,6 @@ abstract class StaticDatabaseBackend extends Typo3DatabaseBackend implements Log { use LoggerAwareTrait; - /** - * Configuration. - */ protected ConfigurationService $configuration; /** diff --git a/Classes/Cache/StaticFileBackend.php b/Classes/Cache/StaticFileBackend.php index 591876d0abf..1422a09c14c 100644 --- a/Classes/Cache/StaticFileBackend.php +++ b/Classes/Cache/StaticFileBackend.php @@ -97,7 +97,6 @@ public function set($entryIdentifier, $data, array $tags = [], $lifetime = null) $this->removeStaticFiles($entryIdentifier); - $this->eventDispatcher->dispatch(new GeneratorCreate($entryIdentifier, $fileName, $data, $realLifetime)); } catch (\Exception $exception) { $this->logger->error('Error in cache create process', ['exception' => $exception]); diff --git a/Classes/Command/BoostQueueCommand.php b/Classes/Command/BoostQueueCommand.php index 8a2043a871d..046cc5014d9 100644 --- a/Classes/Command/BoostQueueCommand.php +++ b/Classes/Command/BoostQueueCommand.php @@ -4,7 +4,6 @@ namespace SFC\Staticfilecache\Command; -use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException; use SFC\Staticfilecache\Domain\Repository\QueueRepository; use SFC\Staticfilecache\Service\QueueService; use Symfony\Component\Console\Input\InputInterface; diff --git a/Classes/Command/FlushCacheCommand.php b/Classes/Command/FlushCacheCommand.php index 9c8be2d2b86..c476facac25 100644 --- a/Classes/Command/FlushCacheCommand.php +++ b/Classes/Command/FlushCacheCommand.php @@ -4,8 +4,6 @@ namespace SFC\Staticfilecache\Command; -use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException; -use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheGroupException; use SFC\Staticfilecache\Service\CacheService; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index f2e8cbc0d73..684623189e7 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -8,9 +8,7 @@ use Psr\Log\LoggerAwareTrait; use SFC\Staticfilecache\Cache\UriFrontend; use TYPO3\CMS\Backend\Template\Components\Menu\Menu; -use TYPO3\CMS\Backend\Template\Components\Menu\MenuItem; use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; -use TYPO3\CMS\Core\Messaging\AbstractMessage; use Psr\Http\Message\ResponseInterface; use SFC\Staticfilecache\Domain\Repository\PageRepository; use SFC\Staticfilecache\Domain\Repository\QueueRepository; @@ -23,7 +21,6 @@ use TYPO3\CMS\Backend\Template\ModuleTemplateFactory; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; diff --git a/Classes/Domain/Repository/CacheRepository.php b/Classes/Domain/Repository/CacheRepository.php index 47d049e1f85..33a479b7c05 100644 --- a/Classes/Domain/Repository/CacheRepository.php +++ b/Classes/Domain/Repository/CacheRepository.php @@ -9,9 +9,6 @@ use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * CacheRepository. - */ class CacheRepository extends AbstractRepository { /** diff --git a/Classes/Event/GeneratorConfigManipulationEvent.php b/Classes/Event/GeneratorConfigManipulationEvent.php index da21a544d73..2d9cbda09c8 100644 --- a/Classes/Event/GeneratorConfigManipulationEvent.php +++ b/Classes/Event/GeneratorConfigManipulationEvent.php @@ -4,8 +4,6 @@ namespace SFC\Staticfilecache\Event; -use Psr\Http\Message\ResponseInterface; - final class GeneratorConfigManipulationEvent { public function __construct( diff --git a/Classes/Event/GeneratorContentManipulationEvent.php b/Classes/Event/GeneratorContentManipulationEvent.php index e2e58853926..b90e8ec528b 100644 --- a/Classes/Event/GeneratorContentManipulationEvent.php +++ b/Classes/Event/GeneratorContentManipulationEvent.php @@ -4,8 +4,6 @@ namespace SFC\Staticfilecache\Event; -use Psr\Http\Message\ResponseInterface; - final class GeneratorContentManipulationEvent { public function __construct( diff --git a/Classes/Generator/AbstractGenerator.php b/Classes/Generator/AbstractGenerator.php index 2c78ce90eaf..56354430d2d 100644 --- a/Classes/Generator/AbstractGenerator.php +++ b/Classes/Generator/AbstractGenerator.php @@ -5,7 +5,6 @@ namespace SFC\Staticfilecache\Generator; use Psr\EventDispatcher\EventDispatcherInterface; -use Psr\Http\Message\ResponseInterface; use SFC\Staticfilecache\Event\GeneratorCreate; use SFC\Staticfilecache\Event\GeneratorRemove; use SFC\Staticfilecache\Service\ConfigurationService; @@ -43,7 +42,7 @@ protected function renderTemplateToFile(string $templateName, array $variables, $renderer = GeneralUtility::makeInstance(StandaloneView::class); $renderer->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateName)); $renderer->assignMultiple($variables); - $content = trim((string) $renderer->render()); + $content = trim($renderer->render()); // Note: Create even empty htaccess files (do not check!!!), so the delete is in sync $this->writeFile($htaccessFile, $content); } diff --git a/Classes/Generator/BrotliGenerator.php b/Classes/Generator/BrotliGenerator.php index 4d73e294c6c..3dee6bd1097 100644 --- a/Classes/Generator/BrotliGenerator.php +++ b/Classes/Generator/BrotliGenerator.php @@ -4,14 +4,11 @@ namespace SFC\Staticfilecache\Generator; -use Psr\Http\Message\ResponseInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; use SFC\Staticfilecache\Event\GeneratorContentManipulationEvent; use SFC\Staticfilecache\Event\GeneratorCreate; use SFC\Staticfilecache\Event\GeneratorRemove; -use SFC\Staticfilecache\Service\RemoveService; -use TYPO3\CMS\Core\Utility\GeneralUtility; class BrotliGenerator extends AbstractGenerator implements LoggerAwareInterface { diff --git a/Classes/Generator/ConfigGenerator.php b/Classes/Generator/ConfigGenerator.php index 5eeb12af624..36c77844855 100644 --- a/Classes/Generator/ConfigGenerator.php +++ b/Classes/Generator/ConfigGenerator.php @@ -4,12 +4,10 @@ namespace SFC\Staticfilecache\Generator; -use Psr\Http\Message\ResponseInterface; use SFC\Staticfilecache\Event\GeneratorConfigManipulationEvent; use SFC\Staticfilecache\Event\GeneratorCreate; use SFC\Staticfilecache\Event\GeneratorRemove; use SFC\Staticfilecache\Service\ConfigurationService; -use SFC\Staticfilecache\Service\RemoveService; use TYPO3\CMS\Core\Utility\GeneralUtility; class ConfigGenerator extends AbstractGenerator diff --git a/Classes/Generator/GzipGenerator.php b/Classes/Generator/GzipGenerator.php index 82909de25a4..128364c6938 100644 --- a/Classes/Generator/GzipGenerator.php +++ b/Classes/Generator/GzipGenerator.php @@ -4,12 +4,9 @@ namespace SFC\Staticfilecache\Generator; -use Psr\Http\Message\ResponseInterface; use SFC\Staticfilecache\Event\GeneratorContentManipulationEvent; use SFC\Staticfilecache\Event\GeneratorCreate; use SFC\Staticfilecache\Event\GeneratorRemove; -use SFC\Staticfilecache\Service\RemoveService; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; class GzipGenerator extends AbstractGenerator diff --git a/Classes/Generator/HtaccessGenerator.php b/Classes/Generator/HtaccessGenerator.php index 0c19ca9d511..e07d7f0b24e 100644 --- a/Classes/Generator/HtaccessGenerator.php +++ b/Classes/Generator/HtaccessGenerator.php @@ -4,15 +4,12 @@ namespace SFC\Staticfilecache\Generator; -use Psr\Http\Message\ResponseInterface; use SFC\Staticfilecache\Event\GeneratorCreate; use SFC\Staticfilecache\Event\GeneratorRemove; use SFC\Staticfilecache\Service\ConfigurationService; use SFC\Staticfilecache\Service\DateTimeService; -use SFC\Staticfilecache\Service\RemoveService; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\PathUtility; -use TYPO3\CMS\Fluid\View\StandaloneView; class HtaccessGenerator extends AbstractGenerator { diff --git a/Classes/Generator/PhpGenerator.php b/Classes/Generator/PhpGenerator.php index f69f73766ba..a05cbf6893a 100644 --- a/Classes/Generator/PhpGenerator.php +++ b/Classes/Generator/PhpGenerator.php @@ -4,19 +4,13 @@ namespace SFC\Staticfilecache\Generator; -use Psr\Http\Message\ResponseInterface; use SFC\Staticfilecache\Event\GeneratorContentManipulationEvent; use SFC\Staticfilecache\Event\GeneratorCreate; use SFC\Staticfilecache\Event\GeneratorRemove; use SFC\Staticfilecache\Service\ConfigurationService; use SFC\Staticfilecache\Service\DateTimeService; -use SFC\Staticfilecache\Service\RemoveService; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\PathUtility; -/** - * PlainGenerator. - */ class PhpGenerator extends HtaccessGenerator { public function generate(GeneratorCreate $generatorCreateEvent): void diff --git a/Classes/Middleware/FallbackMiddleware.php b/Classes/Middleware/FallbackMiddleware.php index f0427d57b90..131159b36db 100644 --- a/Classes/Middleware/FallbackMiddleware.php +++ b/Classes/Middleware/FallbackMiddleware.php @@ -58,6 +58,7 @@ protected function handleViaFallback(ServerRequestInterface $request): ResponseI throw new Exception('StaticFileCache Cookie is set', 12738912); } + // @todo ID Buulder with DI $possibleStaticFile = GeneralUtility::makeInstance(IdentifierBuilder::class)->getFilepath((string) $uri); $headers = $this->getHeaders($event->getRequest(), $possibleStaticFile); diff --git a/Classes/Middleware/GenerateMiddleware.php b/Classes/Middleware/GenerateMiddleware.php index 9a48bce7591..95ac30ab1c6 100644 --- a/Classes/Middleware/GenerateMiddleware.php +++ b/Classes/Middleware/GenerateMiddleware.php @@ -5,10 +5,8 @@ namespace SFC\Staticfilecache\Middleware; use Psr\Http\Message\RequestInterface; -use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Cache\CacheDataCollector; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; -use TYPO3\CMS\Core\Context\Context; use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; diff --git a/Classes/Service/CacheService.php b/Classes/Service/CacheService.php index b9013b92d7e..58dc5f5cc67 100644 --- a/Classes/Service/CacheService.php +++ b/Classes/Service/CacheService.php @@ -4,13 +4,11 @@ namespace SFC\Staticfilecache\Service; -use SFC\Staticfilecache\Cache\UriFrontend; use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheGroupException; use SFC\Staticfilecache\Domain\Repository\QueueRepository; use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; -use TYPO3\CMS\Core\Cache\Frontend\VariableFrontend; use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Service/CookieService.php b/Classes/Service/CookieService.php index 6f45e7bba53..b39279274b7 100644 --- a/Classes/Service/CookieService.php +++ b/Classes/Service/CookieService.php @@ -6,7 +6,6 @@ use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; -use SFC\Staticfilecache\Service\DateTimeService; use TYPO3\CMS\Core\Utility\GeneralUtility; /** diff --git a/Classes/Service/InlineAssets/AbstractInlineAssets.php b/Classes/Service/InlineAssets/AbstractInlineAssets.php index 1a561eeac91..52dcc350b02 100644 --- a/Classes/Service/InlineAssets/AbstractInlineAssets.php +++ b/Classes/Service/InlineAssets/AbstractInlineAssets.php @@ -9,8 +9,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; /** - * Class AbstractInlineFiles. - * * @author Marcus Förster ; https://github.com/xerc */ abstract class AbstractInlineAssets diff --git a/Classes/Service/InlineAssets/InlineFavIcon.php b/Classes/Service/InlineAssets/InlineFavIcon.php index 76d38850d6a..ae9f0b706f0 100644 --- a/Classes/Service/InlineAssets/InlineFavIcon.php +++ b/Classes/Service/InlineAssets/InlineFavIcon.php @@ -5,8 +5,6 @@ namespace SFC\Staticfilecache\Service\InlineAssets; /** - * Class InlineFavIcon. - * * @author Marcus Förster ; https://github.com/xerc */ class InlineFavIcon extends AbstractInlineAssets diff --git a/Classes/Service/InlineAssets/InlineImages.php b/Classes/Service/InlineAssets/InlineImages.php index 2294942fd18..7dbe3854a25 100644 --- a/Classes/Service/InlineAssets/InlineImages.php +++ b/Classes/Service/InlineAssets/InlineImages.php @@ -5,8 +5,6 @@ namespace SFC\Staticfilecache\Service\InlineAssets; /** - * Class InlineImages. - * * @author Marcus Förster ; https://github.com/xerc */ class InlineImages extends AbstractInlineAssets diff --git a/Classes/Service/InlineAssets/InlineScripts.php b/Classes/Service/InlineAssets/InlineScripts.php index a6242de6829..5b8438b185a 100644 --- a/Classes/Service/InlineAssets/InlineScripts.php +++ b/Classes/Service/InlineAssets/InlineScripts.php @@ -5,8 +5,6 @@ namespace SFC\Staticfilecache\Service\InlineAssets; /** - * Class InlineScripts. - * * @author Marcus Förster ; https://github.com/xerc */ class InlineScripts extends AbstractInlineAssets diff --git a/Classes/Service/InlineAssets/InlineStyles.php b/Classes/Service/InlineAssets/InlineStyles.php index f472dff1f22..875cf4f2af6 100644 --- a/Classes/Service/InlineAssets/InlineStyles.php +++ b/Classes/Service/InlineAssets/InlineStyles.php @@ -5,8 +5,6 @@ namespace SFC\Staticfilecache\Service\InlineAssets; /** - * Class InlineStyles. - * * @author Marcus Förster ; https://github.com/xerc */ class InlineStyles extends AbstractInlineAssets diff --git a/Classes/Service/InlineAssetsService.php b/Classes/Service/InlineAssetsService.php index 99e47095f09..d0a310b556b 100644 --- a/Classes/Service/InlineAssetsService.php +++ b/Classes/Service/InlineAssetsService.php @@ -7,8 +7,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; /** - * Class InlineAssetsService. - * * @author Marcus Förster ; https://github.com/xerc */ class InlineAssetsService diff --git a/Classes/Service/QueueService.php b/Classes/Service/QueueService.php index fb140ffb9f0..9d4dacac3fd 100644 --- a/Classes/Service/QueueService.php +++ b/Classes/Service/QueueService.php @@ -11,8 +11,6 @@ use SFC\Staticfilecache\Domain\Repository\QueueRepository; /** - * Queue service. - * * @see BoostQueueCommand */ class QueueService implements LoggerAwareInterface diff --git a/Documentation/Extended/Index.rst b/Documentation/Extended/Index.rst new file mode 100755 index 00000000000..20f099ca64c --- /dev/null +++ b/Documentation/Extended/Index.rst @@ -0,0 +1,35 @@ +.. include:: /Includes.rst.txt + +.. _extended: + +Extended +======== + +Events +------ + +There are several Events to extend the functionality of EXT:staticfilecache. The following list contains all events and a short description of the execution. + +- `SFC\Staticfilecache\Event\BuildClientEvent` Executed in the client build process to modify options of the HTTP client for the boost mode queue. +- `SFC\Staticfilecache\Event\CacheRuleEvent` Executed in the PrepareMiddleware to check if the current page is static cacheable. +- `SFC\Staticfilecache\Event\CacheRuleFallbackEvent` Executed in the FallbackMiddleware to check if the current page is delivered via FallbackMiddleware. +- `SFC\Staticfilecache\Event\ForceStaticFileCacheEvent` Executed in the ForceStaticCacheListener to force the generation of static file cache files. +- `SFC\Staticfilecache\Event\GeneratorConfigManipulationEvent` Executed in the ConfigGenerator do modify the stored data. +- `SFC\Staticfilecache\Event\GeneratorContentManipulationEvent` Executed from all content related Generator to modify the content in front of the storage. +- `SFC\Staticfilecache\Event\GeneratorCreate` Executed to trigger the Generators to store static files. +- `SFC\Staticfilecache\Event\GeneratorRemove` Executed to trigger the Generators to remove static files. +- `SFC\Staticfilecache\Event\HttpPushHeaderEvent` Executed in the HttpPushService to handle different types of push handlers. +- `SFC\Staticfilecache\Event\PreGenerateEvent` Executed in the GenerateMiddleware in front of the business logic of the middleware. + +Middleware +---------- + +The EXT:staticfilecache uses middlewares to implement the logic of the cache into the core. These middlewares are easily to extend/replace. The following list describe the different middlewares: + +- `SFC\Staticfilecache\Middleware\CookieCheckMiddleware` Check if there is a frontend cookie and invalid user session. Then remove the cookie. +- `SFC\Staticfilecache\Middleware\FallbackMiddleware` Handle the fallback, if there is a static file but no redirect via nginx/htaccess. +- `SFC\Staticfilecache\Middleware\FrontendCacheMiddleware` Preparation for new caching mechanisms of TYPO3 v13 (currently disabled). +- `SFC\Staticfilecache\Middleware\FrontendUserMiddleware` Handle the user session in the right way. +- `SFC\Staticfilecache\Middleware\GenerateMiddleware` Write the content into the StaticFileCache structure. +- `SFC\Staticfilecache\Middleware\PrepareMiddleware` Check if the content is cacheable in the StaticFileCache structure. + diff --git a/Documentation/Index.rst b/Documentation/Index.rst index e696f4ede20..b6979ef888d 100755 --- a/Documentation/Index.rst +++ b/Documentation/Index.rst @@ -132,6 +132,7 @@ ones with this one if possible. Introduction/Index Installation/Index Configuration/Index + Extended/Index Monitoring/Index StaticDynamic/Index Faq/Index