{"id":13497787,"url":"https://github.com/tommy-muehle/tooly-composer-script","last_synced_at":"2025-04-05T22:06:36.126Z","repository":{"id":9519314,"uuid":"62310260","full_name":"tommy-muehle/tooly-composer-script","owner":"tommy-muehle","description":"Simple composer script to manage phar files using project composer.json.","archived":false,"fork":false,"pushed_at":"2024-01-10T13:42:25.000Z","size":332,"stargazers_count":101,"open_issues_count":9,"forks_count":15,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-29T20:09:51.802Z","etag":null,"topics":["composer","composer-scripts","phar","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/tommy-muehle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-30T12:50:38.000Z","updated_at":"2024-01-22T03:14:41.000Z","dependencies_parsed_at":"2024-05-05T06:43:56.880Z","dependency_job_id":null,"html_url":"https://github.com/tommy-muehle/tooly-composer-script","commit_stats":{"total_commits":112,"total_committers":5,"mean_commits":22.4,"dds":0.125,"last_synced_commit":"0f2d81f1051d155702229abf1c8f7a0d8bec75c7"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommy-muehle%2Ftooly-composer-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommy-muehle%2Ftooly-composer-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommy-muehle%2Ftooly-composer-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommy-muehle%2Ftooly-composer-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommy-muehle","download_url":"https://codeload.github.com/tommy-muehle/tooly-composer-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406088,"owners_count":20933803,"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","composer-scripts","phar","php"],"created_at":"2024-07-31T20:00:39.690Z","updated_at":"2025-04-05T22:06:36.103Z","avatar_url":"https://github.com/tommy-muehle.png","language":"PHP","funding_links":[],"categories":["Table of Contents","Dependency Management Extras","PHP","其他的依赖管理 Dependency Management Extras","目录","Scripts","依赖管理( Dependency Management )","Ecosystem"],"sub_categories":["Dependency Management Extras","依赖关系管理临时演员 dependency-management-extras","Support","Dependency Management"],"readme":"# tooly-composer-script\n\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.6-8892BF.svg?style=flat-square)](https://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/tm/tooly-composer-script/v/stable)](https://packagist.org/packages/tm/tooly-composer-script)\n[![Total Downloads](https://poser.pugx.org/tm/tooly-composer-script/downloads)](https://packagist.org/packages/tm/tooly-composer-script)\n[![Build Status](https://travis-ci.org/tommy-muehle/tooly-composer-script.svg?branch=master)](https://travis-ci.org/tommy-muehle/tooly-composer-script)\n[![Build status](https://ci.appveyor.com/api/projects/status/l1xixknycxctd1sm?svg=true)](https://ci.appveyor.com/project/tommy-muehle/tooly-composer-script)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d895d331-4322-4708-8924-d80c32d3fb17/mini.png)](https://insight.sensiolabs.com/projects/d895d331-4322-4708-8924-d80c32d3fb17)\n[![License](https://poser.pugx.org/tm/tooly-composer-script/license)](https://packagist.org/packages/tm/tooly-composer-script)\n[![Gitter](https://badges.gitter.im/tommy-muehle/tooly-composer-script.svg)](https://gitter.im/tommy-muehle/tooly-composer-script?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\nWith tooly [composer-script](https://getcomposer.org/doc/articles/scripts.md) you can version needed PHAR files in your project's composer.json without adding them directly to a VCS, \n* to save disk space at vcs repository\n* to be sure that all developers in your project get the required toolchain\n* to prepare a CI/CD System\n* (optional) to automatically check the [GPG signature verification](https://www.gnupg.org/gph/en/manual/x135.html) for each tool \n\nEvery PHAR file will be saved in the [composer binary directory](https://getcomposer.org/doc/articles/vendor-binaries.md). \n\n## Example\n\nAn real example can be found [here](composer.json#L57-L76).\n\n## Requirements\n\n* PHP \u003e= 5.6\n* Composer\n \n## Install\n\nTo use the script execute the following command:\n\n```\ncomposer require --dev tm/tooly-composer-script\n```\n\nThen add the script in the composer.json under *\"scripts\"* with the event names you want to trigger.\nFor example:\n\n```\n...\n\"scripts\": {\n    \"post-install-cmd\": \"Tooly\\\\ScriptHandler::installPharTools\",\n    \"post-update-cmd\": \"Tooly\\\\ScriptHandler::installPharTools\"\n  },\n...\n```\n\nLook [here](https://getcomposer.org/doc/articles/scripts.md#event-names) for more informations about composer events.\n\n## Sample usage\n\nThe composer.json scheme has a part \"extra\" which is used for the script.\nIts described [here](https://getcomposer.org/doc/04-schema.md#extra).\n\nIn this part you can add your needed phar tools under the key \"tools\".\n\n```\n...\n\"extra\": {\n    ...\n    \"tools\": {\n      \"phpunit\": {\n        \"url\": \"https://phar.phpunit.de/phpunit-5.5.0.phar\",\n        \"sign-url\": \"https://phar.phpunit.de/phpunit-5.5.0.phar.asc\"\n      },\n      \"phpcpd\": {\n        \"url\": \"https://phar.phpunit.de/phpcpd-2.0.4.phar\",\n        \"only-dev\": true,\n        \"rename\": true\n      },\n      \"security-checker\": {\n        \"url\": \"http://get.sensiolabs.org/security-checker.phar\",\n        \"force-replace\": true\n      },\n    }\n    ...\n  }\n...\n```\n\n## Parameters\n\n### url (required)\n\nAfter you add the name of the tool as key, you need only one further parameter. The *\"url\"*.\nThe url can be a link to a specific version, such as x.y.z, or a link to the latest version for this phar.\n\n### rename (optional, default false)\n\nRename the downloaded tool to the name that is used as key.\n\n### sign-url (optional, default none)\n\nIf this parameter is set tooly checks if the PHAR file in url has a valid signature by \ncomparing signature in sign-url.\n\nThis option is useful if you want to be sure that the tool is from the expected author. \n\n*Note: For the check you need a further [requirement](https://packagist.org/packages/tm/gpg-verifier) and a GPG binary in your $PATH variable.*\n \nYou can add the requirement with this command:\n```composer require tm/gpg-verifier```\n\nThis check often fails if you dont has the public key from the tool author \nin your GPG keychain. \n\n### fallback-url (optional, default none)\n\nThis option is useful if you want to add an extra layer of stability to your daily build processes.\n\nIn case the required url is not accessible and a `fallback-url` is set, tooly uses the fallback url to download the phar file. \nThe fallback url can be a link to a specific version, such as x.y.z, or a link to the latest version for this phar.\n\n### force-replace (optional, default false)\n\nEvery time you update or install with composer the phar tools are checked. You are asked if you want to overwrite\nthe existing phar if the remote and local phar has not the same checksum.\n\nExcept you set this parameter. \n\nThis option is useful if you has a link to the latest version of a tool and always want a replacement.\nOr you run composer in non-interactive mode (for example in a CI system) and want a replacement.\n\nBut is also useful if some require-dev library has one of the tools as own requirement.\n \n### only-dev (optional, default true)\n\nThis parameter means that this phar is only needed in developing mode.\nSo the command ```composer [install|update] --no-dev``` ignores this phar tool.\n\n**Note: Therefore tooly must be a [no-dev requirement](https://getcomposer.org/doc/04-schema.md#require)** \n\n## A note to PhpStorm or other IDE users\n\nTo furthermore have auto-suggestion you should set the \"include_path\" option in the project.\n![PhpStorm setting](resources/phpstorm-setting.png)\n\n## Contributing\n\nPlease refer to [CONTRIBUTING.md](CONTRIBUTING.md) for information on how to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommy-muehle%2Ftooly-composer-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommy-muehle%2Ftooly-composer-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommy-muehle%2Ftooly-composer-script/lists"}