Skip to content

Commit

Permalink
⬆️ add TYPO3 11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanti committed Nov 2, 2022
1 parent 77fc0a4 commit ebf5991
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 18 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tasks

on: [push, pull_request]

jobs:
lint-php:
name: "php: ${{ matrix.php }} TYPO3: ${{ matrix.typo3 }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1' ]
typo3: [ '10', '11' ]
exclude:
- php: '8.0'
typo3: '10'
- php: '8.1'
typo3: '10'
steps:
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-composer-
- run: composer require typo3/minimal="^${{ matrix.typo3 }}" --dev
- run: composer install --no-interaction --no-progress
- run: ./vendor/bin/grumphp run --ansi

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.idea/
vendor
public
composer.lock
2 changes: 1 addition & 1 deletion Classes/Middleware/MinifyMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
$html = $body->getContents();

$minifyService = GeneralUtility::makeInstance(MinifyService::class);
assert($minifyService instanceof MinifyService);
$html = $minifyService->minify($html);
$body = new Stream('php://temp', 'wb+');
$body->write($html);
$response = $response->withBody($body);
}
return $response;
}

}
49 changes: 36 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
{
"name": "pluswerk/minify",
"type": "typo3-cms-extension",
"description": "Pluswerk: Minify - Minifies your html",
"homepage": "https://www.pluswerk.ag",
"license": "GPL-2.0-or-later",
"support": {
"source": "https://www.pluswerk.ag"
"name" : "pluswerk/minify",
"type" : "typo3-cms-extension",
"description" : "Pluswerk: Minify - Minifies your html",
"homepage" : "https://www.pluswerk.ag",
"license" : "GPL-2.0-or-later",
"support" : {
"source" : "https://github.com/pluswerk/minify"
},
"autoload": {
"psr-4": {
"Pluswerk\\PlusMinify\\": "Classes/"
"autoload" : {
"psr-4" : {
"Pluswerk\\PlusMinify\\" : "Classes/"
}
},
"require": {
"typo3/cms-core": "^10.4",
"voku/html-min": "*"
"config": {
"allow-plugins": {
"typo3/cms-composer-installers": true,
"typo3/class-alias-loader": true,
"phpro/grumphp": true,
"pluswerk/grumphp-config": true
},
"sort-packages": true
},
"extra" : {
"typo3/cms" : {
"extension-key" : "minify"
},
"pluswerk/grumphp-config": {
"auto-setting": true
},
"grumphp": {
"config-default-path": "vendor/pluswerk/grumphp-config/grumphp.yml"
}
},
"require" : {
"php": "~7.4 || ~8.0 || ~8.1",
"composer-runtime-api": "^2",
"pluswerk/grumphp-config": "^5.0",
"typo3/cms-core": "^10.4 || ^11.5",
"voku/html-min": "^4"
}
}
8 changes: 4 additions & 4 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
'internal' => '',
'uploadfolder' => '0',
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '1.1.2',
'constraints' =>[
'clearCacheOnLoad' => false,
'version' => \Composer\InstalledVersions::getPrettyVersion('pluswerk/minify'),
'constraints' => [
'depends' => [
'typo3' => '10.99.99',
'typo3' => '10.4.0 - 11.99.99',
],
'conflicts' => [],
'suggests' => [],
Expand Down

0 comments on commit ebf5991

Please sign in to comment.