@tsteur opened this Pull Request on July 22nd 2019 Member

I will need this one in 3.11.0 ideally.

Moved the detection whether the file is up to date to a new method isFileContentSame(). It looks unneeded, but is useful when you have eg a class CdnFile {} and need to update the content of that file not only on one path, but also for other trusted hosts. Then you need to save the content basically again if just one of the files is out of date. This happens only when using a custom directory for tracker files.

eg /matomo/foo/$trustedHost/matomo.js
eg /matomo/foo/trusted.host.one/matomo.js
eg /matomo/foo/trusted.host.two/matomo.js
eg /matomo/foo/trusted.host.three/matomo.js

Then we don't just need to read/update/delete one file, but multiple times for each host.

For the same reason we need to return an array of which files were actually updated in the save() method. We might not just update the file in one path, but actually in multiple paths. And then we need to trigger an event for each updated file.

Ideally we would have this logic better in core somehow, but the way we use it is quite special and usually you wouldn't have a file per trusted host.

@tsteur commented on July 22nd 2019 Member

@mattab needing to merge this one to have it in the next release. It's covered by tests and only a very basic change.

This Pull Request was closed on July 22nd 2019
Powered by GitHub Issue Mirror