{"id":13497780,"url":"https://github.com/joshdifabio/composed","last_synced_at":"2025-03-01T03:51:53.916Z","repository":{"id":57001764,"uuid":"38938275","full_name":"joshdifabio/composed","owner":"joshdifabio","description":"Easily parse your project's Composer configuration, and those of its dependencies, at runtime","archived":false,"fork":false,"pushed_at":"2016-11-14T12:20:32.000Z","size":23,"stargazers_count":52,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T17:56:05.119Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshdifabio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-11T19:45:04.000Z","updated_at":"2025-02-16T04:21:03.000Z","dependencies_parsed_at":"2022-08-21T13:20:59.389Z","dependency_job_id":null,"html_url":"https://github.com/joshdifabio/composed","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdifabio%2Fcomposed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdifabio%2Fcomposed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdifabio%2Fcomposed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdifabio%2Fcomposed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshdifabio","download_url":"https://codeload.github.com/joshdifabio/composed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241313171,"owners_count":19942418,"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":[],"created_at":"2024-07-31T20:00:39.484Z","updated_at":"2025-03-01T03:51:53.898Z","avatar_url":"https://github.com/joshdifabio.png","language":"PHP","readme":"# Composed\n\n[![Code Quality](https://img.shields.io/scrutinizer/g/joshdifabio/composed.svg?style=flat-square)](https://scrutinizer-ci.com/g/joshdifabio/composed/)\n\nThis library provides a set of utility functions designed to help you parse your project's Composer configuration, and those of its dependencies, at runtime.\n\n## Usage\n\nThe API combines functional and object-oriented approaches.\n\n### Locate the vendor directory\n\n(Chicken and egg...)\n\n```php\n$absoluteVendorPath = Composed\\VENDOR_DIR;\n```\n\n### Locate the project's base directory\n\n```php\n$absoluteProjectPath = Composed\\BASE_DIR;\n```\n\n### Get the authors of a specific package\n\nYou can fetch data from the `composer.json` file of a specific package.\n\n```php\n$authors = Composed\\package_config('phpunit/phpunit', 'authors');\n\nassert($authors === [\n    [\n        'name' =\u003e \"Sebastian Bergmann\",\n        'email' =\u003e \"sebastian@phpunit.de\",\n        'role' =\u003e \"lead\",\n    ],\n]);\n```\n\n### Get licenses of all installed packages\n\nYou can fetch data from all `composer.json` files in your project in one go.\n\n```php\n$licenses = Composed\\package_configs('license');\n\nassert($licenses === [\n  'joshdifabio/composed' =\u003e \"MIT\",\n  'doctrine/instantiator' =\u003e \"MIT\",\n  'phpunit/php-code-coverage' =\u003e \"BSD-3-Clause\",\n]);\n```\n\n### Get the absolute path to a file in a package\n\n```php\n$path = Composed\\package('phpunit/phpunit')-\u003egetPath('composer.json');\n```\n\n### Get all packages installed on your project\n\n```php\nforeach (Composed\\packages() as $packageName =\u003e $package) {\n    $pathToPackageConfig = $package-\u003egetPath('composer.json');\n    // ...\n}\n```\n\n### Get data from your project's Composer config\n\nYou can also fetch data from the `composer.json` file located in your project root.\n\n```php\n$projectAuthors = Composed\\project_config('authors');\n\nassert($projectAuthors === [\n    [\n        'name' =\u003e 'Josh Di Fabio',\n        'email' =\u003e 'joshdifabio@somewhere.com',\n    ],\n]);\n```\n\n## Installation\n\nInstall Composed using [composer](https://getcomposer.org/).\n\n```\ncomposer require joshdifabio/composed\n```\n\n## Credits\n\nCredit goes to @igorw whose [get-in](https://github.com/igorw/get-in) library is partially copied into this library. Unfortunately, `igorw/get-in` requires PHP 5.4 while Composed aims for PHP 5.3 compatibility.\n\n## License\n\nComposed is released under the [MIT](https://github.com/joshdifabio/composed/blob/master/LICENSE) license.\n","funding_links":[],"categories":["Table of Contents","Dependency Management Extras","目录","PHP","其他的依赖管理 Dependency Management Extras"],"sub_categories":["Dependency Management Extras","依赖关系管理临时演员 dependency-management-extras"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdifabio%2Fcomposed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdifabio%2Fcomposed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdifabio%2Fcomposed/lists"}