trm/trmengine

There is no license information available for the latest version (dev-master) of this package.

Start little framework TRMEngine.

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 1

pkg:composer/trm/trmengine

dev-master 2021-09-05 00:05 UTC

This package is auto-updated.

Last update: 2025-11-06 18:39:32 UTC


README

Небольшой фреймворк TRMEngine.

Пример использования:

$GlobalRequest = Request::createFromGlobals();
/**
 * @var TRMDIContainer
 */
$DIC = new TRMDIContainer();

// добавляем в контейнер объект Symfony\Component\HttpFoundation\Request
$DIC->set( $GlobalRequest );

$app = new TRMApplication( new TRMPathDispatcher($DIC), $DIC );
// обработчик исключений на самом верхнем уровне
$app->pipe( new ExceptionHandlerMiddleware() );
// далее стартуем с добавления спец. заголовка
$app->pipe( new StartMiddleware() );
// начинаем отсчет времени выполнения скрипта
$app->pipe( new ProfilerMiddleware() );

// получаем отклик (response) выполнения приложения
$Response = $app->handle( $app->getDIContainer()->get(Request::class) );

$Response->send();