public function initializeModules() { $modules = $this->poolObject->getAll(); foreach ($modules as $key => $object) { try { if (method_exists($object, 'setup')) { call_user_func([$object, 'setup']); echo 'setup() method exists and was called on module ' . $key . PHP_EOL; } } catch (\Exception $e) { echo 'Module ' . $key . ' was loaded, but could not be properly initialised. This can cause instability. The message given: ' . $e->getMessage() . PHP_EOL; continue; } } $this->getEventEmitter()->emit('wildphp.init.after'); }