Skip to content

Commit 07f2fbb

Browse files
committed
[BUGFIX] Include file added event listener
1 parent a304ba3 commit 07f2fbb

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
namespace B13\Proxycachemanager\ResourceStorageOperations\Listener;
5+
6+
/*
7+
* This file is part of the b13 TYPO3 extensions family.
8+
*
9+
* It is free software; you can redistribute it and/or modify it under
10+
* the terms of the GNU General Public License, either version 2
11+
* of the License, or any later version.
12+
*
13+
* For the full copyright and license information, please read the
14+
* LICENSE.txt file that was distributed with this source code.
15+
*
16+
* The TYPO3 project - inspiring people to share!
17+
*/
18+
19+
use TYPO3\CMS\Core\Resource\Event\AfterFileAddedEvent;
20+
21+
/**
22+
* Imagine you add a new file but the old name was deleted via FTP, ensure this URL is cached
23+
* add all times
24+
*/
25+
class AfterFileAdded extends AbstractListener
26+
{
27+
public function __invoke(AfterFileAddedEvent $e): void
28+
{
29+
$this->cacheService->flushCachesForFile($e->getFile());
30+
}
31+
}

Configuration/Services.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ services:
4242
- name: event.listener
4343
identifier: 'b13-proxycachemanager-beforeFolderRenamed'
4444
event: TYPO3\CMS\Core\Resource\Event\BeforeFolderRenamedEvent
45+
46+
B13\Proxycachemanager\ResourceStorageOperations\Listener\AfterFileAdded:
47+
tags:
48+
- name: event.listener
49+
identifier: 'b13-proxycachemanager-afterFileAdded'
50+
event: TYPO3\CMS\Core\Resource\Event\AfterFileAddedEvent

0 commit comments

Comments
 (0)