Get from globals here https://github.com/owncloud/core/pull/8801/files#diff-e425f1180e041cc42a8d395327cddb54R59 and pass them in.