Skip to content
Snippets Groups Projects
Commit 5c5c2986 authored by Georgi's avatar Georgi
Browse files

Merge branch 'feature/typo3_v13_support'

parents 6a0f6c14 d8ad27e0
No related branches found
No related tags found
1 merge request!14Feature/typo3 v13 support
...@@ -40,6 +40,7 @@ use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection; ...@@ -40,6 +40,7 @@ use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection;
use TYPO3\CMS\Core\Resource\FileReference; use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Resource\FileRepository; use TYPO3\CMS\Core\Resource\FileRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Service\ImageService; use TYPO3\CMS\Extbase\Service\ImageService;
...@@ -98,6 +99,13 @@ class VimeoController extends ActionController { ...@@ -98,6 +99,13 @@ class VimeoController extends ActionController {
} }
} }
$typo3Version = VersionNumberUtility::getCurrentTypo3Version();
if (version_compare($typo3Version, '13.0.0', '<')) {
$disableVimeoCache = (bool) GeneralUtility::_GP('disableVimeoCache');
} else {
$disableVimeoCache = (bool) ($this->request->getParsedBody()['disableVimeoCache'] ?? $this->request->getQueryParams()['disableVimeoCache'] ?? null);
}
// Add third-party filters // Add third-party filters
$filterInstances = $this->handleFrontendFilters($filterValues); $filterInstances = $this->handleFrontendFilters($filterValues);
......
...@@ -26,39 +26,51 @@ ...@@ -26,39 +26,51 @@
namespace SGalinski\SgVimeo\Filter; namespace SGalinski\SgVimeo\Filter;
class FilterParameterBag { class FilterParameterBag {
protected array $parameters; protected array $parameters;
protected array $filterInstances; protected array $filterInstances;
protected bool $disableCache = FALSE;
public function __construct(array $parameters = [], array $filterInstances = []) { public function __construct(array $parameters = [], array $filterInstances = [], bool $disableCache = FALSE) {
$this->parameters = $parameters; $this->parameters = $parameters;
$this->filterInstances = $filterInstances; $this->filterInstances = $filterInstances;
} $this->disableCache = $disableCache;
}
public function get(string $key, $default = NULL) { public function get(string $key, $default = NULL) {
return $this->parameters[$key] ?? $default; return $this->parameters[$key] ?? $default;
} }
public function set(string $key, $value): void { public function set(string $key, $value): void {
$this->parameters[$key] = $value; $this->parameters[$key] = $value;
} }
public function all(): array { public function all(): array {
return $this->parameters; return $this->parameters;
} }
public function remove(string $key): void { public function remove(string $key): void {
unset($this->parameters[$key]); unset($this->parameters[$key]);
} }
public function merge(array $parameters): void { public function merge(array $parameters): void {
$this->parameters = array_merge($this->parameters, $parameters); $this->parameters = array_merge($this->parameters, $parameters);
} }
public function getFilterInstances(): array { public function getFilterInstances(): array {
return $this->filterInstances; return $this->filterInstances;
} }
public function setFilterInstances(array $filterInstances): void { public function setFilterInstances(array $filterInstances): void {
$this->filterInstances = $filterInstances; $this->filterInstances = $filterInstances;
} }
public function getDisableCache(): bool
{
return $this->disableCache;
}
public function setDisableCache(bool $disableCache): void
{
$this->disableCache = $disableCache;
}
} }
...@@ -129,12 +129,13 @@ class LicenceCheckService { ...@@ -129,12 +129,13 @@ class LicenceCheckService {
'4.2.0' => 1717678615, // Tue, 06 Jun 2023 14:57:50 GMT '4.2.0' => 1717678615, // Tue, 06 Jun 2023 14:57:50 GMT
'5.0.0' => 1729271668, // Tue, 18 Oct 2024 20:15:50 GMT+3 '5.0.0' => 1729271668, // Tue, 18 Oct 2024 20:15:50 GMT+3
'5.0.1' => 1732058531, // Tue, 19 Nov 2024 23:15:50 GMT+3 '5.0.1' => 1732058531, // Tue, 19 Nov 2024 23:15:50 GMT+3
'5.1.0' => 1733341275, // Wed, 04 Dez 2024 20:57:50 GMT+3
]; ];
/** /**
* The current extension version * The current extension version
*/ */
public const CURRENT_VERSION = '5.0.0'; public const CURRENT_VERSION = '5.1.0';
/** /**
* @param mixed $validUntil A timestamp, which says the lifetime of this key. * @param mixed $validUntil A timestamp, which says the lifetime of this key.
......
...@@ -145,7 +145,7 @@ class VimeoService implements LoggerAwareInterface { ...@@ -145,7 +145,7 @@ class VimeoService implements LoggerAwareInterface {
$response = []; $response = [];
$this->maxResultsPerPage = $maxResults; $this->maxResultsPerPage = $maxResults;
$cacheKey = 'sg_vimeo' . sha1($vimeoId . $maxResults . $queryString . $filtersHash); $cacheKey = 'sg_vimeo' . sha1($vimeoId . $maxResults . $queryString . $filtersHash);
$disableVimeoCache = (bool) GeneralUtility::_GP('disableVimeoCache'); $disableVimeoCache = $parameterBag->getDisableCache();
if (!$disableVimeoCache) { if (!$disableVimeoCache) {
$cachedResult = $this->cache->get($cacheKey); $cachedResult = $this->cache->get($cacheKey);
if ($cachedResult) { if ($cachedResult) {
......
...@@ -6,7 +6,10 @@ use TYPO3\CMS\Extbase\Utility\ExtensionUtility; ...@@ -6,7 +6,10 @@ use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
$pluginSignature = ExtensionUtility::registerPlugin( $pluginSignature = ExtensionUtility::registerPlugin(
'SgVimeo', 'SgVimeo',
'Vimeo', 'Vimeo',
'Vimeo Videos' 'Vimeo Videos',
'extension-sg_vimeo',
'plugins',
'LLL:EXT:sg_vimeo/Resources/Private/Language/locallang.xlf:vimeoPluginDescription'
); );
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
ExtensionManagementUtility::addPiFlexFormValue( ExtensionManagementUtility::addPiFlexFormValue(
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
"description": "A solution for embedding Vimeo videos, playlists, or channels easily into TYPO3 pages.", "description": "A solution for embedding Vimeo videos, playlists, or channels easily into TYPO3 pages.",
"homepage": "https://www.sgalinski.de", "homepage": "https://www.sgalinski.de",
"license": "GPL-2.0-or-later", "license": "GPL-2.0-or-later",
"version": "5.0.1", "version": "5.1.0",
"require": { "require": {
"typo3/cms-core": "^12.4.0", "typo3/cms-core": "^12.4 || ^13.4",
"vimeo/vimeo-api": "^3.0" "vimeo/vimeo-api": "^3.0"
}, },
"replace": { "replace": {
......
...@@ -32,10 +32,10 @@ $EM_CONF['sg_vimeo'] = [ ...@@ -32,10 +32,10 @@ $EM_CONF['sg_vimeo'] = [
'author_email' => 'stefan@sgalinski.de', 'author_email' => 'stefan@sgalinski.de',
'author_company' => 'sgalinski Internet Services (https://www.sgalinski.de)', 'author_company' => 'sgalinski Internet Services (https://www.sgalinski.de)',
'state' => 'stable', 'state' => 'stable',
'version' => '5.0.1', 'version' => '5.1.0',
'constraints' => [ 'constraints' => [
'depends' => [ 'depends' => [
'typo3' => '12.4.0-12.4.99', 'typo3' => '12.4.0-13.4.99',
'php' => '8.1.0-8.3.99', 'php' => '8.1.0-8.3.99',
], ],
'conflicts' => [], 'conflicts' => [],
......
...@@ -6,6 +6,7 @@ use SGalinski\SgVimeo\Form\Element\LicenceStatus; ...@@ -6,6 +6,7 @@ use SGalinski\SgVimeo\Form\Element\LicenceStatus;
use SGalinski\SgVimeo\Hooks\LicenceCheckHook; use SGalinski\SgVimeo\Hooks\LicenceCheckHook;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility; use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sg_vimeo']['uncached'] ?? FALSE) { if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sg_vimeo']['uncached'] ?? FALSE) {
// Uncached version // Uncached version
...@@ -30,10 +31,13 @@ if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sg_vimeo']['uncached'] ?? FALSE) ...@@ -30,10 +31,13 @@ if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['sg_vimeo']['uncached'] ?? FALSE)
); );
} }
// include Plugin sg_twitter $currentTypo3Version = VersionNumberUtility::getCurrentTypo3Version();
ExtensionManagementUtility::addPageTSConfig( if (version_compare($currentTypo3Version, '13.0.0', '<')) {
'@import "EXT:sg_vimeo/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig"' // include Plugin sg_vimeo
); ExtensionManagementUtility::addPageTSConfig(
'@import "EXT:sg_vimeo/Configuration/TsConfig/Page/NewContentElementWizard.tsconfig"'
);
}
// Caching // Caching
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sgvimeo_cache'] ??= []; $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sgvimeo_cache'] ??= [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment