{"id":15046077,"url":"https://github.com/wintercms/packager","last_synced_at":"2025-07-19T11:01:44.544Z","repository":{"id":45722425,"uuid":"370933114","full_name":"wintercms/packager","owner":"wintercms","description":"Run Composer commands within a PHP application","archived":false,"fork":false,"pushed_at":"2025-03-12T22:38:39.000Z","size":220,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-08T00:39:43.598Z","etag":null,"topics":["composer","hacktoberfest","php"],"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/wintercms.png","metadata":{"funding":{"github":"wintercms","open_collective":"wintercms"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-26T06:43:42.000Z","updated_at":"2024-05-14T13:25:34.000Z","dependencies_parsed_at":"2024-11-06T04:32:29.146Z","dependency_job_id":"2d7fc8ff-1b0c-4c2e-8d97-ac2efaee8aa8","html_url":"https://github.com/wintercms/packager","commit_stats":{"total_commits":100,"total_committers":3,"mean_commits":"33.333333333333336","dds":"0.030000000000000027","last_synced_commit":"e9be8c28bdc23a58db92854472f5a6d9fc00db2d"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/wintercms/packager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wintercms%2Fpackager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wintercms%2Fpackager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wintercms%2Fpackager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wintercms%2Fpackager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wintercms","download_url":"https://codeload.github.com/wintercms/packager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wintercms%2Fpackager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265921734,"owners_count":23849679,"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":["composer","hacktoberfest","php"],"created_at":"2024-09-24T20:52:40.644Z","updated_at":"2025-07-19T11:01:44.497Z","avatar_url":"https://github.com/wintercms.png","language":"PHP","funding_links":["https://github.com/sponsors/wintercms","https://opencollective.com/wintercms"],"categories":[],"sub_categories":[],"readme":"# Packager\n\nRun Composer commands and execute Composer searches and queries within a PHP application. This library acts as a PHP wrapper for Composer commands, allowing package management through PHP, and uses a combination of Composer, the Packagist API and your own project lockfile to derive information about the packages installed or available.\n\nYou technically *do not* need Composer to be installed, as this library will bring in the Composer application as a dependency - however, you will need Composer to install this library itself.\n\n## Use case\n\nThis library was written initially to provide Composer usage through PHP for [Winter CMS](https://github.com/wintercms/winter), to power\nits upgrade and plugin architecture. A portion of the Winter CMS user-base prefer web-based installation methods and prefer not to (or simply can't) use the command-line Composer application.\n\nThis library therefore leverages the power of Composer in maintaining dependencies and does so in a way that can be programatically controlled and presented in a friendlier format for these users.\n\n## Installation\n\nInstall via Composer:\n\n```\ncomposer require winter/packager\n```\n\n## Usage\n\nThis library currently provides support for the following Composer commands:\n\n- `install`\n- `search`\n- `show`\n- `update`\n- `version` **(--version)**\n\nYou can create a `Composer` instance in your PHP script and run these commands like so, defining a working directory which contains a `composer.json` file, and a home directory in which cached packages are stored.\n\n```php\n\u003c?php\nuse Winter\\Packager\\Composer;\n\n$composer = new Composer();\n$composer\n    -\u003esetWorkDir('/home/me/project/')\n    -\u003esetHomeDir('/tmp/composer');\n\n// Get the Composer version\n$version = $composer-\u003eversion();\n\n// Run an install or update on the entire project, including dev dependencies\n$install = $composer-\u003einstall();\n$update = $composer-\u003eupdate();\n\n// Install project without dev dependencies\n$install = $composer-\u003einstall(false);\n\n// Show installed packages\n$show = $composer-\u003eshow();\n\n// Search packages\n$results =\n```\n\nDocumentation on each command will be forthcoming soon.\n\n## Limitations\n\n- Composer uses `symfony/process` under the hood for various actions. Most shared hosts will not allow this work, by blocking either the `proc_*` functions or the `pcntl` extension. If this is the case for your host, you will be unable to use scripts or some plugins.\n\n## Security Implications\n\nNote that this library does introduce some security implications which you may need to consider before using.\n\n- If this library is used in a web-based environment, you must make the vendor folder and files writable for the user running your web server. You **should not** make your vendor folder web-accessible, otherwise this will become an easy vector for an attack.\n- Allowing scripts to run within Composer may grant the script access to your web environment or outlying PHP application. You should not run scripts unless you absolutely trust your dependencies.\n\n## Special thanks\n\n- [The Composer team](https://getcomposer.org)\n- User \"Endel\" from Stack Overflow, for [this answer](https://stackoverflow.com/a/25208897) which served as the inspiration for this library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwintercms%2Fpackager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwintercms%2Fpackager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwintercms%2Fpackager/lists"}