2017 © Pedro Peláez
 

library tooly-composer-script

Simple composer script to manage phar files.

image

tm/tooly-composer-script

Simple composer script to manage phar files.

  • Tuesday, March 20, 2018
  • by tommymuehle
  • Repository
  • 10 Watchers
  • 77 Stars
  • 46,372 Installations
  • PHP
  • 35 Dependents
  • 0 Suggesters
  • 7 Forks
  • 2 Open issues
  • 16 Versions
  • 21 % Grown

The README.md

tooly-composer-script

Minimum PHP Version Latest Stable Version Total Downloads Build Status Build status SensioLabsInsight License Gitter, (*1)

With tooly composer-script 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 for each tool, (*2)

Every PHAR file will be saved in the composer binary directory., (*3)

Example

An real example can be found here., (*4)

Requirements

  • PHP >= 5.6
  • Composer

Install

To use the script execute the following command:, (*5)

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:, (*6)

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

Look here for more informations about composer events., (*7)

Sample usage

The composer.json scheme has a part "extra" which is used for the script. Its described here., (*8)

In this part you can add your needed phar tools under the key "tools"., (*9)

...
"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

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., (*10)

rename (optional, default false)

Rename the downloaded tool to the name that is used as key., (*11)

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., (*12)

This option is useful if you want to be sure that the tool is from the expected author., (*13)

Note: For the check you need a further requirement and a GPG binary in your $PATH variable., (*14)

You can add the requirement with this command: composer require tm/gpg-verifier, (*15)

This check often fails if you dont has the public key from the tool author in your GPG keychain., (*16)

fallback-url (optional, default none)

This option is useful if you want to add an extra layer of stability to your daily build processes., (*17)

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., (*18)

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., (*19)

Except you set this parameter., (*20)

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., (*21)

But is also useful if some require-dev library has one of the tools as own requirement., (*22)

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., (*23)

Note: Therefore tooly must be a no-dev requirement, (*24)

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, (*25)

Contributing

Please refer to CONTRIBUTING.md for information on how to contribute., (*26)

The Versions

20/03 2018

dev-master

9999999-dev https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

20/03 2018

dev-respect-thirdparty-phars

dev-respect-thirdparty-phars https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

20/03 2018

1.2.6

1.2.6.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

21/07 2017

1.2.5

1.2.5.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

07/01 2017

1.2.4

1.2.4.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

06/01 2017

1.2.3

1.2.3.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

06/01 2017

dev-release/1.2.3

dev-release/1.2.3 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

28/11 2016

dev-release/1.3.0

dev-release/1.3.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

28/11 2016

1.2.2

1.2.2.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

13/09 2016

1.2.1

1.2.1.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

08/09 2016

1.2.0

1.2.0.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

13/08 2016

1.1.1

1.1.1.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

10/08 2016

1.1.0

1.1.0.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

composer phar phar-management composer-phar phar-handling gpg-verification composer-script

06/07 2016

1.0.0

1.0.0.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

composer phar-management composer-phar composer-script

04/07 2016

0.1.1

0.1.1.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

composer phar-management composer-phar composer-script

01/07 2016

0.1.0

0.1.0.0 https://github.com/tommy-muehle/tooly-composer-script

Simple composer script to manage phar files.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

composer phar-management composer-phar composer-script