Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Instructions for creating PHAR are wrong #135

Open
sebastianbergmann opened this issue Apr 12, 2019 · 2 comments
Open

Instructions for creating PHAR are wrong #135

sebastianbergmann opened this issue Apr 12, 2019 · 2 comments

Comments

@sebastianbergmann
Copy link

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
Copy link

mstaack commented Jul 31, 2019

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
Copy link

jrfnl commented Feb 17, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants