Closed GoogleCodeExporter closed 9 years ago
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 jm.spam...@gmail.com
on 2 May 2008 at 6:53
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 mrclay....@gmail.com
on 2 May 2008 at 8:17
Option 3 looks good to me. :-)
Original comment by jm.spam...@gmail.com
on 2 May 2008 at 10:01
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 mrclay....@gmail.com
on 7 May 2008 at 8:21
Minify_Javascript now has the "preserveComments" option, and, by default,
preserves
multi-line comments that begin with "/*!".
Original comment by mrclay....@gmail.com
on 14 May 2008 at 4:18
Original issue reported on code.google.com by
mrclay....@gmail.com
on 2 May 2008 at 5:13