use PhpAppInit\App; $app = new App(); $app->init();
use PhpAppInit\App; use PhpAppInit\Service\ServiceInterface; use PhpAppInit\Service\Service; $app = new App(); $app->init(); $service = new Service(); $app->registerService('my-service', $service);
use PhpAppInit\App; $app = new App(); $app->init(); $service = $app->getService('my-service'); $service->doSomething();In this example, we are retrieving the "my-service" service from the App instance and calling the "doSomething" method on it. Overall, PHP App Init provides a simple yet powerful way to initialize PHP applications. It is a package library that can be easily integrated into any PHP project, making it an ideal choice for developers who want to focus on writing code instead of setting up infrastructure.