public function run() { require_once EPROCESS_AUTOLOAD; $loop = Factory::create(); $messenger = MessengerFactory::client($this->unix, $loop); $application = ApplicationFactory::create($this->class); $application->messenger($messenger); $application->loop($loop); $application->data($this->data); $messenger->send('initialized', true); try { $application->run(); $loop->run(); } catch (\Exception $e) { echo $e; } }
<?php require_once __DIR__ . '/autoload.php'; use Doctrine\Common\Annotations\AnnotationRegistry; use EProcess\Application\ApplicationFactory; use Examples\Simple\Main; AnnotationRegistry::registerLoader(array($loader, 'loadClass')); /** * We are using namespaces structure to let external autoloader know where to find things. */ ApplicationFactory::launch(Main::class);