diff --git a/composer.json b/composer.json index 0b995bff..9574934c 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "georgringer/news": "^8.5", "gridelementsteam/gridelements": "^10.0", "helhum/typo3-console": "^6.4", + "jweiland/replacer": "^2.1", "kigkonsult/icalcreator": "^2.29", "league/csv": "^9.2", "league/oauth2-client": "^2.8", diff --git a/composer.lock b/composer.lock index 4d7f9f16..5b5790a1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0842a6e9476f96ae559c7d2e900c3be2", + "content-hash": "e3a433b77a2142f116e57b54c4172ffa", "packages": [ { "name": "b13/container", @@ -1583,6 +1583,72 @@ ], "time": "2023-01-08T21:22:53+00:00" }, + { + "name": "jweiland/replacer", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/jweiland-net/replacer.git", + "reference": "feec487ea9c3573d1e8d80245dd9763352492357" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jweiland-net/replacer/zipball/feec487ea9c3573d1e8d80245dd9763352492357", + "reference": "feec487ea9c3573d1e8d80245dd9763352492357", + "shasum": "" + }, + "require": { + "typo3/cms-core": "^9.5 || ^10.4 || ^11.0" + }, + "replace": { + "typo3-ter/replacer": "self.version" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.0", + "nimut/testing-framework": "^6.0", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "roave/security-advisories": "dev-latest" + }, + "type": "typo3-cms-extension", + "extra": { + "typo3/cms": { + "app-dir": ".build", + "web-dir": ".build/public", + "extension-key": "replacer" + } + }, + "autoload": { + "psr-4": { + "JWeiland\\Replacer\\": "Classes" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Pascal Rinker", + "email": "projects@jweiland.net", + "role": "Developer" + } + ], + "description": "Replaces string patterns from the page. You can use it to replace URLs for Content Delivery Network (CDN).", + "homepage": "http://www.jweiland.net", + "keywords": [ + "TYPO3 CMS", + "jw", + "replacer", + "typo3" + ], + "support": { + "email": "projects@jweiland.net", + "issues": "https://github.com/jweiland-net/replacer/issues", + "source": "https://github.com/jweiland-net/replacer" + }, + "time": "2022-06-02T09:29:20+00:00" + }, { "name": "kigkonsult/icalcreator", "version": "v2.39.2", diff --git a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/Replacer.typoscript b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/Replacer.typoscript new file mode 100644 index 00000000..770c49bc --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/Extensions/Replacer.typoscript @@ -0,0 +1,10 @@ +config.tx_replacer { + enable_regex = 1 + search { + 10 = /"\/?(fileadmin|typo3temp|uploads)/ + } + + replace { + 10 = "https://cdn.ep-reisen.de/$1 + } +}