jalmenarez / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Problems extending Minify_CSS due to static calls (proposed patch) #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify version: trunk
PHP version: >=5.2.1

Currently it is very difficult to extend Minify_CSS without copying methods
wholesale in the extended classes because Minify makes various static
calls, and uses static names in preg_callbacks.

I'm submitting a patch for the following:

* Using a className property in Minify_CSS for use in callbacks which
defaults to 'Minify_CSS', but can be overridden in extended classes to
whatever class name is being used (best to avoid get_class() or __CLASS__
as these have issues with static pre-binding before PHP 5.3).

Original issue reported on code.google.com by 1stv...@gmail.com on 28 Oct 2008 at 10:43

Attachments:

GoogleCodeExporter commented 9 years ago
Great simple solution. I'll use this technique in all places I use a static 
callback 
function. Thanks.

Original comment by mrclay....@gmail.com on 28 Oct 2008 at 2:22

GoogleCodeExporter commented 9 years ago
Patch applied in R275, and technique duplicated in Minify_HTML

Original comment by mrclay....@gmail.com on 16 Dec 2008 at 5:16