I have an helper class with some static functions. All the functions in the class require a ‘heavy’ initialization function to run once (as if it were a constructor).
Is there a good practice for achieving this?
The only thing I thought of was calling an init
function, and breaking its flow if it has already run once (using a static $initialized
var). The problem is that I need to call it on every one of the class’s functions.