Coder Social home page Coder Social logo

Comments (5)

edorian avatar edorian commented on September 18, 2024

@theseer Is there anything I can do regarding this issue?

from autoload.

theseer avatar theseer commented on September 18, 2024

Sure, help me decide:
Currently the phar file adding code reuses the iterator the autoload builder used to find the files to process for the map. This may obviously be wrong when all files in the processed directory should be added no matter if the supplied limitations for the map processing part would have excluded them.

I'm not sure what would be the expected default behavior for the phar builder though? My current implementation is only a problem if non php files or deliberately excluded ones are to be added to the archive. To me that is - despite the valid usecases I see for it - an edge case.

Since both approaches should be supported, a cli option must be added to toggle either behavior. Question though remains: Which behavior should be default?

Once that's decided, the actual implementation is quite simple and consists of merely a few lines of code.

from autoload.

edorian avatar edorian commented on September 18, 2024

Thats an interesting question.

Honestly: I didn't see why phpab would generate a phar at all until I started thinking about shipping some libraries as phars.

Just being able to say require __DIR__ . '/vendor/lib.phar'; is up until now the nicest way I've found to consume external libs. It allows me to not care at all how their autoloading actually works and how to bootstrap them and so far. I don't even need to know the internal structure of the source tree.

Going back to the point: So I guess I mainly see phpab as an "make a nicely includeable phar out of my lib" and when doing so chances are i point it at the source folder of my project as I don't ship the testsuite in the phar.

If i have template files or images in my source folder I guess I expect them to be included in the phar as I tell phpab to "Bundle me source please".

I can't recall projects where there was lots of pointless stuff in the source tree except for one that had the tests in /test folders in every subfolder of /source.

So the question still is:

Is the default expectation that it just "phars the autoloader" or that it "phars the source folder".

Despite my previous statements about usage it kinda feels more natural to mee that "php autoload builder --phar" makes a phar with all the classes and the autoloading for those by default and then saying "--includeInPhar folderA --includeInPhar folderB".

So far my ideas on that .)

from autoload.

theseer avatar theseer commented on September 18, 2024

Implemented with commit d4df396. I really have to refactor the code though. The CLI class is doing way to many things in way to many ugly ways ;-)

from autoload.

sebastianbergmann avatar sebastianbergmann commented on September 18, 2024

http://github.com/sebastianbergmann/phpunit/commit/84456b9caf51d50ae065013aeab06e9b22f9652f :-)

from autoload.

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.