public function __construct($context) { $this->context = new ApplicationContext($context); $this->earlyInstances[__CLASS__] = $this; $this->defineConstants(); $this->ensureRequiredEnvironment(); }