-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Include file added event listener
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
Classes/ResourceStorageOperations/Listener/AfterFileAdded.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 B13\Proxycachemanager\ResourceStorageOperations\Listener; | ||
|
||
/* | ||
* This file is part of the b13 TYPO3 extensions family. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use TYPO3\CMS\Core\Resource\Event\AfterFileAddedEvent; | ||
|
||
/** | ||
* Imagine you add a new file but the old name was deleted via FTP, ensure this URL is cached | ||
* add all times | ||
*/ | ||
class AfterFileAdded extends AbstractListener | ||
{ | ||
public function __invoke(AfterFileAddedEvent $e): void | ||
{ | ||
$this->cacheService->flushCachesForFile($e->getFile()); | ||
} | ||
} |
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