Comments (6)
Hi,
I have in the past an issue with the compression of a Phar when it's not done file by file (see my comment here: https://github.com/MacFJA/PharBuilder/blob/master/app/PharBuilder.php#L538)
(I don't know if the issue is still present in later PHP version. I can make some tests to check it.)
BTW, I like your solution ; but it's not very compatible with Windows, can you at least add a test on PHP_OS
before running ulimit
?
from pharbuilder.
Yeah, I will try to add a test on PHP_OS
later.
Thanks.
from pharbuilder.
I have in the past an issue with the compression of a Phar when it's not done file by file
@MacFJA do you have an example where you have this? I saw a similar suggestion on Box2 and I tried to apply it but only saw major performance degradation (box-project/box#29).
from pharbuilder.
Here some the test I run:
git clone https://github.com/jiaojie1989/PharBuilder.git --depth 2
git clone https://github.com/symfony/symfony-standard.git --branch v3.0.0 --depth 1
cd PharBuilder
git checkout 5fb2559c60a288784d8f377c6b7f0ac81a2573c4
composer install
cd ..
cd symfony-standard
composer install --no-scripts
php -d phar.readonly=0 ../PharBuilder/bin/phar-builder.php package -z --name app.phar -o ../ -s no -e web/app.php
The results:
OS: OS X (10.9.5)
Kernel: Darwin 13.4.0
PHP: 7.1.11
Ulimit: 4864
Result: Fail -> Message from the cli: "unable to create temporary file"
OS: Ubuntu 16.04
Kernel: Linux 4.13.0
PHP: 7.0.22
Ulimit: 4864 (previous value was 1024, raised to match OS X and validate the code test)
Result: Fail -> Message from the cli: "unable to create temporary file"
OS: OS X (10.9.5)
Kernel: Darwin 13.4.0
PHP: 5.6.31
Ulimit: 4864
Result: Fail -> Message from the cli: "unable to create temporary file"
Related PHP bugs:
I'm interested in results in other cases.
from pharbuilder.
Hm so if I'm understanding this right you're not doing this for performance reasons but because the Phar::compress()
hits a OS limitation about the number of files open? That's savage :/
Well I guess a workaround would be to have different compressing strategies depending of the number of files added... Still sounds like a pretty nasty bug that could be fixed at the PHAR extension level.
On the same note it's impressive to see the difference between buildFromIterator()
and addFromString()
(the former being 30x times faster in my case)
from pharbuilder.
Heads up: I actually manage to get it working on Box by bumping the OS limit of the max number of files opened (which is reverted afterwards obviously): https://github.com/humbug/box/blob/master/src/Console/Command/Compile.php#L624
from pharbuilder.
Related Issues (20)
- Default to current directory
- Update Similar project in READMe HOT 1
- Add before-script and after-script hooks HOT 20
- Warning for invalid directories HOT 10
- how to exclude directory add in phar. such as logs and temp HOT 3
- Add the possibility to avoid the shebang at the start of the file HOT 4
- Upgrading to version 3 HOT 5
- No PHAR in release-section for latest release HOT 1
- Trouble running the app in a headless CI-Server HOT 3
- Where is the phar of this app HOT 2
- Change the method MacFJA\PharBuilder\Utils\Composer::removeFilesAutoloadFor
- "skip-shebang": false doesn't have default HOT 5
- Fatal on broken Symlink HOT 1
- Add possibility to add files at root level
- Provide gpg signature for phar in releases
- Double slash not handled properly HOT 5
- Not bundling the composer file fails on some dependencies HOT 7
- No support for Symfony 4 HOT 6
- Documentation issues HOT 1
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 pharbuilder.