{"id":14966462,"url":"https://github.com/yiisoft/yii-runner-roadrunner","last_synced_at":"2025-05-12T13:15:08.922Z","repository":{"id":37083655,"uuid":"422578293","full_name":"yiisoft/yii-runner-roadrunner","owner":"yiisoft","description":"Web application runner for RoadRunner","archived":false,"fork":false,"pushed_at":"2025-05-07T22:40:44.000Z","size":152,"stargazers_count":32,"open_issues_count":1,"forks_count":10,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-12T13:14:51.877Z","etag":null,"topics":["hacktoberfest","roadrunner","yii3"],"latest_commit_sha":null,"homepage":"https://www.yiiframework.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiisoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"yiisoft","github":["yiisoft"]}},"created_at":"2021-10-29T13:04:47.000Z","updated_at":"2025-05-07T22:40:48.000Z","dependencies_parsed_at":"2024-02-25T03:32:09.276Z","dependency_job_id":"4fd4956e-54d0-4599-a458-6317af823840","html_url":"https://github.com/yiisoft/yii-runner-roadrunner","commit_stats":{"total_commits":106,"total_committers":16,"mean_commits":6.625,"dds":0.7547169811320755,"last_synced_commit":"1a6fc4b64af7a83ffea704f4393b61b578125a59"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":"yiisoft/package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii-runner-roadrunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii-runner-roadrunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii-runner-roadrunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii-runner-roadrunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiisoft","download_url":"https://codeload.github.com/yiisoft/yii-runner-roadrunner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745195,"owners_count":21957319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","roadrunner","yii3"],"created_at":"2024-09-24T13:36:25.148Z","updated_at":"2025-05-12T13:15:08.906Z","avatar_url":"https://github.com/yiisoft.png","language":"PHP","funding_links":["https://opencollective.com/yiisoft","https://github.com/sponsors/yiisoft"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/yiisoft\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://yiisoft.github.io/docs/images/yii_logo.svg\" height=\"100px\" alt=\"Yii\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eYii RoadRunner Runner\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\n[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii-runner-roadrunner/v)](https://packagist.org/packages/yiisoft/yii-runner-roadrunner)\n[![Total Downloads](https://poser.pugx.org/yiisoft/yii-runner-roadrunner/downloads)](https://packagist.org/packages/yiisoft/yii-runner-roadrunner)\n[![Build status](https://github.com/yiisoft/yii-runner-roadrunner/actions/workflows/build.yml/badge.svg)](https://github.com/yiisoft/yii-runner-roadrunner/actions/workflows/build.yml)\n[![Code Coverage](https://codecov.io/gh/yiisoft/yii-runner-roadrunner/branch/master/graph/badge.svg)](https://codecov.io/gh/yiisoft/yii-runner-roadrunner)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fyii-runner-roadrunner%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/yii-runner-roadrunner/master)\n[![static analysis](https://github.com/yiisoft/yii-runner-roadrunner/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/yii-runner-roadrunner/actions?query=workflow%3A%22static+analysis%22)\n[![type-coverage](https://shepherd.dev/github/yiisoft/yii-runner-roadrunner/coverage.svg)](https://shepherd.dev/github/yiisoft/yii-runner-roadrunner)\n\nThe package contains a bootstrap for running Yii3 applications using [RoadRunner](https://roadrunner.dev/).\n\n## Requirements\n\n- PHP 8.1 or higher.\n\n## Installation\n\nThe package could be installed with [Composer](https://getcomposer.org):\n\n```shell\ncomposer require yiisoft/yii-runner-roadrunner\n```\n\n## General usage\n\nGet RoadRunner:\n\n```shell\n./vendor/bin/rr get\n```\n\nCreate `worker.php` in your application root directory:\n\n```php\nuse Yiisoft\\Yii\\Runner\\RoadRunner\\RoadRunnerHttpApplicationRunner;\n\nini_set('display_errors', 'stderr');\n\nrequire_once __DIR__ . '/autoload.php';\n\n(new RoadRunnerHttpApplicationRunner(\n    rootPath: __DIR__, \n    debug: $_ENV['YII_DEBUG'], \n    checkEvents: $_ENV['YII_DEBUG'], \n    environment: $_ENV['YII_ENV']\n))-\u003erun();\n```\n\nSpecify it in your `.rr.yaml`:\n\n```yaml\nversion: '3'\nserver:\n    command: \"php ./worker.php\"\n\nrpc:\n    listen: tcp://127.0.0.1:6001\n\nhttp:\n    address: :8082\n    pool:\n        num_workers: 8\n        # Debug mode for the pool. In this mode, pool will not pre-allocate the worker.\n        # Worker (only 1, num_workers ignored) will be allocated right after the request arrived.\n        debug: false\n    middleware: [\"static\", \"headers\"]\n    static:\n        dir:   \"./public\"\n        forbid: [\".php\", \".htaccess\"]\n    headers:\n        response:\n            \"Cache-Control\": \"no-cache\"\n\nlogs:\n    mode: production\n    level: warn\n```\n\n\u003e **Note**:\n\u003e Official [configuration reference](https://roadrunner.dev/docs/intro-config/). You can also activate `RoadRunner`\n\u003e schema in your IDE to get autocompletion hints.\n\nRun RoadRunner with the config specified:\n\n```shell\n./rr serve\n```\n\n### Additional configuration\n\nBy default, the `RoadRunnerHttpApplicationRunner` is configured to work with Yii application templates and follows the\n[config groups convention](https://github.com/yiisoft/docs/blob/master/022-config-groups.md).\n\nYou can override the default configuration using constructor parameters and immutable setters.\n\n#### Constructor parameters\n\n`$rootPath` — the absolute path to the project root.\n\n`$debug` — whether the debug mode is enabled.\n\n`$checkEvents` — whether check events' configuration.\n\n`$environment` — the environment name.\n\n`$bootstrapGroup` — the bootstrap configuration group name.\n\n`$eventsGroup` — the events' configuration group name.\n\n`$diGroup` — the container definitions' configuration group name.\n\n`$diProvidersGroup` — the container providers' configuration group name.\n\n`$diDelegatesGroup` — the container delegates' configuration group name.\n\n`$diTagsGroup` — the container tags' configuration group name.\n\n`$paramsGroup` — the config parameters group name.\n\n`$nestedParamsGroups` — configuration group names that are included into config parameters group. This is needed for\nrecursive merge parameters.\n\n`$nestedEventsGroups` — configuration group names that are included into events' configuration group. This is needed for\nreverse and recursive merge events' configurations.\n\n#### Immutable setters\n\nIf the configuration instance settings differ from the default you can specify a customized configuration instance:\n\n```php\n/**\n * @var Yiisoft\\Config\\ConfigInterface $config\n * @var Yiisoft\\Yii\\Runner\\RoadRunner\\RoadRunnerHttpApplicationRunner $runner\n */\n\n$runner = $runner-\u003ewithConfig($config);\n```\n\nThe default container is `Yiisoft\\Di\\Container`. But you can specify any implementation\nof the `Psr\\Container\\ContainerInterface`:\n\n```php\n/**\n * @var Psr\\Container\\ContainerInterface $container\n * @var Yiisoft\\Yii\\Runner\\RoadRunner\\RoadRunnerHttpApplicationRunner $runner\n */\n\n$runner = $runner-\u003ewithContainer($container);\n```\n\nIn addition to the error handler that is defined in the container, the runner uses a temporary error handler.\nA temporary error handler is needed to handle the creation of configuration and container instances,\nthen the error handler configured in your application configuration will be used.\n\nBy default, the temporary error handler uses HTML renderer and logging to a file. You can override this as follows:\n\n```php\n/**\n * @var Psr\\Log\\LoggerInterface $logger\n * @var Yiisoft\\ErrorHandler\\Renderer\\PlainTextRenderer $renderer\n * @var Yiisoft\\Yii\\Runner\\RoadRunner\\RoadRunnerHttpApplicationRunner $runner\n */\n\n$runner = $runner-\u003ewithTemporaryErrorHandler(\n    new Yiisoft\\ErrorHandler\\ErrorHandler($logger, $renderer),\n);\n```\n\nYou can also use your own implementation of the `Spiral\\RoadRunner\\Http\\PSR7WorkerInterface`\n(default is a `Spiral\\RoadRunner\\Http\\PSR7Worker`):\n\n```php\n/**\n * @var Spiral\\RoadRunner\\Http\\PSR7WorkerInterface $psr7Worker\n * @var Yiisoft\\Yii\\Runner\\RoadRunner\\RoadRunnerHttpApplicationRunner $runner\n */\n\n$runner = $runner-\u003ewithPsr7Worker($psr7Worker);\n```\n\n## Temporal\n\nTemporal is a distributed, scalable, durable, and highly available orchestration engine used to execute asynchronous long-running business logic in a scalable and resilient way.\n\nExplore more about Temporal on [the official website](https://temporal.io) and in [the SDK repository](https://github.com/temporalio/sdk-php).\n\n\u003e If you want to add support for Temporal you need to install the SDK and configure workflows and activities as described below.\n\n### Installation\n\n```shell\ncomposer require temporal/sdk\n```\n\n### Configuration\n\nTemporal has at least two main class types: [Activity](https://docs.temporal.io/activities) and [Workflow](https://docs.temporal.io/workflows).\nAny activity must have the attribute `\\Temporal\\Activity\\ActivityInterface`:\n\n```php\nnamespace App\\Activity;\n\n#[\\Temporal\\Activity\\ActivityInterface]\nclass MyActivity\n{\n   // ...\n}\n```\n\nAny workflow must have the attribute `\\Temporal\\Workflow\\WorkflowInterface`.\n\n```php\nnamespace App\\Workflow;\n\n#[\\Temporal\\Workflow\\WorkflowInterface]\nclass MyWorkflow\n{\n   // ...\n}\n\n```\n\nConfigure Temporal engine to make it able to work with your activities and workflows in the `params.php`:\n\n```php\n// config/common/params.php\n\nreturn [\n    'yiisoft/yii-runner-roadrunner' =\u003e [\n        'temporal' =\u003e [\n            'enabled' =\u003e true,\n            'host' =\u003e 'localhost:7233', // host of Temporal engine\n            'workflows' =\u003e [\n                \\App\\Workflow\\MyWorkflow::class,\n            ],\n            'activities' =\u003e [\n                \\App\\Activity\\MyActivity::class,\n            ],\n        ],\n    ],\n]\n```\n\n\u003e If you use another container instead of `yiisoft/di`, make sure that \n\u003e `\\Yiisoft\\Yii\\Runner\\RoadRunner\\Temporal\\TemporalDeclarationProvider` \n\u003e is registered and returns all of your workflows and activities.\n\nThe last thing is to call `withTemporalEnabled(true)` on the `\\Yiisoft\\Yii\\Runner\\RoadRunner\\RoadRunnerHttpApplicationRunner` in the `public/index.php`:\n\n```php\n(new RoadRunnerHttpApplicationRunner())\n    -\u003ewithTemporalEnabled(true)\n    -\u003erun();\n```\n\n## Testing\n\n### Unit testing\n\nThe package is tested with [PHPUnit](https://phpunit.de/). To run tests:\n## Documentation\n\n- Guide: [English](docs/guide/en/README.md), [Português - Brasil](docs/guide/pt-BR/README.md), [Русский](docs/guide/ru/README.md)\n- [Internals](docs/internals.md)\n\nIf you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for\nthat. You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).\n\n## License\n\nThe Yii RoadRunner Runner is free software. It is released under the terms of the BSD License.\nPlease see [`LICENSE`](./LICENSE.md) for more information.\n\nMaintained by [Yii Software](https://www.yiiframework.com/).\n\n## Support the project\n\n[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective\u0026logoColor=7eadf1\u0026labelColor=555555)](https://opencollective.com/yiisoft)\n\n## Follow updates\n\n[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)\n[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter\u0026logoColor=1DA1F2\u0026labelColor=555555?style=flat)](https://twitter.com/yiiframework)\n[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat\u0026logo=telegram)](https://t.me/yii3en)\n[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat\u0026logo=facebook\u0026logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)\n[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat\u0026logo=slack)](https://yiiframework.com/go/slack)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fyii-runner-roadrunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiisoft%2Fyii-runner-roadrunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fyii-runner-roadrunner/lists"}