Commit 154aacdd authored by Alexander Nitsche's avatar Alexander Nitsche Committed by Georg Ringer
Browse files

[TASK] Allow flushing of the internal StorageRepository cache

To explicitly refresh the internal cache of StorageRepository
when a file storage has been added/removed/updated, a public
method flush() has been added to the class.

Releases: master
Resolves: #93057
Change-Id: I514bc5c39f6749a171006968a8b513803c599f4d

Tested-by: default avatarTYPO3com <>
Tested-by: Georg Ringer's avatarGeorg Ringer <>
Reviewed-by: Benni Mack's avatarBenni Mack <>
Reviewed-by: Simon Gilli's avatarSimon Gilli <>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <>
parent a8663d87
......@@ -171,8 +171,8 @@ class StorageRepository implements LoggerAwareInterface
'This is the local fileadmin/ directory. This storage mount has been created automatically by TYPO3.',
) > 0) {
// reset to null to force reloading of storages
$this->storageRowCache = null;
// clear Cache to force reloading of storages
// call self for initialize Cache
......@@ -181,6 +181,18 @@ class StorageRepository implements LoggerAwareInterface
* Flush the internal storage caches to force reloading of storages with the next fetch.
* @internal
public function flush(): void
$this->storageRowCache = null;
$this->storageInstances = null;
$this->localDriverStorageCache = null;
* Finds storages by type, i.e. the driver used
......@@ -281,7 +293,7 @@ class StorageRepository implements LoggerAwareInterface
$dbConnection->insert($this->table, $field_values);
// Flush local resourceStorage cache so the storage can be accessed during the same request right away
$this->storageRowCache = null;
return (int)$dbConnection->lastInsertId($this->table);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment