Comments (3)
There's a potential incompatibility if files packages in Phar archives use meta-programming to get code configuration from inside comments (it's rarely used, but could be). Still, this would trim down the size like you said. Give it a go if you have time.
from phar-util.
As noted in the issue reference regarding 65916ac, I'm taking a swing at this now. Looking at using php_strip_whitespace()
specifically, as it shouldn't matter how code is formatted. Feature is set to default to off, as well.
@koto, how's it look to you atm?
Once I test it out and make sure it works, I'll open up a pull request.
Also, apologies for the reference spammy. Accidentally committed on master.
ED: Relevant branch here: https://github.com/damianb/phar-util/tree/feature-stripcmts
from phar-util.
Did another commit after I tested it (and found zero effect, no stripping was actually occurring with that first commit!), and I've got a before-and-after on a project of mine where I use phar-build.
Take a look at yukari.phar, the Yukari core (it includes the OpenFlame DBAL and the OpenFlame Framework, plus the submodules for emberlabs\materia
and yukari\core
).
Also ignore the chown/chmod, it's an NTFS partition mounted in my linux distro. ;)
obsidian@lithion ~/code/yukari/main $ ls -lAh lib/
total 329K
drwxrwxrwx 1 root root 4.0K 2011-10-31 14:19 addons
-rwxrwxrwx 1 root root 314K 2011-11-01 20:30 yukari.phar
-rwxrwxrwx 1 root root 272 2011-11-01 20:35 yukari.phar.pubkey
Now, by setting the Yukari makefile to strip files matching the space delimited regexp set of .php$
, we get this:
obsidian@lithion ~/code/yukari/main $ ls -lAh lib/
total 161K
drwxrwxrwx 1 root root 4.0K 2011-10-31 14:19 addons
-rwxrwxrwx 1 root root 153K 2011-11-01 20:35 yukari.phar
-rwxrwxrwx 1 root root 272 2011-11-01 20:35 yukari.phar.pubkey
Nearly a 53% savings in filesize.
I've yet to perform a test to see if everything runs fine however, that's next for me to do. Need to finish my chem homework before I take a whack at that however.
from phar-util.
Related Issues (13)
- Use exit call on error? HOT 1
- RemotePharVerifier method "assertVerified" has borked docs
- error in condition in file RemotePharVerifier HOT 2
- Can't create self-executable phar. HOT 10
- RemotePharVerifier.php has a syntax error in 0.6.1 HOT 4
- Several test cases fail with errors
- phar-build encounters fatal error after commit 1865248c18704731b55302b4044e7614136629cd HOT 7
- Phar with Encryption
- Verify public key
- Pear channel/domain doesn't exist anymore HOT 1
- phar-build HOT 1
- phar-build always want to sign phar package 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 phar-util.