Code Monkey home page Code Monkey logo

Comments (7)

lucatume avatar lucatume commented on June 12, 2024

Hi,

Thank you.

WP-Browser is not a stand alone software and would require Composer to work in any case, I'm not that knowledgeable in phar format: any good idea/lead?

Luca

On 13 Mar 2015, at 04:19, mipon [email protected] wrote:

Hello,

Thanks for the hard work.

What about a phar file for this extension? I guess it is easier than using it with composer.


Reply to this email directly or view it on GitHub.

from wp-browser.

mipon avatar mipon commented on June 12, 2024

Phar allows you to pack all the dependency into a single phar file.

I've successfully created a phar file of your extension using Box.

What I did:

  • Installed Box and registered the box command on the system.
  • Checked out your repository to a local directory and downloaded all the dependencies using Composer into the directory. The structure looked like
    - wpcept 
        - src
        - tests
        - vendor
        - wpcept
        - wpcept.bat
        ... continues
  • Created a Box configuration file named box.json in that directory with the followings
{
    "files" :["autoload.php"],
    "directories": ["src", "vendor"],
    "main": "wpcept",
    "output": "wpcept.phar",
    "stub": true
}
  • cd to the directory and ran
$ box build

It produced a file named wpcept.phar with the size of about 14mb.

With the file, now I can do

$ php wpcept.phar --version

from wp-browser.

lucatume avatar lucatume commented on June 12, 2024

That is a fine thing!

Question: dependencies would be "frozen" in the phar file, how to cope with
daily dependencies updating? Do you know of a way to automate the phar
creation on a cron base (like 2/day)?

I'm not opposed to any idea: I am just ignorant in the matter.

On Fri, Mar 13, 2015 at 10:45 AM, mipon [email protected] wrote:

Phar allows you to pack all the dependency into a single phar file.

I've successfully created a phar file of your extension using Box
https://github.com/box-project/box2.

What I did:

  • Installed Box https://github.com/box-project/box2 and registered
    the box command on the system.
  • Checked out your repository to a local directory and downloaded all
    the dependencies using Composer into the directory. The structure looked
    like
    • wpcept
      • src
      • tests
      • vendor
      • wpcept
      • wpcept.bat
        ... continues
  • Created a Box configuration file named box.json in that directory
    with the followings

{
"files" :["autoload.php"],
"directories": ["src", "vendor"],
"main": "wpcept",
"output": "wpcept.phar",
"stub": true
}

  • cd to the directory and ran

$ box build

It produced a file named wpcept.phar with the size of about 14mb.

With the file, now I can do

$ php wpcept.phar --version


Reply to this email directly or view it on GitHub
https://github.com/lucatume/wp-browser/issues/13#issuecomment-78891324.

Luca

from wp-browser.

mipon avatar mipon commented on June 12, 2024

I don't know. You may be interested in how Codeception developers are doing as Codeception also relies on some dependencies.

I think it will be a good option for the user to have an application in a static manner because if one of the dependencies has a breaking change, the application may break. If that happens and the maintainer is on a vacation or something and the repository cannot be updated, the users will have no choice but a broken application until the maintainer comes back.

Another benefit of having a phar application is that tests will supposedly run faster on CI as downloading a single file should be faster than checking out all the dependencies.

One problem I can think of doing this is licensing. If the distributing phar file includes GPL licensed programs, it may need to be licensed under GPL or a compatible license type.

from wp-browser.

lucatume avatar lucatume commented on June 12, 2024

Ok, will look into it but not in the short time span. Good lead about Codeception though: thanks.

from wp-browser.

mipon avatar mipon commented on June 12, 2024

Looking forward to it.

from wp-browser.

lucatume avatar lucatume commented on June 12, 2024

I will close this until someone comes forward with a working proposal.

from wp-browser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.