Comments (5)
@theseer Is there anything I can do regarding this issue?
from autoload.
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.
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.
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.
http://github.com/sebastianbergmann/phpunit/commit/84456b9caf51d50ae065013aeab06e9b22f9652f :-)
from autoload.
Related Issues (20)
- CI: move to GH Actions ? HOT 2
- Deprecation warning when running on PHP 8.2 HOT 2
- Integration within Box HOT 7
- Exclude directory HOT 2
- Make `--phar` reproducible HOT 34
- Add option to handle duplicate declarations across multiple files HOT 2
- Do not bail out on first duplicate code unit HOT 1
- evaluate introducing an "opcache prewarm list" HOT 1
- Add support for Composer's autolaoder and adding autoloading in code HOT 3
- Error with recursive Composer dependencies HOT 1
- Dep missing in Readme
- symfony/event-dispatcher Duplicate definitions of the following unit(s) found HOT 2
- `__halt_compiler` detection HOT 7
- Warnings and Notices in ComposerIterator
- Zeta Components ConsoleTools uses PHP syntax deprecated in PHP 7.4 HOT 1
- PHPAB 1.25.7 generates broken PHAR for PHPUnit
- Functions HOT 5
- Adopt, if needed, to PHP 8's T_NAME_FULLY_QUALIFIED, T_NAME_RELATIVE, and T_NAME_QUALIFIED tokens HOT 3
- Can't generate autoloader for nikic/php-parser HOT 2
- Array to string conversion on parsing composer.json HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autoload.