Implementing custom hooks / intercept download requests for logging

Hello fellow OwnCloud community!

I wonder if there is a way to implement custom hooks? I found nothing about it on the documentation pages.
My goal is to intercept download requests for logging purposes.

Best regards,

Firstly, I'm not sure for my answer, it might be a ridiculous idea. If your purpose only log the downloaded file, maybe you can register a storage wrapper, and wrap fopen function. If it is in read mode you can log it in there. To add custom hook, you should add something in owncloud core, afaik it is not possible with only an app.

1 Like

That sounds interesting. I quickly looked into the activities app and they seem to be doing the same thing there. So I think I'm gonna try that.

Thank you very much for the hint!

You are welcome, wish to see your app in marketplace.