Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create phar and installer #4

Open
cryptiklemur opened this issue Jul 21, 2015 · 7 comments
Open

Create phar and installer #4

cryptiklemur opened this issue Jul 21, 2015 · 7 comments

Comments

@cryptiklemur
Copy link

Similar to Gush, Bldr, and Composer. A phar file, and an installer would make this a lot easier to install

@jmolivas
Copy link
Owner

@aequasi I tried but had some issue with the symlinks of each project example (bin/phpunit, bin/php-cs-fixer) when added to the phar file.

I will create a branch to start working on this feature and do some tests.

@geshan
Copy link

geshan commented Jul 22, 2015

I would also suggest using symfony console and you can use the box framework to create the phar file. thanks.

@jmolivas
Copy link
Owner

@geshan:

  • This project currently uses symfony/console as you can see on the composer.json file => https://github.com/jmolivas/phpqa/blob/master/composer.json#L16
  • And as mentioned below, I tried to use box but had some issues with the symlinks of each project example (bin/phpunit, bin/php-cs-fixer) when added to the phar file.

Also as mentioned below too, I will create a branch to start working on this feature and do some tests.

@geshan
Copy link

geshan commented Jul 22, 2015

thanks for letting me know @jmolivas , appreciated.

@jmolivas
Copy link
Owner

@aequasi and @geshan

I just push a new branch build-phar => https://github.com/jmolivas/phpqa/tree/build-phar

This branch includes a box.json file => https://github.com/jmolivas/phpqa/blob/build-phar/box.json with this content

{
    "alias": "phpqa.phar",
    "chmod": "0755",
    "directories": [
        "config",
        "src",
        "bin"
    ],
    "files": [
        "phpqa.yml",
        "bin/phpqa.php",
        "config/.php_cs",
        "config/phpunit.xml.dist",
        "vendor/autoload.php"
    ],
    "finder": [
        {
            "name": "/(\\.php|\\.json|\\.yml)$/",
            "exclude": ["Tests","tests", "docs"],
            "in": "vendor"
        }
    ],
    "main": "bin/phpqa.php",
    "output": "phpqa.phar",
    "stub": true
}

I ran the box project to build the phar using:

$ box build

And then extract the file phpqa.phar content using:

$ box extract phpqa.phar

After listing the bin directory, I found, the binary symlinks are no longer symlinks after building the phar file:
php-phar-symlinks

Because of this, the execution of this project, throws the following exception
phar-error

@cryptiklemur
Copy link
Author

are you including the symlink locations in the phar file? (vendor/bin/phpunit)

@jmolivas
Copy link
Owner

The box.json It's including the vendor directory but applying some filters
https://github.com/jmolivas/phpqa/blob/build-phar/box.json#L20

I will take a look at the extracted pharcontents and comment with the results

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

No branches or pull requests

3 participants