gingteam/amphp-runtime

amphp runtime for symfony

Maintainers

👁 ging-dev

Package info

github.com/gingteam/amphp-runtime

pkg:composer/gingteam/amphp-runtime

Statistics

Installs: 20

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 0

dev-main 2022-01-06 10:54 UTC

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 1f9c055fefccc9c37a4d6628ee9b482c8cd8786e

  • ging-dev <thanh1101dev.woop@gmail.com>

This package is auto-updated.

Last update: 2026-06-06 20:17:37 UTC


README

// worker.php
<?php

use App\Kernel;
use GingTeam\AmphpRuntime\Runtime;

require_once dirname(__DIR__).'/vendor/autoload.php';

$app = function (array $context) {
 return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};

$options = [
 'project_dir' => dirname(__DIR__, 1),
 'document_root' => __DIR__,
 'port' => 8000,
];

$runtime = new Runtime($options);

[$app, $args] = $runtime->getResolver($app)->resolve();

$app = $app(...$args);

$runtime->getRunner($app)->run();