{"id":20940038,"url":"https://github.com/eviweb/composer-wrapper","last_synced_at":"2025-05-13T22:32:09.726Z","repository":{"id":6967310,"uuid":"8220064","full_name":"eviweb/composer-wrapper","owner":"eviweb","description":"Allows the use of composer from within a script, even if it is not installed.","archived":false,"fork":false,"pushed_at":"2022-03-17T15:34:41.000Z","size":250,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T09:37:30.560Z","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/eviweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2013-02-15T14:53:18.000Z","updated_at":"2023-02-21T08:02:04.000Z","dependencies_parsed_at":"2022-08-26T07:11:44.315Z","dependency_job_id":null,"html_url":"https://github.com/eviweb/composer-wrapper","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviweb%2Fcomposer-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviweb%2Fcomposer-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviweb%2Fcomposer-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviweb%2Fcomposer-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eviweb","download_url":"https://codeload.github.com/eviweb/composer-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036819,"owners_count":22003657,"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-11-18T23:08:40.095Z","updated_at":"2025-05-13T22:32:07.366Z","avatar_url":"https://github.com/eviweb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Composer Wrapper\n================\n    \nThis project aims to provide a way to use composer from within a script,\neven if it is not installed.\n    \n[![Build Status](https://travis-ci.org/eviweb/composer-wrapper.png?branch=master)](https://travis-ci.org/eviweb/composer-wrapper)\n    \nHow to install :\n----------------\nYou can choose between :    \n1.    clone this repo ```git clone https://github.com/eviweb/composer-wrapper.git```    \n2.    use composer by adding ```\"eviweb/composer-wrapper\" : \"1.*\"``` to the _require_ section of your _composer.json_    \n3.    directly download the [Wrapper.php](https://raw.github.com/eviweb/composer-wrapper/master/src/evidev/composer/Wrapper.php)   \n4.    dynamic install _see below_\n    \nHow to use :\n------------\n### Include the wrapper\nFirst, you need to include the wrapper into your code,\naccording to the previous installation choice :    \n    \n1.    add `require_once 'PATH_TO_COMPOSER_WRAPPER_DIRECTORY/src/evidev/composer/Wrapper.php';` where _PATH_TO_COMPOSER_WRAPPER_DIRECTORY_ is the path to the cloned repository    \n2.    add `require 'vendor/autoload.php';` please refer to the [Composer Documentation](http://getcomposer.org/doc/00-intro.md#autoloading)    \n3.    add `require_once 'PATH_TO_COMPOSER_WRAPPER_FILE';` where _PATH_TO_COMPOSER_WRAPPER_FILE_ is the path to the _Wrapper.php_ file    \n4.    add    \n```php\n$wrapper_file = sys_get_temp_dir() . '/Wrapper.php';\nif (!file_exists($wrapper_file)) {\n    file_put_contents(\n        $wrapper_file,\n        file_get_contents('https://raw.github.com/eviweb/composer-wrapper/master/src/evidev/composer/Wrapper.php')\n    );\n}\nrequire_once $wrapper_file;    \n```\n     \n### Use the wrapper\n1.    for a command line use, simply add `exit(\\evidev\\composer\\Wrapper::create()-\u003erun());` to your executable script    \n2.    if you want to use it in the body of your script, and pass specific arguments to the _Wrapper::run()_ method you need to do as the following :    \n```php\n$wc = \\evidev\\composer\\Wrapper::create();\n$exit_code = $wc-\u003erun(\"COMPOSER_OPTION_OR_COMMAND_AS_STRING\");\n// add more code here for example\nexit($exit_code);\n```\n     \nwhere _COMPOSER_OPTION_OR_COMMAND_AS_STRING_ is a composer option or command\n     \n### How it works    \nThe Wrapper downloads the `composer.phar` file when created.    \nBy default the `composer.phar` is downloaded in `sys_get_temp_dir()`, but you can specify a target directory \nby passing its path as a parameter of `Wrapper::create()`.    \nIf this parameter is an empty string or if the directory does not exist, `sys_get_temp_dir()` is used as fallback    \nIn case of use of many instances of the Wrapper, created with different directories _(which should never happened)_, \nthe first downloaded `composer.phar` is used.    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feviweb%2Fcomposer-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feviweb%2Fcomposer-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feviweb%2Fcomposer-wrapper/lists"}