{"id":14966323,"url":"https://github.com/yiisoft/yii2-composer","last_synced_at":"2025-10-06T23:13:20.929Z","repository":{"id":10951823,"uuid":"13261957","full_name":"yiisoft/yii2-composer","owner":"yiisoft","description":"Yii 2 composer extension","archived":false,"fork":false,"pushed_at":"2025-02-13T20:59:56.000Z","size":9924,"stargazers_count":86,"open_issues_count":0,"forks_count":30,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-09-20T12:38:13.054Z","etag":null,"topics":["composer","hacktoberfest","yii","yii2"],"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":null,"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"],"tidelift":"packagist/yiisoft/yii2-composer"}},"created_at":"2013-10-02T03:26:28.000Z","updated_at":"2025-09-20T00:05:30.000Z","dependencies_parsed_at":"2025-04-11T20:38:20.678Z","dependency_job_id":"ebb7270d-49d1-47fb-bfaf-4a4807aab53e","html_url":"https://github.com/yiisoft/yii2-composer","commit_stats":{"total_commits":3885,"total_committers":146,"mean_commits":26.60958904109589,"dds":0.6190476190476191,"last_synced_commit":"2cd6eee19e94b9e98f3516340138041683350fcf"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/yiisoft/yii2-composer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii2-composer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii2-composer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii2-composer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii2-composer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiisoft","download_url":"https://codeload.github.com/yiisoft/yii2-composer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fyii2-composer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278693080,"owners_count":26029432,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["composer","hacktoberfest","yii","yii2"],"created_at":"2024-09-24T13:36:13.032Z","updated_at":"2025-10-06T23:13:20.902Z","avatar_url":"https://github.com/yiisoft.png","language":"PHP","funding_links":["https://opencollective.com/yiisoft","https://github.com/sponsors/yiisoft","https://tidelift.com/funding/github/packagist/yiisoft/yii2-composer"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://getcomposer.org/\" target=\"_blank\" rel=\"external\"\u003e\n        \u003cimg src=\"https://getcomposer.org/img/logo-composer-transparent3.png\" height=\"178px\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eYii 2 Composer Installer\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\nThis is the composer installer for [Yii framework 2.0](https://www.yiiframework.com) extensions.\nIt implements a new composer package type named `yii2-extension`,\nwhich should be used by all Yii 2 extensions if they are distributed as composer packages.\n\nFor license information check the [LICENSE](LICENSE.md)-file.\n\n[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-composer/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-composer)\n[![Total Downloads](https://poser.pugx.org/yiisoft/yii2-composer/downloads.png)](https://packagist.org/packages/yiisoft/yii2-composer)\n[![Build status](https://github.com/yiisoft/yii2-composer/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-composer/actions?query=workflow%3Abuild)\n\n\nUsage\n-----\n\nThe Yii 2 Composer Installer is automatically installed with when installing the framework via Composer.\n\nTo use Yii 2 composer installer, simply set the package `type` to be `yii2-extension` in your `composer.json`,\nlike the following:\n\n```json\n{\n    \"type\": \"yii2-extension\",\n    \"require\": {\n        \"yiisoft/yii2\": \"~2.0.0\"\n    },\n    ...\n}\n```\n\nYou may specify a bootstrapping class in the `extra` section. The `init()` method of the class will be executed each time\nthe Yii 2 application is responding to a request. For example,\n\n```json\n{\n    \"type\": \"yii2-extension\",\n    ...,\n    \"extra\": {\n        \"bootstrap\": \"yii\\\\jui\\\\Extension\"\n    }\n}\n```\n\nThe `Installer` class also implements a static method `postCreateProject()` that can be called after\na Yii 2 project is created, through the `post-create-project-cmd` composer script.\nA similar method exists for running tasks after each `composer install` call, which is `postInstall()`.\nThese methods allow to run other `Installer` class methods like `setPermission()` or `generateCookieValidationKey()`, \ndepending on the corresponding parameters set in the `extra` section of the `composer.json` file.\nFor example,\n\n```json\n{\n    \"name\": \"yiisoft/yii2-app-basic\",\n    \"type\": \"project\",\n    ...\n    \"scripts\": {\n        \"post-create-project-cmd\": [\n            \"yii\\\\composer\\\\Installer::postCreateProject\"\n        ],\n        \"post-install-cmd\": [\n            \"yii\\\\composer\\\\Installer::postInstall\"\n        ]\n    },\n    \"extra\": {\n        \"yii\\\\composer\\\\Installer::postCreateProject\": {\n            \"setPermission\": [\n                {\n                    \"runtime\": \"0777\",\n                    \"web/assets\": \"0777\",\n                    \"yii\": \"0755\"\n                }\n            ]\n        },\n        \"yii\\\\composer\\\\Installer::postInstall\": {\n            \"copyFiles\": [\n                {\n                    \"config/templates/console-local.php\": \"config/console-local.php\",\n                    \"config/templates/web-local.php\": \"config/web-local.php\",\n                    \"config/templates/db-local.php\": \"config/db-local.php\",\n                    \"config/templates/cache.json\": [\"runtime/cache.json\", true]\n                }\n            ],\n            \"generateCookieValidationKey\": [\n                \"config/web-local.php\"\n            ]\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fyii2-composer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiisoft%2Fyii2-composer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fyii2-composer/lists"}