-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RELEASE] Version 12.3.0 with TYPO3 v12 compatibility
Resolves: https://projekte.in2code.de/issues/60649 Releases: https://projekte.in2code.de/issues/59509 Releases: https://projekte.in2code.de/issues/59779 Releases: https://projekte.in2code.de/issues/60080 Releases: https://projekte.in2code.de/issues/60123 Releases: https://projekte.in2code.de/issues/60135 Releases: https://projekte.in2code.de/issues/60145 Releases: https://projekte.in2code.de/issues/60147 Releases: https://projekte.in2code.de/issues/60149 Releases: https://projekte.in2code.de/issues/60157 Releases: https://projekte.in2code.de/issues/60226 Releases: https://projekte.in2code.de/issues/60425 Releases: https://projekte.in2code.de/issues/60448 Releases: https://projekte.in2code.de/issues/60449 Releases: https://projekte.in2code.de/issues/60455 Releases: https://projekte.in2code.de/issues/60460 Releases: https://projekte.in2code.de/issues/60487 Releases: https://projekte.in2code.de/issues/60674
- Loading branch information
Showing
253 changed files
with
6,266 additions
and
4,813 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace In2code\In2publishCore\Cache; | ||
|
||
/* | ||
* Copyright notice | ||
* | ||
* (c) 2023 in2code.de and the following authors: | ||
* Oliver Eglseder <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
* free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The GNU General Public License can be found at | ||
* http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This script is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
*/ | ||
|
||
use Closure; | ||
use In2code\In2publishCore\Cache\Exception\CacheableValueCanNotBeGeneratedException; | ||
use In2code\In2publishCore\CommonInjection\CacheInjection; | ||
use TYPO3\CMS\Core\SingletonInterface; | ||
|
||
use function array_key_exists; | ||
|
||
class CachedRuntimeCache implements SingletonInterface | ||
{ | ||
use CacheInjection; | ||
|
||
protected array $rtc = []; | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function get(string $key, Closure $valueFactory, int $ttl = 86400) | ||
{ | ||
if (!array_key_exists($key, $this->rtc)) { | ||
if (!$this->cache->has($key)) { | ||
try { | ||
$value = $valueFactory(); | ||
$this->cache->set($key, $value, [], $ttl); | ||
} catch (CacheableValueCanNotBeGeneratedException $exception) { | ||
$value = $exception->getValue(); | ||
} | ||
} else { | ||
$value = $this->cache->get($key); | ||
} | ||
$this->rtc[$key] = $value; | ||
} | ||
|
||
return $this->rtc[$key]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace In2code\In2publishCore\Cache; | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
trait CachedRuntimeCacheInjection | ||
{ | ||
protected CachedRuntimeCache $cachedRuntimeCache; | ||
|
||
/** | ||
* @noinspection PhpUnused | ||
*/ | ||
public function injectCachedRuntimeCache(CachedRuntimeCache $cachedRuntimeCache): void | ||
{ | ||
$this->cachedRuntimeCache = $cachedRuntimeCache; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Classes/Cache/Exception/CacheableValueCanNotBeGeneratedException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace In2code\In2publishCore\Cache\Exception; | ||
|
||
use In2code\In2publishCore\In2publishCoreException; | ||
use Throwable; | ||
|
||
class CacheableValueCanNotBeGeneratedException extends In2publishCoreException | ||
{ | ||
/** @var mixed */ | ||
private $value; | ||
|
||
/** | ||
* @param mixed $value | ||
*/ | ||
public function __construct($value, Throwable $previous = null) | ||
{ | ||
$this->value = $value; | ||
parent::__construct('', 1698857094, $previous); | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getValue() | ||
{ | ||
return $this->value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
Classes/CommonInjection/BackendUserAuthenticationInjection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace In2code\In2publishCore\CommonInjection; | ||
|
||
/* | ||
* Copyright notice | ||
* | ||
* (c) 2023 in2code.de and the following authors: | ||
* Daniel Hoffmann <[email protected]> | ||
* | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
* free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The GNU General Public License can be found at | ||
* http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This script is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
*/ | ||
|
||
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; | ||
|
||
trait BackendUserAuthenticationInjection | ||
{ | ||
protected BackendUserAuthentication $backendUserAuthentication; | ||
|
||
/** | ||
* @noinspection PhpUnused | ||
*/ | ||
public function injectBackendUserAuthentication(BackendUserAuthentication $backendUserAuthentication): void | ||
{ | ||
$this->backendUserAuthentication = $backendUserAuthentication; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/** | ||
* Defined starting with TYPO3 v12 | ||
* @noinspection PhpUndefinedClassInspection | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace In2code\In2publishCore\CommonInjection; | ||
|
||
use TYPO3\CMS\Core\DataHandling\PageDoktypeRegistry; | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
trait PageDoktypeRegistryInjection | ||
{ | ||
protected PageDoktypeRegistry $pageDoktypeRegistry; | ||
|
||
/** | ||
* @noinspection PhpUnused | ||
*/ | ||
public function injectPageDoktypeRegistry(PageDoktypeRegistry $pageDoktypeRegistry): void | ||
{ | ||
$this->pageDoktypeRegistry = $pageDoktypeRegistry; | ||
} | ||
} |
Oops, something went wrong.