Split the various calls here to avoid php warnings with new versions.
Sprinkle some static definitions to avoid warnings from PHP