-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Add hook to flush class cache
This hook flushes the cache only if the environment is Development and the cacheCmd is 'all'
- Loading branch information
Showing
4 changed files
with
31 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Evoweb\Extender\Hooks; | ||
|
||
use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; | ||
use TYPO3\CMS\Core\Core\Environment; | ||
|
||
class ClearCacheHook | ||
{ | ||
public function __construct(protected PhpFrontend $classCache) | ||
{ | ||
} | ||
|
||
/** | ||
* @param array<non-empty-string, string|string[]> $parameters | ||
*/ | ||
public function clearCachePostProc(array $parameters): void | ||
{ | ||
if (Environment::getContext()->isDevelopment() && $parameters['cacheCmd'] === 'all') { | ||
$this->classCache->flush(); | ||
} | ||
} | ||
} |
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