{"id":22835395,"url":"https://github.com/dxw/phar-install","last_synced_at":"2025-04-24T00:09:11.951Z","repository":{"id":56973650,"uuid":"44748983","full_name":"dxw/phar-install","owner":"dxw","description":"Bundle up contents of vendor/ into vendor.phar file","archived":false,"fork":false,"pushed_at":"2022-11-20T13:47:08.000Z","size":47,"stargazers_count":19,"open_issues_count":2,"forks_count":4,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-24T00:09:05.418Z","etag":null,"topics":["composer","govpress","packagist","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/dxw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-22T14:00:51.000Z","updated_at":"2025-03-26T09:35:07.000Z","dependencies_parsed_at":"2022-08-21T11:50:16.186Z","dependency_job_id":null,"html_url":"https://github.com/dxw/phar-install","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxw%2Fphar-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxw%2Fphar-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxw%2Fphar-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxw%2Fphar-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxw","download_url":"https://codeload.github.com/dxw/phar-install/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535102,"owners_count":21446508,"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","govpress","packagist","php"],"created_at":"2024-12-12T22:09:39.476Z","updated_at":"2025-04-24T00:09:11.926Z","avatar_url":"https://github.com/dxw.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phar-install\n\nTool to bundle up contents of `vendor/` into `vendor.phar` file.\n\nThis may be useful if you want to put your project in a web-readable directory but you don't want to trawl through all the files in `vendor/` to make sure none of them could allow an attacker to do something they shouldn't be able to do.\n\n## Usage\n\nAdd the following to `composer.json`:\n\n```\n  \"scripts\": {\n    \"post-update-cmd\": \"vendor/bin/phar-install\"\n  },\n```\n\nAdd phar-install:\n\n```\ncomposer require --dev dxw/phar-install\n```\n\n`vendor.phar` will be rebuilt automatically every time `composer update` or `composer require` is run.\n\nNow just replace `require(__DIR__.'/vendor/autoload.php');` with `require(__DIR__.'/vendor.phar');`.\n\n### Get composer's autoloader\n\nYou can also get access to the autoloader object if needed. The phar file will return the autoloader. With this functionality you can add on your own project's namespaced files into the autoloader.\n\n```php\n$autoload = require_once __DIR__ . '/vendor.phar';\n$autoload-\u003eadd('MyNamespace', __DIR__ . '/src');\n```\n\n## Copyright\n\nCopyright dxw 2015 - see [COPYING.md](COPYING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxw%2Fphar-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxw%2Fphar-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxw%2Fphar-install/lists"}