承接 bckp/roadrunner 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bckp/roadrunner

最新稳定版本:v1.0.0-RC3

Composer 安装命令:

composer require bckp/roadrunner

包简介

Integration of Nette Framework into RoadRunner

README 文档

README

build Coverage Status Downloads this Month Latest stable Coverage Status License

Integration of RoadRunner into Nette Framework

Installation

The best way to install Bckp/Roadrunner is using Composer:

$ composer require bckp/roadrunner

Then you need to create small update to your app.

Configure app

Create new RR config, in our case it is roadrunner.neon

extensions:
    roadrunner: Bckp\RoadRunner\DI\Extension

roadrunner:
    showExceptions: %debugMode%

Then we need to update our bootstrap, as RR extension is still big WIP, it is recomended not to enable debug mode. So in current Bootstrap we create new static method for booting into RR plugin

public static function bootRR(string $appDir): Configurator
{
    $configurator = new Configurator;

	$configurator->setTimeZone('Europe/Prague');
	$configurator->setTempDirectory($appDir . '/temp');

	$configurator->createRobotLoader()
		->addDirectory(__DIR__)
		->register();

	$configurator->addConfig($appDir . '/config/common.neon');
	$configurator->addConfig($appDir . '/config/services.neon');
	$configurator->addConfig($appDir . '/config/local.neon');
	$configurator->addConfig($appDir . '/config/roadrunner.neon');

	return $configurator;
}

And finally, we need our entrypoint that will be runned by RoadRunner, we call this script a roadrunner.php

<?php
declare(strict_types=1);

use Bckp\RoadRunner\RoadRunner;
use App\Bootstrap;

define('ROOT_DIR', dirname(__DIR__));
require ROOT_DIR . '/vendor/autoload.php';

/** @psalm-suppress PossiblyNullReference */
Bootstrap::bootRR(ROOT_DIR)
		 ->createContainer()
		 ->getByType(RoadRunner::class)
		 ->run();

and shell counterpart (we use it for redirect of err messages)

#!/usr/bin/env sh
exec php /app-path/app/roadrunner.php 2>&3

Now we can run RoadRunner with our app, simply run it

server:
    command: "sh /app-path/app/roadrunner.sh -d opcache.enable_cli=1"
    relay: "pipes"

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2023-12-04