{"id":14966408,"url":"https://github.com/yiisoft/yii-runner-http","last_synced_at":"2025-10-19T09:31:21.243Z","repository":{"id":37084266,"uuid":"423784958","full_name":"yiisoft/yii-runner-http","owner":"yiisoft","description":"Yii HTTP Runner","archived":false,"fork":false,"pushed_at":"2024-04-04T15:07:43.000Z","size":132,"stargazers_count":10,"open_issues_count":3,"forks_count":4,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-04-14T00:31:14.773Z","etag":null,"topics":["hacktoberfest","http","runner","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},"funding":{"open_collective":"yiisoft","github":["yiisoft"]}},"created_at":"2021-11-02T09:42:53.000Z","updated_at":"2024-04-13T11:36:45.000Z","dependencies_parsed_at":"2023-12-13T03:34:45.289Z","dependency_job_id":"593d4bc0-7383-4d5a-afdb-74c8c729984a","html_url":"https://github.com/yiisoft/yii-runner-http","commit_stats":{"total_commits":103,"total_committers":12,"mean_commits":8.583333333333334,"dds":0.7475728155339806,"last_synced_commit":"24a40368994880dff38c421552ac86f668ccae9d"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":"yiisoft/package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii-runner-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii-runner-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii-runner-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii-runner-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiisoft","download_url":"https://codeload.github.com/yiisoft/yii-runner-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":217466853,"owners_count":16181502,"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","http","runner","yii3"],"created_at":"2024-09-24T13:36:20.495Z","updated_at":"2025-10-19T09:31:21.238Z","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 HTTP Runner\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\n[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii-runner-http/v)](https://packagist.org/packages/yiisoft/yii-runner-http)\n[![Total Downloads](https://poser.pugx.org/yiisoft/yii-runner-http/downloads)](https://packagist.org/packages/yiisoft/yii-runner-http)\n[![Build status](https://github.com/yiisoft/yii-runner-http/actions/workflows/build.yml/badge.svg)](https://github.com/yiisoft/yii-runner-http/actions/workflows/build.yml)\n[![Code coverage](https://codecov.io/gh/yiisoft/yii-runner-http/graph/badge.svg?token=C1uxQU6iLp)](https://codecov.io/gh/yiisoft/yii-runner-http)\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-http%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/yii-runner-http/master)\n[![Static analysis](https://github.com/yiisoft/yii-runner-http/actions/workflows/static.yml/badge.svg?branch=master)](https://github.com/yiisoft/yii-runner-http/actions/workflows/static.yml?query=branch%3Amaster)\n[![type-coverage](https://shepherd.dev/github/yiisoft/yii-runner-http/coverage.svg)](https://shepherd.dev/github/yiisoft/yii-runner-http)\n\nThe package contains a bootstrap for running Yii3 HTTP application.\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-http\n```\n\n## General usage\n\nIn your HTTP entry script do the following:\n\n```php\nuse Yiisoft\\Yii\\Runner\\Http\\HttpApplicationRunner;\n\nrequire_once __DIR__ . '/autoload.php';\n\n(new HttpApplicationRunner(\n    rootPath: __DIR__, \n    debug: $_ENV['YII_DEBUG'],\n    checkEvents: $_ENV['YII_DEBUG'],\n    environment: $_ENV['YII_ENV']\n))-\u003erun();\n```\n\n### Additional configuration\n\nBy default, the `HttpApplicationRunner` 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`$configModifiers` — [configuration modifiers](https://github.com/yiisoft/config#configuration-modifiers).\n\n`$configDirectory` — the relative path from `$rootPath` to the configuration storage location.\n\n`$vendorDirectory` — the relative path from `$rootPath` to the vendor directory.\n\n`$configMergePlanFile` — the relative path from `$configDirectory` to merge plan.\n\n`$logger` — the logger to collect errors while container is building.\n\n`$bufferSize` — the size of the buffer in bytes to send the content of the message body (default, 8Mb).\n\n`$temporaryErrorHandler` — a temporary error handler that is needed to handle creating of configuration and container \ninstances.\n\n`$emitter` — an emitter to send the response.\n\n`$useRemoveBodyByStatusMiddleware` — whether to remove the body of the response for specific response status codes.\n\n`$useContentLengthMiddleware` — whether to manage the `Content-Length` header to the response.\n\n`$useHeadRequestMiddleware` — whether to remove the body of the response for HEAD requests.\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\\Http\\HttpApplicationRunner $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\\Http\\HttpApplicationRunner $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\\Http\\HttpApplicationRunner $runner\n */\n\n$runner = $runner-\u003ewithTemporaryErrorHandler(\n    new Yiisoft\\ErrorHandler\\ErrorHandler($logger, $renderer),\n);\n```\n\n## Documentation\n\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 that.\nYou may also check out other [Yii Community Resources](https://www.yiiframework.com/community).\n\n## License\n\nThe Yii HTTP 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-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiisoft%2Fyii-runner-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fyii-runner-http/lists"}