JakubOnderka / PHP-Parallel-Lint

This tool check syntax of PHP files faster than serial check with fancier output.
Other
647 stars 62 forks source link

Instructions for creating PHAR are wrong #135

Open sebastianbergmann opened 5 years ago

sebastianbergmann commented 5 years ago

https://github.com/JakubOnderka/PHP-Parallel-Lint/blob/master/README.md#create-phar-package instructs to run

curl -LSs https://box-project.github.io/box2/installer.php | php

After that, box.phar exists in the current working directory.

The next instruction is

box build

but should be

php box.phar build

instead. But even then, I get an error:

[RuntimeException]                                                              
failed to get contents of '/usr/local/src/PHP-Parallel-Lint/parallel-lint.php'  

As a user who prefers to use PHARs of tools over installing them via Composer, I am lost. I do not care about how the PHAR for your tool is created. I want to be able to download a PHAR of your tool.

mstaack commented 5 years ago

Using the modern box version: https://github.com/humbug/box Remove box.json simply running box compile created a working parallel-lint.phar for me.

➜  PHP-Parallel-Lint git:(master) ls
LICENSE           README.md         appveyor.yml      bin               box.json          composer.json     composer.lock     parallel-lint     phpcs-ruleset.xml src               tests             vendor
➜  PHP-Parallel-Lint git:(master) rm box.json
➜  PHP-Parallel-Lint git:(master) ✗ box compile

    ____
   / __ )____  _  __
  / __  / __ \| |/_/
 / /_/ / /_/ />  <
/_____/\____/_/|_|

Box version 3.8.0@e7d8df3 2019-06-08 14:25:00 UTC

 // Loading without a configuration file.

🔨  Building the PHAR "/Users/max/PHP-Parallel-Lint/parallel-lint.phar"

? No compactor to register
? Adding main file: /Users/max/PHP-Parallel-Lint/parallel-lint
? Adding requirements checker
? Adding binary files
    > No file found
? Auto-discover files? Yes
? Exclude dev files? Yes
? Adding files
    > 29 file(s)
? Generating new stub
  - Using shebang line: #!/usr/bin/env php
  - Using banner:
    > Generated by Humbug Box 3.8.0@e7d8df3.
    >
    > @link https://github.com/humbug/box
? Dumping the Composer autoloader
? Removing the Composer dump artefacts
? No compression
? Setting file permissions to 0755
* Done.

No recommendation found.
No warning found.

 // PHAR: 55 files (166.78KB)
 // You can inspect the generated PHAR with the "info" command.

 // Memory usage: 6.32MB (peak: 6.51MB), time: <1sec

➜  PHP-Parallel-Lint git:(master) ✗ ls
LICENSE            README.md          appveyor.yml       bin                composer.json      composer.lock      parallel-lint      parallel-lint.phar phpcs-ruleset.xml  src                tests              vendor
jrfnl commented 2 years ago

Just FYI - as of version 1.3.0, the PHAR is part of the release assets. See: https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases