File tree Expand file tree Collapse file tree
Classes/ResourceStorageOperations/Listener Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments