This ultimately calls the functions folderExists() and createFolder() in MaxServ\FalS3\Driver\AmazonS3Driver.
When a folder doesn't exist, the local runtime cache is updated with a false (line 377):
public function folderExists($folderIdentifier)
{
...
if (!array_key_exists($path, $this->folderExistsCache)) {
$this->folderExistsCache[$path] = is_dir($path);
}
...
}
When then the folder is created with createFolder() the runtime cache doesn't get updated resulting in an error in the next loop of folderExist().
The persistent cache is taken care of but not the local runtime cache (line 284):
I'm running into a problem when creating nested folders in a foreach loop.
This ultimately calls the functions folderExists() and createFolder() in MaxServ\FalS3\Driver\AmazonS3Driver.
When a folder doesn't exist, the local runtime cache is updated with a false (line 377):
When then the folder is created with createFolder() the runtime cache doesn't get updated resulting in an error in the next loop of folderExist().
The persistent cache is taken care of but not the local runtime cache (line 284):
This behaviour is easily fixed by unsetting the key in the local runtime cache after the creation of the folder
or even quicker with
I expect the same to be true for deleteFolder() but haven't tested it.