mrclay/minify — pull request #69 by glensc (2013-09-01 12:52:27+00:00)
Title: add parameters support to getContentFunc Minify_Source callbacks

This is useful for getContent in Minify_Source if you need to pass extra data when building response content. Without this, I would have to duplicate logic in `foo`, so this would help to reuse existing variables, objects...

```php
public static function foo($configpath, $app, $opts = array()) {
/* @var $config */
require $configpath;
$cb = foobar::create($config, $app);
$lastModified = Minify_HTML_Helper::getLastModified($cb->getDependencies());

$config['load_module'] = !empty($_GET['cb']) ? (string)$_GET['cb'] : $config['instance'];

$opts = array(
'id' => $configpath . ':' . $app . ':'. $config['load_module'],
'lastModified' => $lastModified,
'getContentFunc' => array(__CLASS__, 'foo_callback'),
'getContentFuncParams' => array(
$cb,
$config,
),
);

$file = new Minify_Source($opts);
return $file;
}

public static function foo_callback($id, $cb, $config) {
return $cb->get($config);
}
```