start([], []); $dataHandler->clear_cacheCmd($pageUid); } /** * Clears cache for each page of the site * * @param int $pageUid */ public static function clearSiteCache(int $pageUid) { $pageRepository = new \Opentalent\OtTemplating\Page\OtPageRepository(); $rootPage = $pageRepository->getRootPageFor($pageUid); $pages = $pageRepository->getAllSubpagesForPage($rootPage['uid']); $dataHandler = GeneralUtility::makeInstance(DataHandler::class); $dataHandler->start([], []); foreach ($pages as $page) { $dataHandler->clear_cacheCmd($page['uid']); } } /** * Clear cache framework and opcode caches * (@see TYPO3\CMS\Install\Controller\MaintenanceController ) */ public static function clearAllCache(): ResponseInterface { GeneralUtility::makeInstance(ClearCacheService::class)->clearAll(); GeneralUtility::makeInstance(OpcodeCacheService::class)->clearAllActive(); } /** * Clear typo3temp/assets * (@see TYPO3\CMS\Install\Controller\MaintenanceController ) */ public static function clearAssetsTempfiles() { $typo3tempFileService = GeneralUtility::makeInstance(Typo3tempFileService::class); try { $typo3tempFileService->clearAssetsFolder("/typo3temp/assets/css"); } catch (RuntimeException $e) { // 1501781454 code means directory does not exist, we can ignore this error if ($e->getCode() != 1501781454) { throw $e; } } try { $typo3tempFileService->clearAssetsFolder("/typo3temp/assets/js"); } catch (RuntimeException $e) { // 1501781454 code means directory does not exist, we can ignore this error if ($e->getCode() != 1501781454) { throw $e; } } } }