diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7579f74 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor +composer.lock diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e3c6564 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2019 Phpro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ccd4cd5 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +help: + @echo "Please use \`make ' where is one of" + @echo " run to perform GrumPHP tests" + @echo " compile to compile a shim" + +compile: + $(if $(TAG),,$(error TAG is not defined. Pass via "make compile TAG=4.2.1")) + @echo Compiling $(TAG) + BUILD_DIR := $(mktemp -d -t grumphp-shim-build) + @echo Cloning GrumPHP $(TAG) in directory $(BUILD_DIR) + cd $(BUILD_DIR) && git clone git@github.com:phpro/grumphp.git && git checkout tags/$(TAG) + ./vendor/bin/box compile --config="box.json" --working-dir=$(BUILD_DIR) + # rmdir -r $(BUILD_DIR) diff --git a/README.md b/README.md new file mode 100644 index 0000000..f4d86e8 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# GrumPHP shim + +This package provides GrumPHP without the struggle of installing all of its dependencies. + +## Usage + +Install the package + +```bash +composer require --dev phpro/grumphp-shim +``` + +and use it like the original executable + +```bash +vendor/bin/grumphp.phar run +``` + +Check out the main repo for more options [https://github.com/phpro/grumphp](https://github.com/phpro/grumphp). diff --git a/box.json b/box.json new file mode 100644 index 0000000..15c1b4f --- /dev/null +++ b/box.json @@ -0,0 +1,16 @@ +{ + "alias": "grumphp.phar", + "banner": false, + "force-autodiscovery": true, + "check-requirements": true, + "compactors": [ + "KevinGH\\Box\\Compactor\\PhpScoper" + ], + "files": ["LICENSE"], + "directories": [ + "resources", + "src", + "vendor" + ], + "output": "grumphp.phar" +} \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..8248f7c --- /dev/null +++ b/composer.json @@ -0,0 +1,45 @@ +{ + "name": "phpro/grumphp-shim", + "description": "GrumPHP Phar distribution", + "type": "composer-plugin", + "license": ["MIT"], + "authors": [ + { + "name": "Toon Verwerft", + "email": "toon.verwerft@phpro.be" + }, + { + "name": "Community", + "homepage": "https://github.com/phpro/grumphp/graphs/contributors" + } + ], + "bin": [ + "grumphp", + "grumphp.phar" + ], + "require": { + "php": "^7.1", + "ext-json": "*", + "composer-plugin-api": "~1.0" + }, + "require-dev": { + "humbug/box": "^3.8" + }, + "replace": { + "phpro/grumphp": "self.version" + }, + "config": { + "sort-packages": true + }, + "extra": { + "class": "GrumPHP\\Composer\\GrumPHPPlugin" + }, + "autoload": { + "psr-4": { + "GrumPHP\\": "src" + } + }, + "archive": { + "exclude": ["Makefile", "box.json"] + } +} diff --git a/src/Composer/GrumPHPPlugin.php b/src/Composer/GrumPHPPlugin.php new file mode 100644 index 0000000..5d99374 --- /dev/null +++ b/src/Composer/GrumPHPPlugin.php @@ -0,0 +1,17 @@ +write('GrumPHP shim registered. you\'ll need to activate grumphp manually for now.'); + } +}