Use conditional declaration of debug() function to be compatible with TYPO3
Merge commit 'e26c54f07a31cd909e9b9c6632d6f5b169b40127' into 2.2