phpro / grumphp

A PHP code-quality tool
MIT License
4.15k stars 431 forks source link

Global grumphp or grumphp.phar (like phpunit) #42

Closed TheRatG closed 9 years ago

TheRatG commented 9 years ago

Hello, thanks for your library.

I suggest add new feature - run hook by grumphp.phar

Advantages:

TheRatG commented 9 years ago

https://github.com/box-project/box2 - create .phar https://github.com/box-project/amend - self-update command https://github.com/cpliakas/manifest-publisher - also for self-update command

veewee commented 9 years ago

That would indeed be a nice feature. Now it is possible to use composer global require, but you would have to change the path of the git hook manually.

igormukhingmailcom commented 9 years ago

I can help with this. Have some experience with tasks like that :)

veewee commented 9 years ago

Maybe it's a better idea to use composer for this?

composer global require phpro/grumphp

This way, GrumPHP will be installed globally in the ~/.composer/vendor/bin. Update is as easy as:

composer global update phpro/grmphp

Looks easier then creating phar + self-update stuff, since everybody is using composer these days. In the git hooks we will need to add something like:

PATH=$PATH:/full/path/to/project/vendor/bin
# Note: I need to check if this works on windows ...

This way we can change the command to just grumphp. It will first search all your system include paths (in which the global composer vendor/bin directory is added). When no script is found, it will use the one from the project vendor/bin directory.

What are your thoughts on this solution? A phar looks one step too far for me, since it can easliy be done with composer.

veewee commented 9 years ago

This one is implemented as mentioned above. More information: https://github.com/phpro/grumphp#global-installation

ad3n commented 9 years ago

I think is better use phar as optional. Like others php tool (php-cs-fixer, deployer, and many more) has own phar file for simplifying the task.

I think many people more familiar with phar instead of global package in composer.

ad3n commented 9 years ago

https://github.com/vinkla/climb/pull/28

ad3n commented 9 years ago

The reason why you need phar file instead of global composer