PHP code example of rokke / runtime

1. Go to this page and download the library: Download rokke/runtime library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rokke / runtime example snippets




okke\Runtime\Builder\ApplicationBuilder;

$app = ApplicationBuilder::create('0.0.0.0', 8000);

// Register modules before run()
// $app->container()->get(ModuleSystemInterface::class)->register(new MyModule());

$app->run(); // blocks — starts the Swoole TCP server

$lifecycle = $app->container()->get(LifecycleEventsInterface::class);
$lifecycle->onRunning(fn () => printf("Server listening on %s:%d\n", $host, $port));