Skip to content

Commit 8673ee5

Browse files
committed
Initial commit
1 parent d9b039e commit 8673ee5

File tree

11 files changed

+1401
-1
lines changed

11 files changed

+1401
-1
lines changed

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: php
2+
sudo: false
3+
php:
4+
- 5.5
5+
- 5.6
6+
- 7.0
7+
- hhvm
8+
- nightly
9+
matrix:
10+
allow_failures:
11+
- php: nightly
12+
- php: hhvm
13+
before_install:
14+
- composer selfupdate
15+
install:
16+
- composer install --no-interaction --prefer-source
17+
script:
18+
- ./vendor/bin/phpunit
19+
notifications:
20+
email: false

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Contributing
2+
3+
## Workflow
4+
5+
* Fork the project
6+
* Make your bug fix or feature addition
7+
* Add tests for it. This is important so we don't break it in a future version unintentionally
8+
* Send a pull request
9+
10+
## Attention
11+
12+
Please make sure that you have set up your user name and email address for use with Git.
13+
Strings such as silly nick name <root@localhost> look really stupid in the commit history of a project.
14+
15+
Pull requests must be based on the current stable branch (master).

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Tommy Mühle
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,60 @@
1-
# tooly-composer-script
1+
# tooly-composer-script
2+
3+
[![Build Status](https://travis-ci.org/tommy-muehle/tooly-composer-script.svg?branch=master)](https://travis-ci.org/tommy-muehle/tooly-composer-script)
4+
5+
With the tooly [composer-script](https://getcomposer.org/doc/articles/scripts.md) aka hook you can manage needed phar files, such as phpunit, in your composer.json.
6+
Every phar file will be saved in the [composer binary directory](https://getcomposer.org/doc/articles/vendor-binaries.md).
7+
8+
## Example
9+
10+
For an quick example look at the [composer.json](composer.json#L48-L57) here.
11+
12+
## Install
13+
14+
To use the script just do the following single command:
15+
16+
```
17+
composer require tm/tooly-composer-script
18+
```
19+
20+
*Note:*
21+
There are no further dependencies in this library. Only PHP.
22+
23+
## Usage
24+
25+
The composer.json scheme has a part "extra" which is used for the script.
26+
Its described [here](https://getcomposer.org/doc/04-schema.md#extra).
27+
28+
In this part you can add your needed phar tools under the key "tools".
29+
30+
```
31+
...
32+
"extra": {
33+
...
34+
"tools": {
35+
"phpunit": {
36+
"url": "https://phar.phpunit.de/phpunit-4.8.9.phar",
37+
"only-dev": true
38+
},
39+
"phpcpd": {
40+
"url": "https://phar.phpunit.de/phpcpd-2.0.4.phar",
41+
"only-dev": true
42+
}
43+
}
44+
...
45+
}
46+
...
47+
```
48+
49+
After you add the name of the tool as key, you need only one further parameter. The *"url"*.
50+
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.
51+
52+
Every time you update or install with composer the phar tools are checked. You are asked if you want to overwrite
53+
the existing phar if the remote and local phar has not the same checksum.
54+
55+
The *"only-dev"* parameter is optional. Its default true and means that this phar is only needed in developing mode.
56+
So the command ```composer [install|update] --no-dev``` ignores this phar tool.
57+
58+
## Contributing
59+
60+
Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for information on how to contribute.

composer.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "tm/tooly-composer-script",
3+
"description": "Simple composer script to manage phar files.",
4+
"keywords": [
5+
"composer",
6+
"composer-script",
7+
"phar-management",
8+
"composer-phar"
9+
],
10+
"homepage": "https://github.com/tommy-muehle/tooly-composer-script",
11+
"authors": [
12+
{
13+
"name": "Tommy Muehle",
14+
"email": "tommy.muehle@gmail.com",
15+
"homepage": "https://tommy-muehle.de"
16+
}
17+
],
18+
"support": {
19+
"email": "tommy.muehle@gmail.com",
20+
"issues": "https://github.com/tommy-muehle/tooly-composer-script/issues",
21+
"docs": "https://github.com/tommy-muehle/tooly-composer-script/blob/master/README.md",
22+
"source": "https://github.com/tommy-muehle/tooly-composer-script/tree/master"
23+
},
24+
"license": "MIT",
25+
"autoload": {
26+
"psr-4": {
27+
"Tooly\\": "src/"
28+
}
29+
},
30+
"autoload-dev": {
31+
"psr-4": {
32+
"Tooly\\": "src/",
33+
"Tooly\\Tests\\": "tests/"
34+
}
35+
},
36+
"require": {
37+
"php": ">=5.5.0"
38+
},
39+
"require-dev": {
40+
"composer/composer": "1.*",
41+
"mikey179/vfsstream": "1.6.*"
42+
},
43+
"scripts": {
44+
"post-install-cmd": "Tooly\\ScriptHandler::installPharTools",
45+
"post-update-cmd": "Tooly\\ScriptHandler::installPharTools"
46+
},
47+
"extra": {
48+
"tools": {
49+
"phpunit": {
50+
"url": "https://phar.phpunit.de/phpunit-4.8.9.phar",
51+
"only-dev": true
52+
},
53+
"phpcpd": {
54+
"url": "https://phar.phpunit.de/phpcpd-2.0.4.phar",
55+
"only-dev": true
56+
}
57+
}
58+
}
59+
}

0 commit comments

Comments
 (0)