Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions Classes/ResourcePusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,6 @@ public function pushAll(array $resources)
}
}

/**
* @param array $params
* @param TypoScriptFrontendController $typoScriptFrontendController
* @internal this is just a hook implementation. can be removed when TYPO3 v9 support is removed.
*/
public function pushForFrontend(array $params, TypoScriptFrontendController $typoScriptFrontendController)
{
$allResources = $typoScriptFrontendController->config['b13/http2'] ?? null;
if ($this->useHook() && GeneralUtility::getIndpEnv('TYPO3_SSL') && is_array($allResources)) {
$this->pushAll($allResources);
}
}

/**
* as="{style/script/image}"
*
Expand All @@ -61,12 +48,4 @@ protected function addPreloadHeader(string $uri, string $type)
{
header('Link: <' . htmlspecialchars(PathUtility::getAbsoluteWebPath($uri)) . '>; rel=preload; as=' . $type, false);
}

protected function useHook(): bool
{
if (class_exists(Typo3Version::class) && (new Typo3Version())->getMajorVersion() >= 10) {
return false;
}
return true;
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This TYPO3 extension fetches all CSS and JS resources that are used
for a page-rendering and sends additional HTTP/2 Headers "Link" for each resource
resulting in a faster first contentful paint for TYPO3 CMS.

This extension currently runs on TYPO3 v7, TYPO3 v8, TYPO3 v9, TYPO3 v10 and TYPO3 v11,
and needs PHP 7.0 or higher.
This extension currently runs on TYPO3 v10, TYPO3 v11 and TYPO3 v12,
and needs PHP 7.4 or higher.

## Installation

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"type": "typo3-cms-extension",
"description": "Speed up TYPO3 rendering via HTTP/2 Server Push",
"require": {
"php": "^7.0 || ^8.0",
"php": "^7.4 || ^8.0",
"psr/http-server-middleware": "^1.0",
"typo3/cms-core": "^7.6 || ^8.7 || ^9.5 || ^10.0 || ^11.0",
"typo3/cms-frontend": "^7.6 || ^8.7 || ^9.5 || ^10.0 || ^11.0"
"typo3/cms-core": "^10.0 || ^11.0 || ^12.0",
"typo3/cms-frontend": "^10.0 || ^11.0 || ^12.0"
},
"require-dev": {
"phpunit/phpunit": "~7.0",
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
'title' => 'HTTP2 Server Push Support for TYPO3',
'description' => '',
'category' => 'extension',
'version' => '1.1.1',
'version' => '2.0.0',
'state' => 'stable',
'clearcacheonload' => 1,
'author' => 'b13 GmbH',
'author_email' => 'typo3@b13.com',
'author_company' => 'b13 GmbH',
'constraints' => [
'depends' => [
'typo3' => '7.6.0-11.99.99',
'typo3' => '10.4.0-12.99.99',
],
],
];
5 changes: 1 addition & 4 deletions ext_localconf.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
defined('TYPO3_MODE') or die();
defined('TYPO3') or die();

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess']['b13/http2'] = B13\Http2\PageRendererHook::class . '->accumulateResources';

// can be removed as soon as TYPO3 v9 support is dropped, as this is now taken care of by a middleware
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output']['b13/http2'] = B13\Http2\ResourcePusher::class . '->pushForFrontend';