Comments (5)
Of option 1 and 2, I would prefer option 1. Option 2 feels too likely to break.
Could the license text be added in the PHP code instead of external .txt files?
This
would seem cleaner to me, each license is just a few lines long, and could just
be
another option field in the file settings array?
I would advocate keeping the copyright statement together with the original
work, for
2 reasons:
1) If the user saves the webpage and moves it, then any non-linked resources
would be
lost.
2) Several licenses require that the copyright notice must be left intact, as
one
example the modern BSD license says "Redistributions of source code must retain
the
above copyright notice, this list of conditions and the following disclaimer."
Original comment by [email protected]
on 2 May 2008 at 6:53
from minify.
Outputting content before calling Minify::serve() will generally not work since
serve() sends headers and encodes content (so you'd have mixed encoding
garbage).
If you *really* want to keep the comments in the PHP code, you can use a
Minify_Source and directly give it the content:
new Minify_Source(array(
'id' => 'jsComments' // arbitrary, but required
,'content' => '/* put comments here */'
,'minifier' => ''
,'lastModified' => filemtime(__FILE__) // allows caching
))
Option 3: An option to prepend a multi-line comment that lists the files
compressed:
/* This file contains compressed versions of these source files:
http://example.com/js/jquery.js
http://example.com/js/dojo.js
http://example.com/js/user.js
Please see the above files for copyright/license information. */
I'm still not crazy about it. I think this should be manually done via Option 2,
rather than a bunch more Minify code.
Original comment by [email protected]
on 2 May 2008 at 8:17
from minify.
Option 3 looks good to me. :-)
Original comment by [email protected]
on 2 May 2008 at 10:01
from minify.
Taking cue from the YUI Compressor, I've added a "preserveComments" option
(default
true) to Minify_Javascript in r79. This preserves multi-line comments that
begin with
"/*!".
This requires minimal user modification to the sources, and is a pretty simple
system
with predictable output.
TODO: revise Minify_CSS to have the same option instead of sniffing for
"copyright".
Original comment by [email protected]
on 7 May 2008 at 8:21
- Changed state: Started
from minify.
Minify_Javascript now has the "preserveComments" option, and, by default,
preserves
multi-line comments that begin with "/*!".
Original comment by [email protected]
on 14 May 2008 at 4:18
- Changed state: Fixed
from minify.
Related Issues (20)
- does not fully optimize HOT 1
- Connection was reset when trying to minify bootstrap CSS
- i have aproblem with test_Minify_CSS.php HOT 1
- Minify does not run on IIS
- Minify is not using the full potential of Minification. HOT 2
- Minify ignores no-cache header sent form the client HOT 8
- Firefox - transition delay must be given with units even if it is 0s HOT 3
- Debug=true causing javascript file to load commented
- maxAge is not set to 365 days when query-string ends with number HOT 1
- So Many Errors HOT 1
- <cite> tag handled as a block tag and not as an inline tag as it should HOT 2
- Patch for /min/config.php HOT 1
- [deleted issue]
- Minifying method calls on bare Numbers fails HOT 2
- NetworkError: 500 Internal Server Error HOT 2
- please provide the cli minifier as a phar archive
- $_SERVER['DOCUMENT_ROOT'] for file path is unreliable
- How to use this minify inside another script package? eg myBB?
- PHP Warning: fclose()
- Calc with + removing space (v. 2.1.7) 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 minify.