PHPackages                             tm/tooly-composer-script - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tm/tooly-composer-script

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tm/tooly-composer-script
========================

Simple composer script to manage phar files.

1.4.1(6y ago)103280.1k↓34.6%14[4 PRs](https://github.com/tommy-muehle/tooly-composer-script/pulls)20MITPHPPHP &gt;=5.6.0

Since Jul 1Pushed 2y ago11 watchersCompare

[ Source](https://github.com/tommy-muehle/tooly-composer-script)[ Packagist](https://packagist.org/packages/tm/tooly-composer-script)[ Docs](https://github.com/tommy-muehle/tooly-composer-script)[ RSS](/packages/tm-tooly-composer-script/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (19)Used By (20)

tooly-composer-script
=====================

[](#tooly-composer-script)

[![Minimum PHP Version](https://camo.githubusercontent.com/86e7d829a466cacd5658a22073e27d49d39dac72cc18216ac4963ed5463c5bbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/585a7293197415c3b10d7030da949aa5f5621a9a4ca67f9d1e71e1d123fcbf60/68747470733a2f2f706f7365722e707567782e6f72672f746d2f746f6f6c792d636f6d706f7365722d7363726970742f762f737461626c65)](https://packagist.org/packages/tm/tooly-composer-script)[![Total Downloads](https://camo.githubusercontent.com/4d6ea3f37e1ddc65c08b61bdd81081ee554d468d98537af8e21f65c995d1c871/68747470733a2f2f706f7365722e707567782e6f72672f746d2f746f6f6c792d636f6d706f7365722d7363726970742f646f776e6c6f616473)](https://packagist.org/packages/tm/tooly-composer-script)[![Build Status](https://camo.githubusercontent.com/c83a535665adba84c22e1de683ef55fc88a5b35c9b5011da646968478284c372/68747470733a2f2f7472617669732d63692e6f72672f746f6d6d792d6d7565686c652f746f6f6c792d636f6d706f7365722d7363726970742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tommy-muehle/tooly-composer-script)[![Build status](https://camo.githubusercontent.com/4c0ba6bbe26d6d0dd4ee76466e4f33f969df1627a8567034c70ae91922122b34/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f6c317869786b6e79637863746431736d3f7376673d74727565)](https://ci.appveyor.com/project/tommy-muehle/tooly-composer-script)[![SensioLabsInsight](https://camo.githubusercontent.com/405c06c7f027eb0a116116f1efa8652aaa85cda9ea9922c342e0df568fdd73a0/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f64383935643333312d343332322d343730382d383932342d6438306333326433666231372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/d895d331-4322-4708-8924-d80c32d3fb17)[![License](https://camo.githubusercontent.com/42bf0b90e2e15bca9839f957a478797630da82ff270fd7f29aa0923d51e25902/68747470733a2f2f706f7365722e707567782e6f72672f746d2f746f6f6c792d636f6d706f7365722d7363726970742f6c6963656e7365)](https://packagist.org/packages/tm/tooly-composer-script)[![Gitter](https://camo.githubusercontent.com/f0750b2bc6786efaee8dcbdfbebb6de5d32d51154296237ad8c5456a220286c5/68747470733a2f2f6261646765732e6769747465722e696d2f746f6d6d792d6d7565686c652f746f6f6c792d636f6d706f7365722d7363726970742e737667)](https://gitter.im/tommy-muehle/tooly-composer-script?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

With 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,

- to save disk space at vcs repository
- to be sure that all developers in your project get the required toolchain
- to prepare a CI/CD System
- (optional) to automatically check the [GPG signature verification](https://www.gnupg.org/gph/en/manual/x135.html) for each tool

Every PHAR file will be saved in the [composer binary directory](https://getcomposer.org/doc/articles/vendor-binaries.md).

Example
-------

[](#example)

An real example can be found [here](composer.json#L57-L76).

Requirements
------------

[](#requirements)

- PHP &gt;= 5.6
- Composer

Install
-------

[](#install)

To use the script execute the following command:

```
composer require --dev tm/tooly-composer-script

```

Then add the script in the composer.json under *"scripts"* with the event names you want to trigger. For example:

```
...
"scripts": {
    "post-install-cmd": "Tooly\\ScriptHandler::installPharTools",
    "post-update-cmd": "Tooly\\ScriptHandler::installPharTools"
  },
...

```

Look [here](https://getcomposer.org/doc/articles/scripts.md#event-names) for more informations about composer events.

Sample usage
------------

[](#sample-usage)

The composer.json scheme has a part "extra" which is used for the script. Its described [here](https://getcomposer.org/doc/04-schema.md#extra).

In this part you can add your needed phar tools under the key "tools".

```
...
"extra": {
    ...
    "tools": {
      "phpunit": {
        "url": "https://phar.phpunit.de/phpunit-5.5.0.phar",
        "sign-url": "https://phar.phpunit.de/phpunit-5.5.0.phar.asc"
      },
      "phpcpd": {
        "url": "https://phar.phpunit.de/phpcpd-2.0.4.phar",
        "only-dev": true,
        "rename": true
      },
      "security-checker": {
        "url": "http://get.sensiolabs.org/security-checker.phar",
        "force-replace": true
      },
    }
    ...
  }
...

```

Parameters
----------

[](#parameters)

### url (required)

[](#url-required)

After you add the name of the tool as key, you need only one further parameter. The *"url"*. The url can be a link to a specific version, such as x.y.z, or a link to the latest version for this phar.

### rename (optional, default false)

[](#rename-optional-default-false)

Rename the downloaded tool to the name that is used as key.

### sign-url (optional, default none)

[](#sign-url-optional-default-none)

If this parameter is set tooly checks if the PHAR file in url has a valid signature by comparing signature in sign-url.

This option is useful if you want to be sure that the tool is from the expected author.

*Note: For the check you need a further [requirement](https://packagist.org/packages/tm/gpg-verifier) and a GPG binary in your $PATH variable.*

You can add the requirement with this command: `composer require tm/gpg-verifier`

This check often fails if you dont has the public key from the tool author in your GPG keychain.

### fallback-url (optional, default none)

[](#fallback-url-optional-default-none)

This option is useful if you want to add an extra layer of stability to your daily build processes.

In case the required url is not accessible and a `fallback-url` is set, tooly uses the fallback url to download the phar file. The 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.

### force-replace (optional, default false)

[](#force-replace-optional-default-false)

Every time you update or install with composer the phar tools are checked. You are asked if you want to overwrite the existing phar if the remote and local phar has not the same checksum.

Except you set this parameter.

This option is useful if you has a link to the latest version of a tool and always want a replacement. Or you run composer in non-interactive mode (for example in a CI system) and want a replacement.

But is also useful if some require-dev library has one of the tools as own requirement.

### only-dev (optional, default true)

[](#only-dev-optional-default-true)

This parameter means that this phar is only needed in developing mode. So the command `composer [install|update] --no-dev` ignores this phar tool.

**Note: Therefore tooly must be a [no-dev requirement](https://getcomposer.org/doc/04-schema.md#require)**

A note to PhpStorm or other IDE users
-------------------------------------

[](#a-note-to-phpstorm-or-other-ide-users)

To furthermore have auto-suggestion you should set the "include\_path" option in the project. [![PhpStorm setting](resources/phpstorm-setting.png)](resources/phpstorm-setting.png)

Contributing
------------

[](#contributing)

Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for information on how to contribute.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 98.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~77 days

Recently: every ~176 days

Total

15

Last Release

2520d ago

Major Versions

0.1.1 → 1.0.02016-07-06

PHP version history (2 changes)0.1.0PHP &gt;=5.5.0

1.1.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/618c748bc15b0e91e6280fcf687e28c1afaeb36335d634372d85f7eba3f0cf4f?d=identicon)[tommymuehle](/maintainers/tommymuehle)

---

Top Contributors

[![tommy-muehle](https://avatars.githubusercontent.com/u/1351840?v=4)](https://github.com/tommy-muehle "tommy-muehle (112 commits)")[![be-heiglandreas](https://avatars.githubusercontent.com/u/60882198?v=4)](https://github.com/be-heiglandreas "be-heiglandreas (1 commits)")[![hollodotme](https://avatars.githubusercontent.com/u/1557839?v=4)](https://github.com/hollodotme "hollodotme (1 commits)")

---

Tags

composercomposer-scriptspharphpcomposerpharcomposer-scriptphar-managementcomposer-pharphar-handling

### Embed Badge

![Health badge](/badges/tm-tooly-composer-script/health.svg)

```
[![Health](https://phpackages.com/badges/tm-tooly-composer-script/health.svg)](https://phpackages.com/packages/tm-tooly-composer-script)
```

###  Alternatives

[jean85/pretty-package-versions

A library to get pretty versions strings of installed dependencies

1.3k289.5M63](/packages/jean85-pretty-package-versions)[seld/phar-utils

PHAR file format utilities, for when PHP phars you up

875180.0M32](/packages/seld-phar-utils)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[clue/phar-composer

Simple phar creation for any project managed via Composer

862881.6k29](/packages/clue-phar-composer)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52722.0M859](/packages/bamarni-composer-bin-plugin)[composer/metadata-minifier

Small utility library that handles metadata minification and expansion.

181115.0M13](/packages/composer-metadata-minifier)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
